dicom_parser.utils package¶
Subpackages¶
Submodules¶
dicom_parser.utils.choice_enum module¶
-
class
dicom_parser.utils.choice_enum.
ChoiceEnum
(value)¶ Bases:
enum.Enum
An
Enum
with a custom class method that facilitates integration with a DjangoField
’schoices
attribute.
dicom_parser.utils.peek module¶
Based on this StackOverflow answer.
-
dicom_parser.utils.peek.
peek
(iterable: generator) → tuple¶ From Wikipedia: “peek is an operation which returns the value of the top of the collection without removing the value from the data.”
- Parameters
iterable (GeneratorType) – A generator object to peek into.
- Returns
A tuple containing the first item and the original generator, unless it is empty, then (None, None).
- Return type
dicom_parser.utils.read_file module¶
-
dicom_parser.utils.read_file.
read_file
(raw_input, read_data: bool = False) → pydicom.dataset.FileDataset¶ Return pydicom’s
FileDataset
instance based on the provided input.- Parameters
raw_input (
FileDataset
, str, or Path) – The DICOM image to be parsedread_data (bool) – Whether to include the pixel data or not
- Returns
Image data
- Return type
dicom_parser.utils.value_representation module¶
This file contains an Enum with the two-character codes of the various DICOM value-representations (VRs) (also see here) for header data elements.
-
class
dicom_parser.utils.value_representation.
ValueRepresentation
(value)¶ Bases:
dicom_parser.utils.choice_enum.ChoiceEnum
DICOM value-representations (VRs).
-
AE
= 'Application Entity'¶
-
AS
= 'Age String'¶
-
AT
= 'Attribute Tag'¶
-
CS
= 'Code String'¶
-
DA
= 'Date'¶
-
DS
= 'Decimal String'¶
-
DT
= 'Date Time'¶
-
FD
= 'Floating Point Double'¶
-
FL
= 'Floating Point Single'¶
-
IS
= 'Integer String'¶
-
LO
= 'Long String'¶
-
LT
= 'Long Text'¶
-
OB
= 'Other Byte'¶
-
OD
= 'Other Double'¶
-
OF
= 'Other Float'¶
-
OL
= 'Other Long'¶
-
OV
= 'Other 64-bit Very Long'¶
-
OW
= 'Other Word'¶
-
PN
= 'Person Name'¶
-
SH
= 'Short String'¶
-
SL
= 'Signed Long'¶
-
SQ
= 'Sequence of Items'¶
-
SS
= 'Signed Short'¶
-
ST
= 'Short Text'¶
-
SV
= 'Signed 64-bit Very Long'¶
-
TM
= 'Time'¶
-
UC
= 'Unlimited Characters'¶
-
UI
= 'Unique Identifer'¶
-
UL
= 'Unsigned Long'¶
-
UN
= 'Unknown'¶
-
UR
= 'Universal Resource'¶
-
US
= 'Unsigned Short'¶
-
UT
= 'Unlimited Text'¶
-
UV
= 'Unsigned 64-bit Very Long'¶
-
-
dicom_parser.utils.value_representation.
get_value_representation
(key: str) → dicom_parser.utils.value_representation.ValueRepresentation¶