[med-svn] [Git][med-team/pydicom][upstream] New upstream version 2.2.2
Andreas Tille (@tille)
gitlab at salsa.debian.org
Tue Dec 7 15:52:41 GMT 2021
Andreas Tille pushed to branch upstream at Debian Med / pydicom
Commits:
83d1cf1b by Andreas Tille at 2021-12-07T16:40:53+01:00
New upstream version 2.2.2
- - - - -
15 changed files:
- + .github/codespell_ignore_words.txt
- + .github/workflows/codespell.yml
- + .lgtm.yml
- pydicom/_dicom_dict.py
- pydicom/_private_dict.py
- pydicom/_uid_dict.py
- pydicom/_version.py
- pydicom/dataset.py
- pydicom/pixel_data_handlers/pillow_handler.py
- setup.cfg
- source/generate_cids/generate_concept_dicts.py
- source/generate_dict/generate_dicom_dict.py
- source/generate_dict/generate_private_dict.py
- source/generate_dict/generate_uid_dict.py
- source/generate_uids/generate_storage_sopclass_uids.py
Changes:
=====================================
.github/codespell_ignore_words.txt
=====================================
@@ -0,0 +1,4 @@
+ba
+complies
+ot
+siz
=====================================
.github/workflows/codespell.yml
=====================================
@@ -0,0 +1,17 @@
+---
+name: Codespell
+
+on:
+ push:
+ branches: [master]
+ pull_request:
+ branches: [master]
+
+jobs:
+ codespell:
+ name: Check for spelling errors
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout at v2
+ - uses: codespell-project/actions-codespell at master
=====================================
.lgtm.yml
=====================================
@@ -0,0 +1,6 @@
+---
+queries:
+ # https://lgtm.com/rules/1510014536001/
+ - exclude: py/clear-text-logging-sensitive-data
+ # https://lgtm.com/rules/1510006386081/
+ - exclude: py/clear-text-storage-sensitive-data
=====================================
pydicom/_dicom_dict.py
=====================================
@@ -482,6 +482,8 @@ DicomDictionary: Dict[int, Tuple[str, str, str, str, str]] = {
0x00143077: ('TM', '1', "Time of Gain Calibration", '', 'TimeOfGainCalibration'), # noqa
0x00143080: ('OB', '1', "Bad Pixel Image", '', 'BadPixelImage'), # noqa
0x00143099: ('LT', '1', "Calibration Notes", '', 'CalibrationNotes'), # noqa
+ 0x00143100: ('LT', '1', "Linearity Correction Technique", '', 'LinearityCorrectionTechnique'), # noqa
+ 0x00143101: ('LT', '1', "Beam Hardening Correction Technique", '', 'BeamHardeningCorrectionTechnique'), # noqa
0x00144002: ('SQ', '1', "Pulser Equipment Sequence", '', 'PulserEquipmentSequence'), # noqa
0x00144004: ('CS', '1', "Pulser Type", '', 'PulserType'), # noqa
0x00144006: ('LT', '1', "Pulser Notes", '', 'PulserNotes'), # noqa
@@ -562,9 +564,9 @@ DicomDictionary: Dict[int, Tuple[str, str, str, str, str]] = {
0x0014409C: ('DS', '1', "Translation Rate X", '', 'TranslationRateX'), # noqa
0x0014409D: ('DS', '1', "Translation Rate Y", '', 'TranslationRateY'), # noqa
0x0014409F: ('DS', '1', "Channel Overlap", '', 'ChannelOverlap'), # noqa
- 0x001440A0: ('LO', '1', "Image Quality Indicator Type", '', 'ImageQualityIndicatorType'), # noqa
- 0x001440A1: ('LO', '1', "Image Quality Indicator Material", '', 'ImageQualityIndicatorMaterial'), # noqa
- 0x001440A2: ('LO', '1', "Image Quality Indicator Size", '', 'ImageQualityIndicatorSize'), # noqa
+ 0x001440A0: ('LO', '1-n', "Image Quality Indicator Type", '', 'ImageQualityIndicatorType'), # noqa
+ 0x001440A1: ('LO', '1-n', "Image Quality Indicator Material", '', 'ImageQualityIndicatorMaterial'), # noqa
+ 0x001440A2: ('LO', '1-n', "Image Quality Indicator Size", '', 'ImageQualityIndicatorSize'), # noqa
0x00145002: ('IS', '1', "LINAC Energy", '', 'LINACEnergy'), # noqa
0x00145004: ('IS', '1', "LINAC Output", '', 'LINACOutput'), # noqa
0x00145100: ('US', '1', "Active Aperture", '', 'ActiveAperture'), # noqa
@@ -1869,7 +1871,7 @@ DicomDictionary: Dict[int, Tuple[str, str, str, str, str]] = {
0x00221628: ('SQ', '1', "Ophthalmic En Face Image Quality Rating Sequence", '', 'OphthalmicEnFaceImageQualityRatingSequence'), # noqa
0x00221630: ('DS', '1', "Quality Threshold", '', 'QualityThreshold'), # noqa
0x00221640: ('SQ', '1', "OCT B-scan Analysis Acquisition Parameters Sequence", '', 'OCTBscanAnalysisAcquisitionParametersSequence'), # noqa
- 0x00221642: ('UL', '1', "Number of B-scans Per Frame", '', 'NumberofBscansPerFrame'), # noqa
+ 0x00221642: ('UL', '1', "Number of B-scans Per Frame", '', 'NumberOfBscansPerFrame'), # noqa
0x00221643: ('FL', '1', "B-scan Slab Thickness", '', 'BscanSlabThickness'), # noqa
0x00221644: ('FL', '1', "Distance Between B-scan Slabs", '', 'DistanceBetweenBscanSlabs'), # noqa
0x00221645: ('FL', '1', "B-scan Cycle Time", '', 'BscanCycleTime'), # noqa
@@ -2803,9 +2805,9 @@ DicomDictionary: Dict[int, Tuple[str, str, str, str, str]] = {
0x00480112: ('DS', '1', "Objective Lens Power", '', 'ObjectiveLensPower'), # noqa
0x00480113: ('DS', '1', "Objective Lens Numerical Aperture", '', 'ObjectiveLensNumericalAperture'), # noqa
0x00480120: ('SQ', '1', "Palette Color Lookup Table Sequence", '', 'PaletteColorLookupTableSequence'), # noqa
- 0x00480200: ('SQ', '1', "Referenced Image Navigation Sequence", '', 'ReferencedImageNavigationSequence'), # noqa
- 0x00480201: ('US', '2', "Top Left Hand Corner of Localizer Area", '', 'TopLeftHandCornerOfLocalizerArea'), # noqa
- 0x00480202: ('US', '2', "Bottom Right Hand Corner of Localizer Area", '', 'BottomRightHandCornerOfLocalizerArea'), # noqa
+ 0x00480200: ('SQ', '1', "Referenced Image Navigation Sequence", 'Retired', 'ReferencedImageNavigationSequence'), # noqa
+ 0x00480201: ('US', '2', "Top Left Hand Corner of Localizer Area", 'Retired', 'TopLeftHandCornerOfLocalizerArea'), # noqa
+ 0x00480202: ('US', '2', "Bottom Right Hand Corner of Localizer Area", 'Retired', 'BottomRightHandCornerOfLocalizerArea'), # noqa
0x00480207: ('SQ', '1', "Optical Path Identification Sequence", '', 'OpticalPathIdentificationSequence'), # noqa
0x0048021A: ('SQ', '1', "Plane Position (Slide) Sequence", '', 'PlanePositionSlideSequence'), # noqa
0x0048021E: ('SL', '1', "Column Position In Total Image Pixel Matrix", '', 'ColumnPositionInTotalImagePixelMatrix'), # noqa
@@ -2999,6 +3001,7 @@ DicomDictionary: Dict[int, Tuple[str, str, str, str, str]] = {
0x0066001F: ('US', '1', "Vector Dimensionality", '', 'VectorDimensionality'), # noqa
0x00660020: ('FL', '1-n', "Vector Accuracy", '', 'VectorAccuracy'), # noqa
0x00660021: ('OF', '1', "Vector Coordinate Data", '', 'VectorCoordinateData'), # noqa
+ 0x00660022: ('OD', '1', "Double Point Coordinates Data", '', 'DoublePointCoordinatesData'), # noqa
0x00660023: ('OW', '1', "Triangle Point Index List", 'Retired', 'TrianglePointIndexList'), # noqa
0x00660024: ('OW', '1', "Edge Point Index List", 'Retired', 'EdgePointIndexList'), # noqa
0x00660025: ('OW', '1', "Vertex Point Index List", 'Retired', 'VertexPointIndexList'), # noqa
@@ -3115,6 +3118,22 @@ DicomDictionary: Dict[int, Tuple[str, str, str, str, str]] = {
0x00687003: ('SQ', '1', "Model Usage Code Sequence", '', 'ModelUsageCodeSequence'), # noqa
0x00687004: ('UI', '1', "Model Group UID", '', 'ModelGroupUID'), # noqa
0x00687005: ('UR', '1', "Relative URI Reference Within Encapsulated Document", '', 'RelativeURIReferenceWithinEncapsulatedDocument'), # noqa
+ 0x006A0001: ('CS', '1', "Annotation Coordinate Type", '', 'AnnotationCoordinateType'), # noqa
+ 0x006A0002: ('SQ', '1', "Annotation Group Sequence", '', 'AnnotationGroupSequence'), # noqa
+ 0x006A0003: ('UI', '1', "Annotation Group UID", '', 'AnnotationGroupUID'), # noqa
+ 0x006A0005: ('LO', '1', "Annotation Group Label", '', 'AnnotationGroupLabel'), # noqa
+ 0x006A0006: ('UT', '1', "Annotation Group Description", '', 'AnnotationGroupDescription'), # noqa
+ 0x006A0007: ('CS', '1', "Annotation Group Generation Type", '', 'AnnotationGroupGenerationType'), # noqa
+ 0x006A0008: ('SQ', '1', "Annotation Group Algorithm Identification Sequence", '', 'AnnotationGroupAlgorithmIdentificationSequence'), # noqa
+ 0x006A0009: ('SQ', '1', "Annotation Property Category Code Sequence", '', 'AnnotationPropertyCategoryCodeSequence'), # noqa
+ 0x006A000A: ('SQ', '1', "Annotation Property Type Code Sequence", '', 'AnnotationPropertyTypeCodeSequence'), # noqa
+ 0x006A000B: ('SQ', '1', "Annotation Property Type Modifier Code Sequence", '', 'AnnotationPropertyTypeModifierCodeSequence'), # noqa
+ 0x006A000C: ('UL', '1', "Number of Annotations", '', 'NumberOfAnnotations'), # noqa
+ 0x006A000D: ('CS', '1', "Annotation Applies to All Optical Paths", '', 'AnnotationAppliesToAllOpticalPaths'), # noqa
+ 0x006A000E: ('SH', '1-n', "Referenced Optical Path Identifier", '', 'ReferencedOpticalPathIdentifier'), # noqa
+ 0x006A000F: ('CS', '1', "Annotation Applies to All Z Planes", '', 'AnnotationAppliesToAllZPlanes'), # noqa
+ 0x006A0010: ('FD', '1-n', "Common Z Coordinate Value", '', 'CommonZCoordinateValue'), # noqa
+ 0x006A0011: ('OL', '1', "Annotation Index List", '', 'AnnotationIndexList'), # noqa
0x00700001: ('SQ', '1', "Graphic Annotation Sequence", '', 'GraphicAnnotationSequence'), # noqa
0x00700002: ('CS', '1', "Graphic Layer", '', 'GraphicLayer'), # noqa
0x00700003: ('CS', '1', "Bounding Box Annotation Units", '', 'BoundingBoxAnnotationUnits'), # noqa
@@ -4208,6 +4227,7 @@ DicomDictionary: Dict[int, Tuple[str, str, str, str, str]] = {
0x300A029C: ('DS', '1', "Source Applicator Wall Nominal Thickness", '', 'SourceApplicatorWallNominalThickness'), # noqa
0x300A029E: ('DS', '1', "Source Applicator Wall Nominal Transmission", '', 'SourceApplicatorWallNominalTransmission'), # noqa
0x300A02A0: ('DS', '1', "Source Applicator Step Size", '', 'SourceApplicatorStepSize'), # noqa
+ 0x300A02A1: ('IS', '1', "Applicator Shape Referenced ROI Number", '', 'ApplicatorShapeReferencedROINumber'), # noqa
0x300A02A2: ('IS', '1', "Transfer Tube Number", '', 'TransferTubeNumber'), # noqa
0x300A02A4: ('DS', '1', "Transfer Tube Length", '', 'TransferTubeLength'), # noqa
0x300A02B0: ('SQ', '1', "Channel Shield Sequence", '', 'ChannelShieldSequence'), # noqa
@@ -4386,7 +4406,7 @@ DicomDictionary: Dict[int, Tuple[str, str, str, str, str]] = {
0x300A062F: ('SQ', '1', "C-Arm Photon-Electron Control Point Sequence", '', 'CArmPhotonElectronControlPointSequence'), # noqa
0x300A0630: ('SQ', '1', "Referenced RT Radiation Sequence", '', 'ReferencedRTRadiationSequence'), # noqa
0x300A0631: ('SQ', '1', "Referenced RT Instance Sequence", '', 'ReferencedRTInstanceSequence'), # noqa
- 0x300A0632: ('SQ', '1', "Referenced RT Patient Setup Sequence", '', 'ReferencedRTPatientSetupSequence'), # noqa
+ 0x300A0632: ('SQ', '1', "Referenced RT Patient Setup Sequence", 'Retired', 'ReferencedRTPatientSetupSequence'), # noqa
0x300A0634: ('FD', '1', "Source to Patient Surface Distance", '', 'SourceToPatientSurfaceDistance'), # noqa
0x300A0635: ('SQ', '1', "Treatment Machine Special Mode Code Sequence", '', 'TreatmentMachineSpecialModeCodeSequence'), # noqa
0x300A0636: ('US', '1', "Intended Number of Fractions", '', 'IntendedNumberOfFractions'), # noqa
@@ -4415,7 +4435,7 @@ DicomDictionary: Dict[int, Tuple[str, str, str, str, str]] = {
0x300A064D: ('SQ', '1', "RT Beam Limiting Device Definition Sequence", '', 'RTBeamLimitingDeviceDefinitionSequence'), # noqa
0x300A064E: ('CS', '1', "Parallel RT Beam Delimiter Opening Mode", '', 'ParallelRTBeamDelimiterOpeningMode'), # noqa
0x300A064F: ('CS', '1-n', "Parallel RT Beam Delimiter Leaf Mounting Side", '', 'ParallelRTBeamDelimiterLeafMountingSide'), # noqa
- 0x300A0650: ('UI', '1', "Patient Setup UID", '', 'PatientSetupUID'), # noqa
+ 0x300A0650: ('UI', '1', "Patient Setup UID", 'Retired', 'PatientSetupUID'), # noqa
0x300A0651: ('SQ', '1', "Wedge Definition Sequence", '', 'WedgeDefinitionSequence'), # noqa
0x300A0652: ('FD', '1', "Radiation Beam Wedge Angle", '', 'RadiationBeamWedgeAngle'), # noqa
0x300A0653: ('FD', '1', "Radiation Beam Wedge Thin Edge Distance", '', 'RadiationBeamWedgeThinEdgeDistance'), # noqa
@@ -4516,6 +4536,33 @@ DicomDictionary: Dict[int, Tuple[str, str, str, str, str]] = {
0x300A0780: ('SQ', '1', "Additional Parameter Recording Instance Sequence", '', 'AdditionalParameterRecordingInstanceSequence'), # noqa
0x300A0782: ('US', '1', "", 'Retired', ''), # noqa
0x300A0783: ('ST', '1', "Interlock Origin Description", '', 'InterlockOriginDescription'), # noqa
+ 0x300A0784: ('SQ', '1', "RT Patient Position Scope Sequence", '', 'RTPatientPositionScopeSequence'), # noqa
+ 0x300A0785: ('UI', '1', "Referenced Treatment Position Group UID", '', 'ReferencedTreatmentPositionGroupUID'), # noqa
+ 0x300A0786: ('US', '1', "Radiation Order Index", '', 'RadiationOrderIndex'), # noqa
+ 0x300A0787: ('SQ', '1', "Omitted Radiation Sequence", '', 'OmittedRadiationSequence'), # noqa
+ 0x300A0788: ('SQ', '1', "Reason for Omission Code Sequence", '', 'ReasonforOmissionCodeSequence'), # noqa
+ 0x300A0789: ('SQ', '1', "RT Delivery Start Patient Position Sequence", '', 'RTDeliveryStartPatientPositionSequence'), # noqa
+ 0x300A078A: ('SQ', '1', "RT Treatment Preparation Patient Position Sequence", '', 'RTTreatmentPreparationPatientPositionSequence'), # noqa
+ 0x300A078B: ('SQ', '1', "Referenced RT Treatment Preparation Sequence", '', 'ReferencedRTTreatmentPreparationSequence'), # noqa
+ 0x300A078C: ('SQ', '1', "Referenced Patient Setup Photo Sequence", '', 'ReferencedPatientSetupPhotoSequence'), # noqa
+ 0x300A078D: ('SQ', '1', "Patient Treatment Preparation Method Code Sequence", '', 'PatientTreatmentPreparationMethodCodeSequence'), # noqa
+ 0x300A078E: ('LT', '1', "Patient Treatment Preparation Procedure Parameter Description", '', 'PatientTreatmentPreparationProcedureParameterDescription'), # noqa
+ 0x300A078F: ('SQ', '1', "Patient Treatment Preparation Device Sequence", '', 'PatientTreatmentPreparationDeviceSequence'), # noqa
+ 0x300A0790: ('SQ', '1', "Patient Treatment Preparation Procedure Sequence", '', 'PatientTreatmentPreparationProcedureSequence'), # noqa
+ 0x300A0791: ('SQ', '1', "Patient Treatment Preparation Procedure Code Sequence", '', 'PatientTreatmentPreparationProcedureCodeSequence'), # noqa
+ 0x300A0792: ('LT', '1', "Patient Treatment Preparation Method Description", '', 'PatientTreatmentPreparationMethodDescription'), # noqa
+ 0x300A0793: ('SQ', '1', "Patient Treatment Preparation Procedure Parameter Sequence", '', 'PatientTreatmentPreparationProcedureParameterSequence'), # noqa
+ 0x300A0794: ('LT', '1', "Patient Setup Photo Description", '', 'PatientSetupPhotoDescription'), # noqa
+ 0x300A0795: ('US', '1', "Patient Treatment Preparation Procedure Index", '', 'PatientTreatmentPreparationProcedureIndex'), # noqa
+ 0x300A0796: ('US', '1', "Referenced Patient Setup Procedure Index", '', 'ReferencedPatientSetupProcedureIndex'), # noqa
+ 0x300A0797: ('SQ', '1', "RT Radiation Task Sequence", '', 'RTRadiationTaskSequence'), # noqa
+ 0x300A0798: ('SQ', '1', "RT Patient Position Displacement Sequence", '', 'RTPatientPositionDisplacementSequence'), # noqa
+ 0x300A0799: ('SQ', '1', "RT Patient Position Sequence", '', 'RTPatientPositionSequence'), # noqa
+ 0x300A079A: ('LO', '1', "Displacement Reference Label", '', 'DisplacementReferenceLabel'), # noqa
+ 0x300A079B: ('FD', '16', "Displacement Matrix", '', 'DisplacementMatrix'), # noqa
+ 0x300A079C: ('SQ', '1', "Patient Support Displacement Sequence", '', 'PatientSupportDisplacementSequence'), # noqa
+ 0x300A079D: ('SQ', '1', "Displacement Reference Location Code Sequence", '', 'DisplacementReferenceLocationCodeSequence'), # noqa
+ 0x300A079E: ('CS', '1', "RT Radiation Set Delivery Usage", '', 'RTRadiationSetDeliveryUsage'), # noqa
0x300C0002: ('SQ', '1', "Referenced RT Plan Sequence", '', 'ReferencedRTPlanSequence'), # noqa
0x300C0004: ('SQ', '1', "Referenced Beam Sequence", '', 'ReferencedBeamSequence'), # noqa
0x300C0006: ('IS', '1', "Referenced Beam Number", '', 'ReferencedBeamNumber'), # noqa
=====================================
pydicom/_private_dict.py
=====================================
@@ -7,6 +7,7 @@ dictionary key is a map of DICOM tag to (VR, VM, name, is_retired).
"""
from typing import Dict, Tuple
+
private_dictionaries: Dict[str, Dict[str, Tuple[str, str, str, str]]] = {
'1.2.840.113663.1': {
'0029xx00': ('US', '1', 'Unknown', ''), # noqa
@@ -333,7 +334,7 @@ private_dictionaries: Dict[str, Dict[str, Tuple[str, str, str, str]]] = {
'3103xxa0': ('DA', '1', 'AMI Annotation Creation Date (RET)', ''), # noqa
'3103xxb0': ('TM', '1', 'AMI Annotation Creation Time (RET)', ''), # noqa
'3103xxc0': ('DA', '1', 'AMI Annotation Modification Dates (RET)', ''), # noqa
- '3103xxd0': ('TM', '1', 'AMI Annotation Mofification Times (RET)', ''), # noqa
+ '3103xxd0': ('TM', '1', 'AMI Annotation Modification Times (RET)', ''), # noqa
'3103xxe0': ('US', '1', 'AMI Annotation Frame Number (RET)', ''), # noqa
},
'AMI Sequence Annotations_02': {
@@ -1081,7 +1082,7 @@ private_dictionaries: Dict[str, Dict[str, Tuple[str, str, str, str]]] = {
'0009xx00': ('LO', '1', 'Unknown', ''), # noqa
'0009xx01': ('LO', '1', 'Unknown', ''), # noqa
},
- 'Eclispe 60': {
+ 'Eclipse 60': {
'0029xx30': ('UL', '1', 'Private data', ''), # noqa
'0029xx31': ('UL', '1', 'Private data', ''), # noqa
'0029xx32': ('UL', '1', 'Private data', ''), # noqa
@@ -1941,7 +1942,7 @@ private_dictionaries: Dict[str, Dict[str, Tuple[str, str, str, str]]] = {
'0019xxdd': ('DS', '1-n', 'DRM Strength', ''), # noqa
'0019xxde': ('CS', '1', 'Acquisition Plane', ''), # noqa
'0019xxdf': ('FL', '1-n', 'LP off longitudinal position Z', ''), # noqa
- '0019xxe0': ('FL', '1', 'DAP of currect record', ''), # noqa
+ '0019xxe0': ('FL', '1', 'DAP of current record', ''), # noqa
'0019xxe1': ('FL', '1', 'Pivot Lateral Angle', ''), # noqa
'0019xxe2': ('FL', '1', 'Carm Lateral Angle', ''), # noqa
'0019xxe3': ('FL', '1-n', 'Pivot Lateral Angle increment', ''), # noqa
@@ -2054,7 +2055,7 @@ private_dictionaries: Dict[str, Dict[str, Tuple[str, str, str, str]]] = {
'0015xx9d': ('IS', '1', 'Study record time lateral', ''), # noqa
},
'GEMS_DRS_1': {
- '0037xx10': ('LO', '1', 'Refering Department', ''), # noqa
+ '0037xx10': ('LO', '1', 'Referring Department', ''), # noqa
'0037xx20': ('US', '1', 'Screen Number', ''), # noqa
'0037xx40': ('SH', '1', 'Left Orientation', ''), # noqa
'0037xx42': ('SH', '1', 'Right Orientation', ''), # noqa
@@ -2425,7 +2426,7 @@ private_dictionaries: Dict[str, Dict[str, Tuple[str, str, str, str]]] = {
'0045xx02': ('FL', '1', 'Macro width at ISO Center', ''), # noqa
'0045xx03': ('SS', '1', 'DAS type', ''), # noqa
'0045xx04': ('SS', '1', 'DAS gain', ''), # noqa
- '0045xx05': ('SS', '1', 'DAS Temprature', ''), # noqa
+ '0045xx05': ('SS', '1', 'DAS Temperature', ''), # noqa
'0045xx06': ('CS', '1', 'Table Direction', ''), # noqa
'0045xx07': ('FL', '1', 'Z smoothing Factor', ''), # noqa
'0045xx08': ('SS', '1', 'View Weighting Mode', ''), # noqa
@@ -3495,7 +3496,7 @@ private_dictionaries: Dict[str, Dict[str, Tuple[str, str, str, str]]] = {
'0057xx02': ('UI', '1', 'SOPClassUID', ''), # noqa
'0057xx03': ('UI', '1', 'SOPInstanceUID', ''), # noqa
'0057xx10': ('IS', '1', 'ROINumber', ''), # noqa
- '0057xx11': ('UI', '1', 'Dimentions', ''), # noqa
+ '0057xx11': ('UI', '1', 'Dimensions', ''), # noqa
'0057xx12': ('UI', '1', 'Points', ''), # noqa
'0057xx13': ('UI', '1', 'Type', ''), # noqa
'0057xx14': ('UI', '1', 'Description', ''), # noqa
@@ -5001,7 +5002,7 @@ private_dictionaries: Dict[str, Dict[str, Tuple[str, str, str, str]]] = {
'2001xx3a': ('CS', '1', 'Pixel Shift', ''), # noqa
'2001xx3d': ('UL', '1', 'Unknown', ''), # noqa
'2001xx3f': ('CS', '1', 'Interpolation Method', ''), # noqa
- '2001xx42': ('CS', '1', 'Substraction Land Marking Active', ''), # noqa
+ '2001xx42': ('CS', '1', 'Subtraction Land Marking Active', ''), # noqa
'2001xx46': ('CS', '1', 'Graphic Line Style', ''), # noqa
'2001xx47': ('FL', '1', 'Graphic Line Width', ''), # noqa
'2001xx48': ('SS', '1', 'Graphic Annotation ID', ''), # noqa
@@ -5062,10 +5063,10 @@ private_dictionaries: Dict[str, Dict[str, Tuple[str, str, str, str]]] = {
'2001xx9a': ('SQ', '1', 'Graphic Number Sequence', ''), # noqa
'2001xx9b': ('UL', '1', 'Graphic Number', ''), # noqa
'2001xx9c': ('LO', '1', 'Unknown', ''), # noqa
- '2001xx9d': ('LO', '1', 'PIIM Substraction Type', ''), # noqa
+ '2001xx9d': ('LO', '1', 'PIIM Subtraction Type', ''), # noqa
'2001xx9f': ('US', '2', 'Pixel Processing Kernel Size', ''), # noqa
'2001xxa1': ('CS', '1', 'Is Raw Image', ''), # noqa
- '2001xxa2': ('US', '1', 'LOG Substraction Curve Taste', ''), # noqa
+ '2001xxa2': ('US', '1', 'LOG Subtraction Curve Taste', ''), # noqa
'2001xxa3': ('UL', '1', 'Text Color Foreground', ''), # noqa
'2001xxa4': ('UL', '1', 'Text Color Background', ''), # noqa
'2001xxa5': ('UL', '1', 'Text Color Shadow', ''), # noqa
@@ -6255,7 +6256,7 @@ private_dictionaries: Dict[str, Dict[str, Tuple[str, str, str, str]]] = {
'0019xx42': ('US', '1-n', 'Processing Mask', ''), # noqa
'0019xx44': ('UL', '1-n', 'IRS Data Number', ''), # noqa
'0019xx45': ('UL', '1-n', 'IRS Data Length', ''), # noqa
- '0019xx62': ('IS', '1', 'Number of Virtuell Channels', ''), # noqa
+ '0019xx62': ('IS', '1', 'Number of Virtual Channels', ''), # noqa
'0019xx70': ('IS', '1', 'Number of Reading', ''), # noqa
'0019xx71': ('CS', '1', 'Reading Code', ''), # noqa
'0019xx74': ('IS', '1', 'Number of Projections', ''), # noqa
@@ -6384,9 +6385,9 @@ private_dictionaries: Dict[str, Dict[str, Tuple[str, str, str, str]]] = {
'0017xx71': ('LO', '1', 'Landmark Current', ''), # noqa
'0017xx72': ('US', '1', 'Zoom Factor', ''), # noqa
'0017xx73': ('US', '1', 'Roam Horizontal', ''), # noqa
- '0017xx74': ('US', '1', 'Roam Vertikal', ''), # noqa
+ '0017xx74': ('US', '1', 'Roam Vertical', ''), # noqa
'0017xx77': ('IS', '1', 'Pixel Shift Horizontal', ''), # noqa
- '0017xx78': ('IS', '1', 'Pixel Shift Vertikal', ''), # noqa
+ '0017xx78': ('IS', '1', 'Pixel Shift Vertical', ''), # noqa
'0017xx79': ('US', '1', 'Image Flip', ''), # noqa
'0017xx7a': ('US', '1', 'Invers Current', ''), # noqa
'0017xx80': ('US', '1', 'Unknown', ''), # noqa
@@ -7120,8 +7121,8 @@ private_dictionaries: Dict[str, Dict[str, Tuple[str, str, str, str]]] = {
'0031xx17': ('SS', '1-n', 'Unknown', ''), # noqa
'0031xx20': ('ST', '1', 'Unknown', ''), # noqa
'0031xx21': ('SS', '1', 'Unknown', ''), # noqa
- '0033xx00': ('FL', '1-n', 'Flood correction Matrix Det 1 upto SR 2.0', ''), # noqa
- '0033xx01': ('FL', '1-n', 'Flood correction Matrix Det 2 upto SR 2.0', ''), # noqa
+ '0033xx00': ('FL', '1-n', 'Flood correction Matrix Det 1 up to SR 2.0', ''), # noqa
+ '0033xx01': ('FL', '1-n', 'Flood correction Matrix Det 2 up to SR 2.0', ''), # noqa
'0033xx10': ('FL', '1-n', 'COR Data for Detector 1', ''), # noqa
'0033xx11': ('FL', '1-n', 'COR Data for Detector 2', ''), # noqa
'0033xx14': ('FL', '1', 'MHR ( Y-Shift) data for detector 1', ''), # noqa
@@ -8476,7 +8477,7 @@ private_dictionaries: Dict[str, Dict[str, Tuple[str, str, str, str]]] = {
'0019xx50': ('US', '1', 'Video Scan Mode', ''), # noqa
'0019xx51': ('US', '1', 'Video LineRate', ''), # noqa
'0019xx60': ('US', '1', 'Xray Technique', ''), # noqa
- '0019xx61': ('DS', '1', 'Image Identifier Fromat', ''), # noqa
+ '0019xx61': ('DS', '1', 'Image Identifier Format', ''), # noqa
'0019xx62': ('US', '1', 'Iris Diaphragm', ''), # noqa
'0019xx63': ('CS', '1', 'Filter', ''), # noqa
'0019xx64': ('CS', '1', 'Cine Parallel', ''), # noqa
@@ -9063,7 +9064,7 @@ private_dictionaries: Dict[str, Dict[str, Tuple[str, str, str, str]]] = {
'0029xx01': ('IS', '1', 'Storage State', ''), # noqa
'0029xx02': ('IS', '1', 'Referenced Image SOP Class', ''), # noqa
'0029xx03': ('LO', '1', 'Ref. Image Instance UID', ''), # noqa
- '0029xx04': ('IS', '1', 'Rel. Pres. State Number', ''), # noqa
+ '0029xx04': ('IS', '1', 'Rel. Presentation State Number', ''), # noqa
'0029xx05': ('LO', '1', 'Rel. Presentation State UID', ''), # noqa
},
'Siemens Ultrasound Miscellaneous': {
=====================================
pydicom/_uid_dict.py
=====================================
@@ -4,6 +4,7 @@ UID_dictionary = {
'1.2.840.10008.1.1': ('Verification SOP Class', 'SOP Class', '', '', 'Verification'), # noqa
'1.2.840.10008.1.2': ('Implicit VR Little Endian', 'Transfer Syntax', 'Default Transfer Syntax for DICOM', '', 'ImplicitVRLittleEndian'), # noqa
'1.2.840.10008.1.2.1': ('Explicit VR Little Endian', 'Transfer Syntax', '', '', 'ExplicitVRLittleEndian'), # noqa
+ '1.2.840.10008.1.2.1.98': ('Encapsulated Uncompressed Explicit VR Little Endian', 'Transfer Syntax', '', '', 'EncapsulatedUncompressedExplicitVRLittleEndian'), # noqa
'1.2.840.10008.1.2.1.99': ('Deflated Explicit VR Little Endian', 'Transfer Syntax', '', '', 'DeflatedExplicitVRLittleEndian'), # noqa
'1.2.840.10008.1.2.2': ('Explicit VR Big Endian', 'Transfer Syntax', '', 'Retired', 'ExplicitVRBigEndian'), # noqa
'1.2.840.10008.1.2.4.50': ('JPEG Baseline (Process 1)', 'Transfer Syntax', 'Default Transfer Syntax for Lossy JPEG 8 Bit Image Compression', '', 'JPEGBaseline8Bit'), # noqa
@@ -48,33 +49,6 @@ UID_dictionary = {
'1.2.840.10008.1.2.7.2': ('SMPTE ST 2110-20 Uncompressed Interlaced Active Video', 'Transfer Syntax', '', '', 'SMPTEST211020UncompressedInterlacedActiveVideo'), # noqa
'1.2.840.10008.1.2.7.3': ('SMPTE ST 2110-30 PCM Digital Audio', 'Transfer Syntax', '', '', 'SMPTEST211030PCMDigitalAudio'), # noqa
'1.2.840.10008.1.3.10': ('Media Storage Directory Storage', 'SOP Class', '', '', 'MediaStorageDirectoryStorage'), # noqa
- '1.2.840.10008.1.4.1.1': ('Talairach Brain Atlas Frame of Reference', 'Well-known frame of reference', '', '', 'TalairachBrainAtlas'), # noqa
- '1.2.840.10008.1.4.1.2': ('SPM2 T1 Frame of Reference', 'Well-known frame of reference', '', '', 'SPM2T1'), # noqa
- '1.2.840.10008.1.4.1.3': ('SPM2 T2 Frame of Reference', 'Well-known frame of reference', '', '', 'SPM2T2'), # noqa
- '1.2.840.10008.1.4.1.4': ('SPM2 PD Frame of Reference', 'Well-known frame of reference', '', '', 'SPM2PD'), # noqa
- '1.2.840.10008.1.4.1.5': ('SPM2 EPI Frame of Reference', 'Well-known frame of reference', '', '', 'SPM2EPI'), # noqa
- '1.2.840.10008.1.4.1.6': ('SPM2 FIL T1 Frame of Reference', 'Well-known frame of reference', '', '', 'SPM2FILT1'), # noqa
- '1.2.840.10008.1.4.1.7': ('SPM2 PET Frame of Reference', 'Well-known frame of reference', '', '', 'SPM2PET'), # noqa
- '1.2.840.10008.1.4.1.8': ('SPM2 TRANSM Frame of Reference', 'Well-known frame of reference', '', '', 'SPM2TRANSM'), # noqa
- '1.2.840.10008.1.4.1.9': ('SPM2 SPECT Frame of Reference', 'Well-known frame of reference', '', '', 'SPM2SPECT'), # noqa
- '1.2.840.10008.1.4.1.10': ('SPM2 GRAY Frame of Reference', 'Well-known frame of reference', '', '', 'SPM2GRAY'), # noqa
- '1.2.840.10008.1.4.1.11': ('SPM2 WHITE Frame of Reference', 'Well-known frame of reference', '', '', 'SPM2WHITE'), # noqa
- '1.2.840.10008.1.4.1.12': ('SPM2 CSF Frame of Reference', 'Well-known frame of reference', '', '', 'SPM2CSF'), # noqa
- '1.2.840.10008.1.4.1.13': ('SPM2 BRAINMASK Frame of Reference', 'Well-known frame of reference', '', '', 'SPM2BRAINMASK'), # noqa
- '1.2.840.10008.1.4.1.14': ('SPM2 AVG305T1 Frame of Reference', 'Well-known frame of reference', '', '', 'SPM2AVG305T1'), # noqa
- '1.2.840.10008.1.4.1.15': ('SPM2 AVG152T1 Frame of Reference', 'Well-known frame of reference', '', '', 'SPM2AVG152T1'), # noqa
- '1.2.840.10008.1.4.1.16': ('SPM2 AVG152T2 Frame of Reference', 'Well-known frame of reference', '', '', 'SPM2AVG152T2'), # noqa
- '1.2.840.10008.1.4.1.17': ('SPM2 AVG152PD Frame of Reference', 'Well-known frame of reference', '', '', 'SPM2AVG152PD'), # noqa
- '1.2.840.10008.1.4.1.18': ('SPM2 SINGLESUBJT1 Frame of Reference', 'Well-known frame of reference', '', '', 'SPM2SINGLESUBJT1'), # noqa
- '1.2.840.10008.1.4.2.1': ('ICBM 452 T1 Frame of Reference', 'Well-known frame of reference', '', '', 'ICBM452T1'), # noqa
- '1.2.840.10008.1.4.2.2': ('ICBM Single Subject MRI Frame of Reference', 'Well-known frame of reference', '', '', 'ICBMSingleSubjectMRI'), # noqa
- '1.2.840.10008.1.4.3.1': ('IEC 61217 Fixed Coordinate System Frame of Reference', 'Well-known frame of reference', '', '', 'IEC61217FixedCoordinateSystem'), # noqa
- '1.2.840.10008.1.4.3.2': ('Standard Robotic-Arm Coordinate System Frame of Reference', 'Well-known frame of reference', '', '', 'StandardRoboticArmCoordinateSystem'), # noqa
- '1.2.840.10008.1.4.4.1': ('SRI24 Frame of Reference', 'Well-known frame of reference', '', '', 'SRI24'), # noqa
- '1.2.840.10008.1.4.5.1': ('Colin27 Frame of Reference', 'Well-known frame of reference', '', '', 'Colin27'), # noqa
- '1.2.840.10008.1.4.6.1': ('LPBA40/AIR Frame of Reference', 'Well-known frame of reference', '', '', 'LPBA40AIR'), # noqa
- '1.2.840.10008.1.4.6.2': ('LPBA40/FLIRT Frame of Reference', 'Well-known frame of reference', '', '', 'LPBA40FLIRT'), # noqa
- '1.2.840.10008.1.4.6.3': ('LPBA40/SPM5 Frame of Reference', 'Well-known frame of reference', '', '', 'LPBA40SPM5'), # noqa
'1.2.840.10008.1.5.1': ('Hot Iron Color Palette SOP Instance', 'Well-known SOP Instance', '', '', 'HotIronPalette'), # noqa
'1.2.840.10008.1.5.2': ('PET Color Palette SOP Instance', 'Well-known SOP Instance', '', '', 'PETPalette'), # noqa
'1.2.840.10008.1.5.3': ('Hot Metal Blue Color Palette SOP Instance', 'Well-known SOP Instance', '', '', 'HotMetalBluePalette'), # noqa
@@ -288,6 +262,7 @@ UID_dictionary = {
'1.2.840.10008.5.1.4.1.1.88.75': ('Performed Imaging Agent Administration SR Storage', 'SOP Class', '', '', 'PerformedImagingAgentAdministrationSRStorage'), # noqa
'1.2.840.10008.5.1.4.1.1.88.76': ('Enhanced X-Ray Radiation Dose SR Storage', 'SOP Class', '', '', 'EnhancedXRayRadiationDoseSRStorage'), # noqa
'1.2.840.10008.5.1.4.1.1.90.1': ('Content Assessment Results Storage', 'SOP Class', '', '', 'ContentAssessmentResultsStorage'), # noqa
+ '1.2.840.10008.5.1.4.1.1.91.1': ('Microscopy Bulk Simple Annotations Storage', 'SOP Class', '', '', 'MicroscopyBulkSimpleAnnotationsStorage'), # noqa
'1.2.840.10008.5.1.4.1.1.104.1': ('Encapsulated PDF Storage', 'SOP Class', '', '', 'EncapsulatedPDFStorage'), # noqa
'1.2.840.10008.5.1.4.1.1.104.2': ('Encapsulated CDA Storage', 'SOP Class', '', '', 'EncapsulatedCDAStorage'), # noqa
'1.2.840.10008.5.1.4.1.1.104.3': ('Encapsulated STL Storage', 'SOP Class', '', '', 'EncapsulatedSTLStorage'), # noqa
@@ -326,6 +301,8 @@ UID_dictionary = {
'1.2.840.10008.5.1.4.1.1.481.18': ('Tomotherapeutic Radiation Record Storage', 'SOP Class', '', '', 'TomotherapeuticRadiationRecordStorage'), # noqa
'1.2.840.10008.5.1.4.1.1.481.19': ('C-Arm Photon-Electron Radiation Record Storage', 'SOP Class', '', '', 'CArmPhotonElectronRadiationRecordStorage'), # noqa
'1.2.840.10008.5.1.4.1.1.481.20': ('Robotic Radiation Record Storage', 'SOP Class', '', '', 'RoboticRadiationRecordStorage'), # noqa
+ '1.2.840.10008.5.1.4.1.1.481.21': ('RT Radiation Set Delivery Instruction Storage', 'SOP Class', '', '', 'RTRadiationSetDeliveryInstructionStorage'), # noqa
+ '1.2.840.10008.5.1.4.1.1.481.22': ('RT Treatment Preparation Storage', 'SOP Class', '', '', 'RTTreatmentPreparationStorage'), # noqa
'1.2.840.10008.5.1.4.1.1.501.1': ('DICOS CT Image Storage', 'SOP Class', 'DICOS', '', 'DICOSCTImageStorage'), # noqa
'1.2.840.10008.5.1.4.1.1.501.2.1': ('DICOS Digital X-Ray Image Storage - For Presentation', 'SOP Class', 'DICOS', '', 'DICOSDigitalXRayImageStorageForPresentation'), # noqa
'1.2.840.10008.5.1.4.1.1.501.2.2': ('DICOS Digital X-Ray Image Storage - For Processing', 'SOP Class', 'DICOS', '', 'DICOSDigitalXRayImageStorageForProcessing'), # noqa
@@ -447,5 +424,32 @@ UID_dictionary = {
'1.2.840.10008.15.0.4.6': ('dicomNetworkConnection', 'LDAP OID', '', '', 'dicomNetworkConnection'), # noqa
'1.2.840.10008.15.0.4.7': ('dicomUniqueAETitle', 'LDAP OID', '', '', 'dicomUniqueAETitle'), # noqa
'1.2.840.10008.15.0.4.8': ('dicomTransferCapability', 'LDAP OID', '', '', 'dicomTransferCapability'), # noqa
- '1.2.840.10008.15.1.1': ('Universal Coordinated Time', 'Synchronization Frame of Reference', '', '', 'UTC') # noqa
+ '1.2.840.10008.15.1.1': ('Universal Coordinated Time', 'Synchronization Frame of Reference', '', '', 'UTC'), # noqa
+ '1.2.840.10008.1.4.1.1': ('Talairach Brain Atlas Frame of Reference', 'Well-known frame of reference', '', '', 'TalairachBrainAtlas'), # noqa
+ '1.2.840.10008.1.4.1.2': ('SPM2 T1 Frame of Reference', 'Well-known frame of reference', '', '', 'SPM2T1'), # noqa
+ '1.2.840.10008.1.4.1.3': ('SPM2 T2 Frame of Reference', 'Well-known frame of reference', '', '', 'SPM2T2'), # noqa
+ '1.2.840.10008.1.4.1.4': ('SPM2 PD Frame of Reference', 'Well-known frame of reference', '', '', 'SPM2PD'), # noqa
+ '1.2.840.10008.1.4.1.5': ('SPM2 EPI Frame of Reference', 'Well-known frame of reference', '', '', 'SPM2EPI'), # noqa
+ '1.2.840.10008.1.4.1.6': ('SPM2 FIL T1 Frame of Reference', 'Well-known frame of reference', '', '', 'SPM2FILT1'), # noqa
+ '1.2.840.10008.1.4.1.7': ('SPM2 PET Frame of Reference', 'Well-known frame of reference', '', '', 'SPM2PET'), # noqa
+ '1.2.840.10008.1.4.1.8': ('SPM2 TRANSM Frame of Reference', 'Well-known frame of reference', '', '', 'SPM2TRANSM'), # noqa
+ '1.2.840.10008.1.4.1.9': ('SPM2 SPECT Frame of Reference', 'Well-known frame of reference', '', '', 'SPM2SPECT'), # noqa
+ '1.2.840.10008.1.4.1.10': ('SPM2 GRAY Frame of Reference', 'Well-known frame of reference', '', '', 'SPM2GRAY'), # noqa
+ '1.2.840.10008.1.4.1.11': ('SPM2 WHITE Frame of Reference', 'Well-known frame of reference', '', '', 'SPM2WHITE'), # noqa
+ '1.2.840.10008.1.4.1.12': ('SPM2 CSF Frame of Reference', 'Well-known frame of reference', '', '', 'SPM2CSF'), # noqa
+ '1.2.840.10008.1.4.1.13': ('SPM2 BRAINMASK Frame of Reference', 'Well-known frame of reference', '', '', 'SPM2BRAINMASK'), # noqa
+ '1.2.840.10008.1.4.1.14': ('SPM2 AVG305T1 Frame of Reference', 'Well-known frame of reference', '', '', 'SPM2AVG305T1'), # noqa
+ '1.2.840.10008.1.4.1.15': ('SPM2 AVG152T1 Frame of Reference', 'Well-known frame of reference', '', '', 'SPM2AVG152T1'), # noqa
+ '1.2.840.10008.1.4.1.16': ('SPM2 AVG152T2 Frame of Reference', 'Well-known frame of reference', '', '', 'SPM2AVG152T2'), # noqa
+ '1.2.840.10008.1.4.1.17': ('SPM2 AVG152PD Frame of Reference', 'Well-known frame of reference', '', '', 'SPM2AVG152PD'), # noqa
+ '1.2.840.10008.1.4.1.18': ('SPM2 SINGLESUBJT1 Frame of Reference', 'Well-known frame of reference', '', '', 'SPM2SINGLESUBJT1'), # noqa
+ '1.2.840.10008.1.4.2.1': ('ICBM 452 T1 Frame of Reference', 'Well-known frame of reference', '', '', 'ICBM452T1'), # noqa
+ '1.2.840.10008.1.4.2.2': ('ICBM Single Subject MRI Frame of Reference', 'Well-known frame of reference', '', '', 'ICBMSingleSubjectMRI'), # noqa
+ '1.2.840.10008.1.4.3.1': ('IEC 61217 Fixed Coordinate System Frame of Reference', 'Well-known frame of reference', '', '', 'IEC61217FixedCoordinateSystem'), # noqa
+ '1.2.840.10008.1.4.3.2': ('Standard Robotic-Arm Coordinate System Frame of Reference', 'Well-known frame of reference', '', '', 'StandardRoboticArmCoordinateSystem'), # noqa
+ '1.2.840.10008.1.4.4.1': ('SRI24 Frame of Reference', 'Well-known frame of reference', '', '', 'SRI24'), # noqa
+ '1.2.840.10008.1.4.5.1': ('Colin27 Frame of Reference', 'Well-known frame of reference', '', '', 'Colin27'), # noqa
+ '1.2.840.10008.1.4.6.1': ('LPBA40/AIR Frame of Reference', 'Well-known frame of reference', '', '', 'LPBA40AIR'), # noqa
+ '1.2.840.10008.1.4.6.2': ('LPBA40/FLIRT Frame of Reference', 'Well-known frame of reference', '', '', 'LPBA40FLIRT'), # noqa
+ '1.2.840.10008.1.4.6.3': ('LPBA40/SPM5 Frame of Reference', 'Well-known frame of reference', '', '', 'LPBA40SPM5'), # noqa
}
=====================================
pydicom/_version.py
=====================================
@@ -3,7 +3,7 @@ import re
from typing import cast, Match
-__version__: str = '2.2.1'
+__version__: str = '2.2.2'
result = cast(Match[str], re.match(r'(\d+\.\d+\.\d+).*', __version__))
__version_info__ = tuple(result.group(1).split('.'))
@@ -11,4 +11,4 @@ __version_info__ = tuple(result.group(1).split('.'))
# DICOM Standard version used for:
# _dicom_dict, _uid_dict and _storage_sopclass_uids
-__dicom_version__: str = '2021b'
+__dicom_version__: str = '2021d'
=====================================
pydicom/dataset.py
=====================================
@@ -26,7 +26,7 @@ import os.path
import re
from types import TracebackType
from typing import (
- TYPE_CHECKING, Optional, Tuple, Union, List, Any, cast, Dict, ValuesView,
+ Optional, Tuple, Union, List, Any, cast, Dict, ValuesView,
Iterator, BinaryIO, AnyStr, Callable, TypeVar, Type, overload,
MutableSequence, MutableMapping, AbstractSet
)
@@ -2904,5 +2904,5 @@ _RE_CAMEL_CASE = re.compile(
# Ensure mix of upper and lowercase and digits, no underscores
# If first character is lowercase ensure at least one uppercase char
"(?P<start>(^[A-Za-z])((?=.+?[A-Z])[A-Za-z0-9]+)|(^[A-Z])([A-Za-z0-9]+))"
- "(?P<last>[A-za-z0-9][^_]$)" # Last character is alphanumeric
+ "(?P<last>[A-Za-z0-9][^_]$)" # Last character is alphanumeric
)
=====================================
pydicom/pixel_data_handlers/pillow_handler.py
=====================================
@@ -84,7 +84,7 @@ def should_change_PhotometricInterpretation_to_RGB(ds: "Dataset") -> bool:
This affects JPEG transfer syntaxes.
"""
- should_change = ds.SamplesPerPixel == 3
+ # return ds.SamplesPerPixel == 3
return False
=====================================
setup.cfg
=====================================
@@ -3,3 +3,7 @@ test=pytest
[bdist_wheel]
universal=0
+
+[codespell]
+skip = _private_dict.py,_concepts_dict.py,test1.json
+ignore-words = .github/codespell_ignore_words.txt
=====================================
source/generate_cids/generate_concept_dicts.py
=====================================
@@ -269,68 +269,6 @@ def write_snomed_mapping(snomed_codes):
f_concepts.write("}")
-def write_concepts(concepts, cid_concepts, cid_lists, name_for_cid):
- from pprint import pprint
- lines = ['# Auto-generated by {}.\n'.format(os.path.basename(__file__)),
- '# -*- coding: utf-8 -*-\n',
- '\n',
- '# Dict with scheme designator keys; value format is:\n',
- '# {keyword: {code1: (meaning, cid_list}, code2:...}\n',
- '#\n',
- '# Most keyword identifiers map to a single code, but not all\n',
- '\n',
- ]
-
- with open("_concepts_dict.py", 'w', encoding="UTF8") as f_concepts:
- f_concepts.writelines(lines)
- f_concepts.write("concepts = {}\n") # start with empty dict
- for scheme, value in concepts.items():
- f_concepts.write("\nconcepts['{}'] = \\\n".format(scheme))
- pprint(value, f_concepts)
-
- lines = (DOC_LINES +
- ['# Dict with cid number as keys; value format is:\n',
- '# {scheme designator: <list of keywords for current cid>\n',
- '# scheme_designator: ...}\n',
- '\n',
- ]
- )
-
- with open("_cid_dict.py", 'w', encoding="UTF8") as f_cid:
- f_cid.writelines(lines)
- f_cid.write("name_for_cid = {}\n")
- f_cid.write("cid_concepts = {}\n")
- for cid, value in cid_lists.items():
- f_cid.write("\nname_for_cid[{}] = '{}'\n".format(
- cid, name_for_cid[cid]))
- f_cid.write("cid_concepts[{}] = \\\n".format(cid))
- pprint(value, f_cid)
-
-
-def write_snomed_mapping(snomed_codes):
- with open("_snomed_dict.py", 'w', encoding="UTF8") as f_concepts:
- lines = (DOC_LINES +
- ['# Dict with scheme designator keys; value format is:\n',
- '# {concept_id1: snomed_id1, concept_id2: ...}\n',
- '# or\n',
- '# {snomed_id1: concept_id1, snomed_id2: ...}\n',
- '\n',
- ]
- )
-
- f_concepts.writelines(lines)
- f_concepts.write("mapping = {}\n") # start with empty dict
- f_concepts.write("\nmapping['{}'] = {{\n".format('SCT'))
- for sct, srt, meaning in snomed_codes:
- f_concepts.write(" '{}': '{}',\n".format(sct, srt))
- f_concepts.write("}\n")
-
- f_concepts.write("\nmapping['{}'] = {{\n".format('SRT'))
- for sct, srt, meaning in snomed_codes:
- f_concepts.write(" '{}': '{}',\n".format(srt, sct))
- f_concepts.write("}")
-
-
if __name__ == '__main__':
logging.basicConfig(level=logging.INFO)
=====================================
source/generate_dict/generate_dicom_dict.py
=====================================
@@ -55,10 +55,13 @@ from pydicom import _version
from pydicom.values import converters
-_DIRECTORY = os.path.dirname(__file__)
-PYDICOM_DICT_FILENAME = os.path.join(
- _DIRECTORY, '../../pydicom/_dicom_dict.py'
+_PKG_DIRECTORY = os.path.join(
+ os.path.dirname(__file__),
+ '..',
+ '..',
+ 'pydicom'
)
+PYDICOM_DICT_FILENAME = os.path.join(_PKG_DIRECTORY, '_dicom_dict.py')
MAIN_DICT_NAME = 'DicomDictionary: Dict[int, Tuple[str, str, str, str, str]]'
MASK_DICT_NAME = (
'RepeatersDictionary: Dict[str, Tuple[str, str, str, str, str]]'
=====================================
source/generate_dict/generate_private_dict.py
=====================================
@@ -16,7 +16,13 @@ GDCM_PRIVATE_DICT = "%s/privatedicts.xml" % (GDCM_PRIVATE_DICT)
PYDICOM_DICT_NAME = (
'private_dictionaries: Dict[str, Dict[str, Tuple[str, str, str, str]]]'
)
-PYDICOM_DICT_FILENAME = '_private_dict.py'
+_PKG_DIRECTORY = os.path.join(
+ os.path.dirname(__file__),
+ '..',
+ '..',
+ 'pydicom'
+)
+PYDICOM_DICT_FILENAME = os.path.join(_PKG_DIRECTORY, '_private_dict.py')
PYDICOM_DICT_DOCSTRING = """DICOM private dictionary auto-generated by generate_private_dict.py.
Data generated from GDCM project\'s private dictionary.
@@ -36,10 +42,10 @@ def parse_private_docbook(doc_root):
tag = entry.attrib['group'] + entry.attrib['element']
- # Covert unknown element names to 'Unknown'
+ # Convert unknown element names to 'Unknown'
if entry.attrib['name'] == '?':
entry.attrib['name'] = 'Unknown'
- # If backslash in element name escape it
+ # Escape backslash in element names
if "\\" in entry.attrib['name']:
entry.attrib['name'] = entry.attrib['name'].replace("\\", "\\\\")
@@ -95,19 +101,13 @@ def write_dict(fp, dict_name, dict_entries):
if __name__ == "__main__":
- current_dir = os.path.dirname(os.path.realpath(__file__))
- project_dir = os.path.abspath(os.path.join(current_dir,
- "..",
- "..",
- "pydicom"))
- output_file = os.path.join(project_dir, PYDICOM_DICT_FILENAME)
response = urllib2.urlopen(GDCM_PRIVATE_DICT)
tree = ET.parse(response)
root = tree.getroot()
entries = parse_private_docbook(root)
- py_file = open(output_file, "w")
+ py_file = open(PYDICOM_DICT_FILENAME, "w")
py_file.write('"""' + PYDICOM_DICT_DOCSTRING + '"""')
py_file.write('\n')
py_file.write("from typing import Dict, Tuple\n\n")
=====================================
source/generate_dict/generate_uid_dict.py
=====================================
@@ -27,7 +27,13 @@ import xml.etree.ElementTree as ET
from pydicom import _version
-PYDICOM_DICT_FILENAME = '../../pydicom/_uid_dict.py'
+_PKG_DIRECTORY = os.path.join(
+ os.path.dirname(__file__),
+ '..',
+ '..',
+ 'pydicom'
+)
+PYDICOM_DICT_FILENAME = os.path.join(_PKG_DIRECTORY, '_uid_dict.py')
DICT_NAME = 'UID_dictionary'
=====================================
source/generate_uids/generate_storage_sopclass_uids.py
=====================================
View it on GitLab: https://salsa.debian.org/med-team/pydicom/-/commit/83d1cf1b0257adb678ee26fd43b5a260fa807f5d
--
View it on GitLab: https://salsa.debian.org/med-team/pydicom/-/commit/83d1cf1b0257adb678ee26fd43b5a260fa807f5d
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20211207/f489641b/attachment-0001.htm>
More information about the debian-med-commit
mailing list