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

ENH: remove repetitive monochorme1 warning #4922

Conversation

blowekamp
Copy link
Member

I have seen this warning message 100s of thousands of time while working with large chest X-ray data sets.

These is not problem to "warn" about the image loads as expected.

PR Checklist

  • No API changes were made (or the changes have been approved)
  • No major design changes were made (or the changes have been approved)
  • Added test (or behavior not changed)
  • Updated API documentation (or API not changed)
  • Added license to new files (if any)
  • Added Python wrapping to new files (if any) as described in ITK Software Guide Section 9.5
  • Added ITK examples for all new major features (if any)

Refer to the ITK Software Guide for
further development details if necessary.

@github-actions github-actions bot added type:Enhancement Improvement of existing methods or implementation area:IO Issues affecting the IO module labels Oct 31, 2024
Comment on lines -360 to -361
itkWarningMacro("Converting from MONOCHROME1 to MONOCHROME2 may impact the meaning of DICOM attributes related "
"to pixel values.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do I understand correctly that GDCMImageIO threats MONOCHROME1 just like MONOCHROME2, and produces a bright (inverted) image when the original image was dark?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure you clearly articulated that.

Generally, images can be store ( disk or memory) in a different way that is different than their photometric meaning. For example an image can be stored as an index into a pallet, where the pallet contains the RGB photometric meaning.

The photometric meaning of a MONOCHROME1 is that "min is black", which is opposite of ITK's conventional Gray scale.

ITK's meta data does not contain definitions for photometric meaning e.g RGB color space, XYZ color space, min-is-black or min-is-white. In lieu of this ITK has conventions, and the ImageIO's generally convert from the representation to these common conventions.

This conversion is little different than applying the slope intercept to get a float from the integer values in the DICOM file.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm OK with removing the itkWarningMacro call, just wondering if the read "PhotometricInterpretation" tag is still of interest to anyone.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tag is still in the metadata dictionary, it has just been applied similarly to the slope intercept.

@blowekamp blowekamp marked this pull request as ready for review October 31, 2024 17:56
Copy link
Contributor

@N-Dekker N-Dekker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@N-Dekker N-Dekker merged commit d29cca5 into InsightSoftwareConsortium:master Nov 1, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:IO Issues affecting the IO module type:Enhancement Improvement of existing methods or implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants