Diverse Dicom reading functions to extract precise information.

pydcmio.dcmreader.reader.get_values(dataset_or_dcmpath, extractor)[source]

Get an extractor associated value(s).

Parameters:

dataset_or_dcmpath: dataset or str (mandatory)

a pydicom dataset structure or a path to a valid Dicom file.

extractor: str (mandatory)

the name of the extractor specified in the ‘STANDARD_EXTRACTOR’ global variable.

Returns:

values: list or an object

the phase encoding (none if not found).

pydcmio.dcmreader.reader.walk(dataset_or_dcmpath, tag, stack_values=False)[source]

Function to extract a tag associated value(s) from a Dicom dataset.

Note

Recusrive function is required as new enhanced storage presents only one Dicom containing several sub-sequence of fields. The walked is called on each sub-sequence.

Parameters:

dataset_or_dcmpath: dataset or str (mandatory)

a pydicom dataset structure or a path to a valid Dicom file.

tag: 2-uplet (mandatory)

the Dicom tag of the field containing the value to extract.

stack_values: bool (optional, default False)

if set to True, returns all the detected occurences, otherwise the first occurence only.

Returns:

values: list

the tag associated value(s). None if the field has not been found in the dataset.