-
Notifications
You must be signed in to change notification settings - Fork 184
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: Handle IPP/IOP/PixelSpacing for SC #158
Conversation
@@ -577,7 +577,7 @@ std::vector<double> ImageHelper::GetOriginValue(File const & f) | |||
|
|||
// else | |||
const Tag timagepositionpatient(0x0020, 0x0032); | |||
if( ms != MediaStorage::SecondaryCaptureImageStorage && ds.FindDataElement( timagepositionpatient ) ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where does that come from ? Image Plane Module is not part of Secondary Capture Image IOD Modules ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know, but if IPP/IOP are in SC there is not an error, but the warning that SC is extended, please look at David Clunie's post. Honestly, I am a little bit surprised too.
r@deb2:~$ dciodvfy 02725f56-c604-4007-8535-16be09b6615b.dcm
...
SCImage
...
Warning - Attribute is not present in standard DICOM IOD - (0x0020,0x0032) DS Image Position (Patient)
Warning - Attribute is not present in standard DICOM IOD - (0x0020,0x0037) DS Image Orientation (Patient)
...
Warning - Dicom dataset contains attributes not present in standard DICOM IOD - this is a Standard Extended SOP Class
{ | ||
if( ds.FindDataElement( Tag(0x0028,0x0030) ) ) | ||
{ | ||
// Type 1C in 'SC Image' (for calibrated images) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
full ref here, I cannot find it. Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Co-authored-by: Steve Pieper <[email protected]> This will add support for many existing data sets, specially recently released Visible Human Project collection.
Please let me know if the PR is not accepted or just close it. Maybe I will look for another workaround. |
Thanks for working on this @issakomi and thank you for the review @malaterre. I agree there are other options if changing GDCM's behavior is not preferred. |
@issakomi I am going to close this PR. Honestly you are trying to hide a data problem using a rather crude hack. I cannot possibly accept a patch which by default will read IOP/IPP for legacy SC. Instead I woud prefer to a see two PRs:
As stated before I am not a big fan of (2) above, DICOM is about interoperability format, so I fail to understand use case for (2). In any case thanks for the communication and patch. Closing |
@malaterre it would be preferable to reopen this PR and implement it, since the use of the 3D information has been standard for the multi-frame SC objects since CP 600, and I propose to retrofit the same behavior to the traditional single frame IOD as well as clarify the priority of PixelSpacing over NominalScannedPixelSpacing (which has been the case since CP 586). See the attached proposed CP: Our (IDC's) particular use case in the short term is the photographs of the 3D registered cryosections in the visible human collections, but this is a not uncommon pattern for derived 3D from other applications. |
So just use one the new multi-frame SC objects since they work out of the box without the need to change the DICOM standard... |
No, combining them into multi-frame makes them too large, and it wouldn't be appropriate to use a bunch of single frame instances of the multi-frame SOP Class. We are going to fix the standard, since lots of folks do this, so you can improve gdcm or not as you see fit, but if not we will have to fork it for ITK and Slicer since we need this functionality. |
Says who ? WSI have the same issue with multiple MF instances. There is absolutely nothing wrong with writing multi-frame SOP Class with a NumberOfFrames=1. Here is a 10 line python script to convert your extended SOP class (*) into proper mf instance, that will be valid with all of today implementations (DICOM 2023c).
This will not be backward compatible ! You'll need to update all of other people code to handle your specific change (osirix, weasis ...). The fact that "lots of folks" do this does not mean you should do it. You are resurecting a dead beast (legacy SC), for no good reason. You do not "need" this functionality. AFAIK you are simply trying to work around a bug in your (*)
Before:
After:
|
Philips has been using Modality LUT for legacy MR Instance for years, you did not "fix" the standard just because "lots of folks do this" ! |
For later reference, I cannot click on "re-open" button |
Here is the branch, there are two commits now, one for spacing and another for IPP/IOP.
Let me know if you wish a static variable like eg bool ImageHelper::ForceRescaleInterceptSlope for IPP/IOP. Not sure, but perhaps you meant something like this. There is no PR yet, but it is easy to open. |
@malaterre @issakomi @pieper @dclunie thank you for the tremendous effort taken towards this issue, code-wise, standard-wise, and community-wise. We all want:
These goals are extremely impactful. They are also difficult to achieve. And in reality we often have to compromise because "all the stars do not align". Mathieu, your points are valid. Still, the community wants additional improved DICOM spatial metadata support for derived data. And GDCM is an important part of the community.
@malaterre do you agree that a flag like this is not ideal? But it is a good path forward? If @issakomi puts more time into this and opens the PR, will you merge it? |
Make this feature opt-in per the discussion: malaterre#158
As suggested by @issakomi based on feedback from @malaterre , I added a commit that makes the IPP/IOP opt-in and re-opened here: #167 |
Make this feature opt-in per the discussion: malaterre#158
Add patches to GDCM for reading pixel spacing, image orientation patient, image position patient, from DICOM secondary capture datasets in: malaterre/GDCM#167 which are based on GDCM `release`. xref: - malaterre/GDCM#158 - InsightSoftwareConsortium#4109 - Slicer/Slicer#7089 - InsightSoftwareConsortium#4111
Make this feature opt-in per the discussion: malaterre#158
Make this feature opt-in per the discussion: #158
Create an extension for SecondaryCaptureImageStorage as if Image Plane Module would be optional. This will allow reading IPP/IOP/PixelSpacing for SecondaryCaptureImageStorage for some particular dataset. Make this feature opt-in per the discussion: * #158 This extension does not implement Basic Pixel Spacing Calibration Macro Attributes since the original target dataset to support is as follow: $ dcmdump 000198cd-cd88-4760-97d1-21bbea047fff.dcm | grep Spacin (0018,0088) DS [1] # 2, 1 SpacingBetweenSlices (0028,0030) DS [.33\.33] # 8, 2 PixelSpacing > If Pixel Spacing Calibration Type (0028,0A02) and Imager Pixel Spacing > (0018,1164) and Nominal Scanned Pixel Spacing (0018,2010) are absent, > then it cannot be determined whether or not correction or calibration > have been performed. References: * https://dicom.nema.org/medical/dicom/current/output/chtml/part03/sect_C.8.6.2.html#table_C.8-25 * https://dicom.nema.org/medical/dicom/current/output/chtml/part03/sect_10.7.html#table_10-10 Co-authored-by: Matt McCormick <[email protected]> Co-authored-by: Mihail Isakov <[email protected]> Co-authored-by: Steve Pieper <[email protected]>
FYI, this behavior (the optional presence of the ImagePlane Module and accompanying note about relationship of spacing attributes) is now standardized. |
This will add support for many data sets, specially Visible Human Project recently released collection.
S. David Clunie's post post
S. InsightSoftwareConsortium/ITK#4109
P.S. The PR intentionally doesn't change writing of SC files.