-
Notifications
You must be signed in to change notification settings - Fork 37
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
Cannot open custom highdicom derived SC DICOM in ITK-Snap #247
Comments
Hi @tomaroberts . There are no obvious problems with your code. I imagine that this is a problem with Itk-snap. Note that secondary captures are not really intended for recording 3D images in this way. Consequently they lack the spatial metadata expected by software to correctly create a 3D volume from a series of files. Specifically they do not have the ImageOrientationPatient (as you mentioned) and ImagePositionPatient attributes. You can just add these after creating the objects if you like (and make sure that the image position patient attributes varies between slices in the way implied by the image orientation patient). I suspect that this may allow ITK snap to display the volume correctly. But note that this is not compliant with the DICOM standard, it's a hack. Other suggestions would be to run a validator such as dciodvfy on your files just to make sure that there are no issues with them. |
@CPBridge – Thanks for the reply, much appreciated. I've not seen dciodvfy before, I'll check it out, thanks. Can I ask, are the SC DICOMs produced by highdicom compatible with commercial clinical information systems such as SECTRAPACS, scanner software, etc? Or do they need further coding on top of the tutorial examples? In my experience, it's one thing getting DICOMs to open in open-source software such as ITK-Snap, etc., but then there is another layer of complexity to surmount when it comes to full clinical systems. Are there any example highdicom generated SC DICOMs which are known to open in PACS, etc? Or other imaging DICOM types – i.e., not just SC. Cheers |
Note that there's some disagreement about whether secondary captures with geometry information should be supported (see this issue and comments: InsightSoftwareConsortium/ITK#4109). In summary, two noted DICOM experts disagree, so GDCM, which is the default DICOM reader will not read the image position and orientation from SC but other systems (e.g. DCMTK and ultimately ITK and Slicer likely will; pydicom reads the tags but of course doesn't make direct use of them). I'll leave it to you @CPBridge, @hackermd and others how highdicom should behave. @tomaroberts you may find this helpful: https://dicom4qi.readthedocs.io/en/latest/ Also note that clinical systems vary WIDELY in what they will or won't accept, so your only sure course is to experiment. Start with something they can read, then reverse engineer until your code works. Often the fallback is to pretend your SC is a CT or something. |
Thanks @pieper – yep, reverse engineering is my approach to making DICOMs for clinical systems. Sigh. But good to know I'm not the only one. When you say pretend the SC is a CT or something – do you mean create an SC and then set the Modality, etc. to CT, or... just use a CT DICOM and go from there to begin with? I'm not very familiar with SC, so tend to do the latter myself. |
It's hard to say for sure what will work best for any given scenario, but for reference, two very experienced ITK developers (Jim Miller and Bill Lorensen from GE) created this module for Slicer (https://slicer.readthedocs.io/en/latest/user_guide/modules/createdicomseries.html) by adding all the tags they needed to make the results work with their Advantage Windows system at the time (early 2000s). By default it treated any ITK image data as a CT and it was enough to make it show up on the clinical system. I don't recall if they tried and rejected SC or just used CT because that's what data they were working with at the time. Setting the Modality of a derived image to match the input is more "correct" but maybe not strictly needed depending on your use case. |
While @pieper is definitely right that it can often be a bit of a guessing game getting things to work in clinical systems, I have to say my experience with secondary captures (including those produced by highdicom) is that they are generally very well supported by most "simple" radiology DICOM-first viewers (i.e. those focused on clinical radiology workflows rather than medical image computing and 3D imaging research workflows). I would bet you would be able to view your images in something like Osirix/Horos or weasis. This is because secondary captures are old, simple and widely used. Most "simple" DICOM viewers will simply try to order the images by instance number and not worry about the spatial metadata (unless of course you try to use some sort of MPR functionality). By contrast things like Slicer, ITK-Snap etc tend to try and always make series into volumes (which cannot be done in this case) because they are fundamentally more advanced 3D viewers. Though of course @pieper knows much more about the specifics here. |
I agree with @CPBridge that making an SC that shows up correctly in a simple dicom viewer as a 2D image is very robust and has been around for ages. It's the 3D part that is a bit controversial and may not work well and may require experimentation. |
This enables support for reading image orientation patient and image position patient from DICOM secondary capture images. This addresses needs such as reading Visibla Human DICOM color images in 3D Slicer: NA-MIC/ProjectWeek#875 and reading highdicom derived secondary capture DICOM in ITK-Snap: ImagingDataCommons/highdicom#247 The required patch has not yet been merged upstream: malaterre/GDCM#167 but is available in ITK-vendored GDCM, so condition enablement on NOT ITK_USE_SYSTEM_GDCM and provide a warning and pointer on where to find the patches for package managers and other redistributors that also the support.
This enables support for reading image orientation patient and image position patient from DICOM secondary capture images. This addresses needs such as reading Visible Human DICOM color images in 3D Slicer: NA-MIC/ProjectWeek#875 and reading highdicom derived secondary capture DICOM in ITK-Snap: ImagingDataCommons/highdicom#247 Update the RGB tests' baseline that were using a .png baseline because they now output spatial metadata.
This was addressed in ITK (see InsightSoftwareConsortium/ITK#4521 and related). @jcfr @pieper may know when it will land in 3D Slicer. @jilei-hao @pyushkevich may know when it will land in ITK-SNAP. |
Hi – I'm not super familiar with highdicom; this seems like a fairly straightforward problem but I've not managed to find solution to my issue in the docs or existing Issues, so apologies if I've missed it.
I'm basically trying to write a 3D singleframe .dcm dataset following the second code block in the tutorial here. I have no segmentation overlay, so I've removed those parts.
My adapted code snippet is below:
When I try to open this in ITK-Snap, it errors with the following:
My input NIFTI dataset is derived from MRI data, hence
MONOCHROME2
andBitsAllocation
= 16. When I opened the DICOMs in MITKWorkbench, it also failed and indicated an orientation problem, so I tried manually addingImageOrientationPatient = (e.g.) ['1', '0', '0', '0', '1', '0']
but that has not helped.Here's a dump of the DICOM metadata:
Thanks in advance.
The text was updated successfully, but these errors were encountered: