template_checker¶
check a header against best template
Module Attributes
Dictionary for mismatches in input ( |
|
Functions
|
given a template and hdr, find any mismatches (non-conforming errors) :param template: expected values :param current_hdr: values we currently have :returns: dictionary of tag key names and the have/expect values |
Classes
Dictionary for mismatches in input ( |
|
|
cache db connection and list of tags read a dicom file and report if it conforms to the expected template |
- class template_checker.CheckResult[source]¶
conforms
: false when aacq2sqlite.DBQuery.CONSTS
template-parameter betweeninput
andtemplate
mismatcherrors
: nested dict of {mismatched_param
:{'have':...,'expect':...}}
(parameter keyed dictionary withErrorCompare
values)input
: dict of all parameters of an input dicom headertemplate
: all the parameters of a template (matching Study, SeriesName)Also adcmmeta2tsv.TagValues
Here’s an example of
CheckResult
datastructure in html/javascript on the static debug-enabled page
- class template_checker.ErrorCompare[source]¶
Dictionary for mismatches in input (
have
key) and template (expect
key)
- class template_checker.TemplateChecker(db=None)[source]¶
cache db connection and list of tags read a dicom file and report if it conforms to the expected template
- check_file(dcm_path)[source]¶
File disbatch for
TemplateChecker.check_header()
- Parameters:
dcm_path – path to dicom file with header/parameters to read.
- Returns:
output of check_header
- Return type:
- template_checker.find_errors(template, current_hdr)[source]¶
given a template and hdr, find any mismatches (non-conforming errors) :param template: expected values :param current_hdr: values we currently have :returns: dictionary of tag key names and the have/expect values
- Parameters:
template (dict[str, str])
current_hdr (dict[str, str])
- Return type:
dict[str, ErrorCompare]