SlicerDMRI / SlicerDcm2nii

Support loading DICOM data in Slicer using the functionality of the dcm2niix program.
4 stars 3 forks source link

dcm2niix is not generating Volume data #8

Closed ignaciordc closed 2 years ago

ignaciordc commented 2 years ago

I am running 3D Slicer 4.10.2, the latest that supports Mac OS Sierra (10.12)

Tried to import a stack of DICOM files, and, by default, it launched DWIConvert module, which gave me an error, for it tried to load it "as DWI Volume as a Diffusion Volume":

I googled it and found the the module assumes DCM files are DWI ("Can't find tag 29 1010"),which is not my case, hence I installed extension DCM2NiixGUI. It worked, I was a able to load the data in 3D Slicer. However, it is unable to Render its volume. When I save the nrrd data, I can see the header contains: thicknesses: Nan Nan 0.86 I think that is the reason it's unable to render in 3D. The original DICOM files contained (0028, 0030) Pixel Spacing DS: [0.572917, 0.572917] which is not reflected in the .nhdr file (Nan Nan).

Maybe the (images) raw data saved contain that info, but in any case 3DSlicer is not using it for the volume. No volume is rendered. Proyections are being displayed correctly, and respond to the slicers in the three views, but in 3D only 3 orthognal slices are shown. The "rotate to volume plane" option is not working as expected either: I think the images in the original DICOM files are already converted to real-world coordinates in the nrrd files.

What should I do in order to to import DICOM images without DWI information and display their volume? Thanks, Ignacio

PS: As expected: images as shown in the original DICOM,i.e., as acquired: the original images have (0020, 0037) Image Orientation (Patient) DS: [0.835, 0.551, 0.0, 0.110, -0.168, -0.980] (that is, the subject is not positioned to viewer's saggital and coronal standards) The real distance between pixels in 3D orthogonal coordinates is 0.56. The volume extension does not help if the voxels don't have the proper info...

ljod commented 2 years ago

Hi Ignacio and thank you for reporting this! First, are your images diffusion MRI images? I can't tell from your question if they are actually DWI/diffusion MRI or not.

For DWI, DCM2Nii is developed by the amazing Chris Rorden @neurolabusc who may have some input on this issue.

If your data is DWI there is good information about using that in DCM2Nii here https://www.nitrc.org/plugins/mwiki/index.php/dcm2nii:MainPage#Diffusion_Tensor_Imaging

ignaciordc commented 2 years ago

Thanks for your quick answer! Sorry, I forgot to mention the images are not DWI -- that is why I went and grabbed the other plugin, to explicitely avoid DWI. Thought it could handle non-DWI DICOM files... does it?

I went through the Volume tutorial of Sonia Pujol, that imports CT images in her 3DVisualizationDataset, but that has not helped me with my dataset.

The way I am going is trying to generate a new volume (numpy array) applying the 3D transforms available in nibabel source orientation.py .

I am wondering, though, if 3DSlicer (or its volume plugins) expects some other information/tags in the DICOM files (such as Siemens' CSA'), 'cause it imports the file, but only allows viewing the slices, can not render them as volume.

Thanks for your interest and help! Ignacio

fedorov commented 2 years ago

@ignaciordc if your images are de-identified, the most efficient way to investigate this may be sharing a series from your dataset.

neurolabusc commented 2 years ago

I would suggest you remove Slicer from the equation:

If the results are not plausible, you can go to the dcm2niix page to file an issue.

ignaciordc commented 2 years ago

Lauren, If it helps you, you can download the set of images from this link:

https://www.dropbox.com/s/0gp4bwqrut1sigm/Embryo6.zip?dl=0

Ignacio

ignaciordc commented 2 years ago

Andrey, Yes, the images are anonimized, of course!

Chris, The 3DSlicer will be in the equation, for the plan is to segment it once rendered. Your SlicerGUI plugin worked fine, but, as described above, Slicer displays slices but does not render volume. I'll give MRIcroGL a go and let you know.

Thanks both, Ignacio

ignaciordc commented 2 years ago

Chris, Yep, it worked! MRIcorGL created the NifTI which imported into 3DSLicer was rendered.

Thank you all, ignacio

PS: Issue can be closed.

neurolabusc commented 2 years ago

Great. As an aside, I did not mean remove slicer from the equitation for your workflow entirely. Rather, just to help trouble shoot it. It looks like you already removed the sample image, perhaps @ljod or others would like to see it to see if they can improve the Slicer import.

ignaciordc commented 2 years ago

Chris, Ooops! yes, I did remove it, but it was with good intentions, in order to avoid cluttering. I'm putting it back.

PS: Some notes on those images: they seem to have noise in the black area. If you try to convert it with Jolinda Smith's MRIConvert, it complains and states it's not a valid DICOM file. In fact, it is a Siemens CSA file, with extra header info, but not conformant to the standard. Your tool does a much better work. Only comment I have is: would love reorientation of the XY axes, rotating them around the Z axes. so that saggital is a real saggital...

I am now checking if there are better segmentation tools than the one in Slicer. Any hint?

pieper commented 2 years ago

Slicer's Segment Editor is very general purpose but also very powerful. You should try the latest preview release since it's much improved since 4.10.2.

If your goals is neuroimage segmentation, try the suggestions here:

https://discourse.slicer.org/t/whole-brain-automate-segmentation/21225/7

ljod commented 2 years ago

Thank you Steve!

Lauren J. O’Donnell, Ph.D. Associate Professor, Harvard Medical School 1249 Boylston St., Room #210 Boston, Massachusetts 02215 @.***


From: Steve Pieper @.> Sent: Wednesday, January 12, 2022 12:58 PM To: SlicerDMRI/SlicerDcm2nii @.> Cc: O'Donnell, Lauren J., Ph.D. @.>; Mention @.> Subject: Re: [SlicerDMRI/SlicerDcm2nii] dcm2niix is not generating Volume data (Issue #8)

    External Email - Use Caution

Slicer's Segment Editor is very general purpose but also very powerful. You should try the latest preview release since it's much improved since 4.10.2.

If your goals is neuroimage segmentation, try the suggestions here:

https://discourse.slicer.org/t/whole-brain-automate-segmentation/21225/7https://secure-web.cisco.com/1gdqJqoFtoNgM2TZ1BXBIvhwfV_iPAKITcMcEUeYDI2Wez-CY-WBhlzhfmi7q4_NBusIgcohs-QJm0eChm31-dxKd1wkL-CNzFhCuK5SUbVKqra7Zlc93DtaqE5C_6BL4xYebkoPlblQei_Xb5NETB6oUiJHQBFa1dEY31zdk9f55WrE4whQi8Yxes_3-zb3VwWOSNuRBEzjF88SieoUDAvbHox-k6NRzsCh21xglnrBa9dYu4yQPeVklussMsNFn5L2GMPl1vFVao7ERyvakpFthe8BwALPkEPr45Olgc_FbiunUtMMf0JmSUwNfvcSf/https%3A%2F%2Fdiscourse.slicer.org%2Ft%2Fwhole-brain-automate-segmentation%2F21225%2F7

— Reply to this email directly, view it on GitHubhttps://secure-web.cisco.com/1D75USmwVRlAh8EB-UU1OG0wL5pFsk3tIPI2bKefPk0D67qCNZPB-OjNDMlXhWZcUjbNcQNdKwf_DtpWF5BR83HeHqLQpgEjCf8djtBVUmL35uEnI6JS6qP04_WUqykMDDCTV-zZgrhhkylOOViTp-DjomM737WLlChoAcrwoAZZ9vbovt5_F2eaZ7TLlVMZgkSxtRW0-SeJCh_q7qwV2X8IAAOL-dI1ZUcklLDUURDWgztUYKi8lRPliJt2K1McTuh3JPQY7bQX-IJBP9yvLkhw2l4-k19gPHvVltCKW2H1wnpwhAUykIHPqU9wcEBsr/https%3A%2F%2Fgithub.com%2FSlicerDMRI%2FSlicerDcm2nii%2Fissues%2F8%23issuecomment-1011309153, or unsubscribehttps://secure-web.cisco.com/1_Wm30J65PY1hg4KDLbk2_UYm65q-V_Aj8tu0LKkKdxKG8tpkamG7tiCKvB5eBiKarel5t_-diIXR9gerAu8ip3XYR_I9RESH9ig3j9rtfjVG6F-TCHVbxDy12jAFq2B8iblRDXQVf-2jKWd6HqwVSeIweNBSnjZpSA__kyPcwEkOsHJiOVtq76-TJ-c_RPtraMCyj_9XM9AWAyjzKfo2Autv8vUWjSE6u2sHDlqnz_jzXKIYC_MjvR75gdvOjsiNX3D-bJPbnKlTFxVLqXmGE-I24BqyxeWIGBhElvRHeCDhF8QOo4oov1sIh8RyhNWi/https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FABEAZ57EHZRFVLKBHPDMD6LUVW6NDANCNFSM5LRINYSQ. Triage notifications on the go with GitHub Mobile for iOShttps://secure-web.cisco.com/1V1jIsV9qXZQodKsafL4yWtL9n57vqBNjvIaMTduGDvKt6SiiuJVqOcv4COvvLaKkH_ZfLRY9dXWnNnTjXZBDc2qgENBTsUyK4wiAB40DkZEr28WdAJZEcP0rHr5V1iIifIiCs4ucTixnQp7ufrbVkFb3WS6cVD3EkZYeSO2Be-zeg27sNSM4kkyV__HDMYRh1fiy2KqxN8j5rBuqaDYr18TS0bdF9D4pY0OcWMi6TL3YfmiEetkhZ4PcveSs66tGpk3aROKJv1J8FLwJE-QqvoZ_9w_nzWKXLzoJNcLgh9dxEU8AuJjcGB1N-Jc36727/https%3A%2F%2Fapps.apple.com%2Fapp%2Fapple-store%2Fid1477376905%3Fct%3Dnotification-email%26mt%3D8%26pt%3D524675 or Androidhttps://secure-web.cisco.com/16d9PznJlAWqmxdURMN0h1-WxvT-VgGbTyXu-FUPoGfZqZupUj58cXt2M4q24zj9iD5spo3Mdny0Qrp6o3DkfTjTKb1VL_GBB65P5fvJwN18eR-Hkaau9uq5PtJgonXafFvkn0dS9ZH9byPH9nh3Irv5jNW0Frk0k4BHDIgvKqFboo_ioF7gfKfs04ZkAQj0mHRPDiEowU06_4Mz-OYZ7DqMXV_3Xo59WJlH5UFYtJO6gdLKRqyD-fsoQCaxezo9rgK4eLieLP88pgXhQBf5RAx4zo3aTrY7Cg1rcgZrxPJgbkJ968bTr15QoL8FfMR4f/https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dcom.github.android%26referrer%3Dutm_campaign%253Dnotification-email%2526utm_medium%253Demail%2526utm_source%253Dgithub. You are receiving this because you were mentioned.Message ID: @.***>

neurolabusc commented 2 years ago

@ignaciordc

fedorov commented 2 years ago

Yep, it worked! MRIcorGL created the NifTI which imported into 3DSLicer was rendered

Is the version of dcm2niix the same in MRIcorGL and 3D SlicerDcm2Nii? It looks like the latter is using the development branch: https://github.com/SlicerDMRI/SlicerDcm2nii/blob/master/SuperBuild/External_dcm2niix.cmake#L31.

fedorov commented 2 years ago

And I would not close the issue - the reported issue is about Slicer dcm2nii extension not being able to load the image properly, which has not been resolved.

neurolabusc commented 2 years ago

@fedorov good catch, I suspect the extension originally used the development branch as I added a few Slicer specific features, these are all now part of the stable master branch, so the master branch should be sourced.

lassoan commented 2 years ago

I am now checking if there are better segmentation tools than the one in Slicer. Any hint?

Slicer's Segment Editor is the most versatile segmentation tool among all open-source and commercial medical imaging software that I know of. It can work with any number of input volumes, 2D/3D/4D, in any orientation, with overlapping segments, editable in 2D and 3D, with about 15-20 manual, semi-automatic, and fully-automatic segmentation tools, using classic and AI-based methods. See a general introduction here: https://slicer.readthedocs.io/en/latest/user_guide/image_segmentation.html

With all these features are exposed, Slicer can be overwhelming at first, so if you are sure that all you will ever need are basic manual contouring and region growing on a single volume then you can use ITK-Snap. General medical image segmentation tools, such as Materialize Mimics or Simpleware comes close to Slicer's feature set, but they are not much easier to use, and very expensive. Clinical segmentation tools can be easier to use and very effective for the specific segmentation tasks that they are designed for, but they impose many limitations for regulatory compliance reasons, and can be very expensive.

fedorov commented 2 years ago

the master branch should be sourced

Great, we should update and test again once this update propagates into the preview release. Will you do it Chris? I am not actively using this extension, but I do consider it very valuable, and I don't want this to fall through the cracks.

lassoan commented 2 years ago

Also note that Slicer-4.10 was released 3 years ago (build from the development version at the time). Both dcm2niix and Slicer got many bugfixes and improvements since then. Maybe everything works well with recent Slicer versions, but switching to the master branch of dcm2niix makes sense anyway. This discussion is already quite long, so I've added a separate issue to track that task: https://github.com/SlicerDMRI/SlicerDcm2nii/issues/9.

ignaciordc commented 2 years ago

Hi, Thanks for all your comments, and for updating the dcm2niix Slicer plugin!

I am working at home with a MacBookPro, Mac OS 10.12(Sierra) and Slicer 4.10.2 is the latest release supporting that OS. At work, Slicer 4.13.0 runs under Windows 10, but Remote Desktop (or maybe my mid-2011 hardware, stuck on openGL 1.0), doesn't let me run it.

I'll follow your advice and stick to the Segmentation Editor of Slicer.

Cheers, Ignacio

pieper commented 2 years ago

Hi @ignaciordc - you may want to try a different remote desktop solution like VNC, chrome remote desktop, etc to work around the opengl issue. It's very hard for us to support older hardware/software/os versions so using the latest is always a good idea.

lassoan commented 2 years ago

If you must use Windows Remote Desktop then you can replace the hardware renderer by a software renderer (Mesa) by simply replacing a file in the Slicer installation. See instructions in the note here: https://slicer.readthedocs.io/en/latest/user_guide/get_help.html#slicer-application-does-not-start

ignaciordc commented 2 years ago

Thanks, Andras.

Regarding dcm2niix: I have tried the plugin with Slicer 4.11.20210226 (the link to the Windows version 4.13.0, revision 30528 built 2022-01-13 is not working). It imports the images and is able to display the projections, but is not registering the data as a 3D volume. Hence, no 3D rendering.

benjaclara commented 2 years ago

Hey bro, I'm trying to do the same thing, but in specific to liquid CRYSTAL display, TFT or even Led, a tip! Don't complicate, make it simple, search for _malus law _or Brewster law, don't try to force light in to physical coordenates, it's easy If you set it free, as an alternative I'm thinking to explore magnetic solution to deform/curve ligth, I almost reach my goal, but the only problem to get a clear/sharped/proyection or 3d ligth volume it is that or the screen or led has to be in zig zag or tilt movement, if you set on complete darkness to make your tests it is better , I use the old datasets of TF transistors and pixel electrodes and almost get a clear pop-out 3d proyection totally static!