Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False errors when validating RT Dose IOD #6

Closed
feher-melos opened this issue Nov 19, 2021 · 2 comments · Fixed by #7
Closed

False errors when validating RT Dose IOD #6

feher-melos opened this issue Nov 19, 2021 · 2 comments · Fixed by #7
Labels

Comments

@feher-melos
Copy link
Contributor

The validate_iods.py tool prints false errors about attributes that depend on the presence of Pixel Data:

Errors
======
Module "RT Dose":
Tag (0028,0002) (Samples per Pixel) is not allowed due to condition:
  Pixel Data exists
Tag (0028,0004) (Photometric Interpretation) is not allowed due to condition:
  Pixel Data exists
Tag (0028,0101) (Bits Stored) is not allowed due to condition:
  Pixel Data exists
Tag (0028,0102) (High Bit) is not allowed due to condition:
  Pixel Data exists

See:
https://dicom.innolitics.com/ciods/rt-dose/rt-dose/00280002

This is fixed by this diff:

diff --git a/dcm_spec_tools/validator/dicom_file_validator.py b/dcm_spec_tools/validator/dicom_file_validator.py
index 26be196..53b2897 100644
--- a/dcm_spec_tools/validator/dicom_file_validator.py
+++ b/dcm_spec_tools/validator/dicom_file_validator.py
@@ -40,7 +40,7 @@ class DicomFileValidator(object):
     def validate_file(self, file_path):
         self.logger.info('\nProcessing DICOM file "%s"', file_path)
         try:
-            data_set = filereader.read_file(file_path, stop_before_pixels=True)
+            data_set = filereader.read_file(file_path, stop_before_pixels=False)
         except InvalidDicomError:
             return {file_path: {'fatal': 'Invalid DICOM file'}}
         return {

Is there a reason why the Pixel Data is skipped when reading the DCM files?
Should it be an option for the validate_iods.py command line tool to read also the Pixel Data attribute?

@mrbean-bremen
Copy link
Member

Thanks! I wasn't aware anybody was using this at all :)
The reason that PixelData is skipped was performance, as far as I remember, but I obviously didn't see this problem at the time.

mrbean-bremen added a commit to mrbean-bremen/dicom-validator that referenced this issue Nov 20, 2021
- use defer size instead to avoid loading pixel data
- fixes pydicom#6
mrbean-bremen added a commit that referenced this issue Nov 20, 2021
- use defer size instead to avoid loading pixel data
- fixes #6
@mrbean-bremen
Copy link
Member

@feher-melos - I made a bugfix release with the change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants