View Issue Details

IDProjectCategoryView StatusLast Update
0003254Slicer4Module DICOMpublic2017-06-07 23:27
ReporterfedorovAssigned Tojcfr 
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product VersionSlicer 4.2.2-1 
Target VersionSlicer 4.3.0Fixed in VersionSlicer 4.3.0 
Summary0003254: Tilted volumes lose correct orientation on DICOM export
Description

Create DICOM Series (not listed in the Category list, so this issue is really not in the "Module DICOM" category, but very related) does not preserve the correct directions of the image on export. This is potentially a very dangerous situation, since exported DICOM data is not in the correct location. At the very least there should be a warning on the wiki page and in the module GUI about this limitation.

Additional Information

This may be a side-effect of switching to ITKv4:

https://github.com/Slicer/Slicer/blob/master/Modules/CLI/CreateDICOMSeries/CreateDICOMSeries.cxx#L254-L256

#if ITK_VERSION_MAJOR >= 4
extract->SetDirectionCollapseToGuess(); // ITKv3 compatible, but not recommended
#endif

TagsNo tags attached.

Relationships

duplicate of 0002945 closedjcfr dicom files get wrong origin and directions from CreateADICOMSeries 

Activities

pieper

pieper

2013-07-29 12:33

administrator   ~0009258

Hi Andrey -

Can you check and confirm that this is a duplicate of 0002945? If so, then it should be fixed by the patched in itk 4.4.1

Here's info from the slicer commit:

https://github.com/Slicer/Slicer/commit/552f2cbe3b70321b3a3a6c63a104d10182acb0c9

And here's the ITK stuff:

http://itk.org/gitweb?p=ITK.git;a=commit;h=9fa55c414d9000e467a57415329436e76356bebb

http://itk.org/gitweb?p=ITK.git;a=shortlog;h=refs/tags/v4.4.1

fedorov

fedorov

2013-07-31 06:11

developer   ~0009293

I confirm this remains a problem with Slicer r22251, ITKv4 35b90133a793ffd884820e499175db19366fe627.

Attached is the screenshot of the volume orientation for the original nrrd dataset (also attached) and the exported DICOM series (also attached).

2013-07-31 06:11

 

2013-07-31 06:11

 

2013-07-31 06:12

 

DCEFrame.nrrd (1,084,490 bytes)

2013-07-31 06:12

 

DCEFrameDICOMExport.zip (853,898 bytes)
pieper

pieper

2013-07-31 14:19

administrator   ~0009311

Can also confirm this is not fixed. I have built with the updated ITK version.

pieper

pieper

2013-07-31 14:21

administrator   ~0009312

Reminder sent to: hjmjohnson, millerjv

Has anyone single stepped through this to figure out what's happening?

The ITK issue fixed by Hans was apparently not the cause of this issue.

millerjv

millerjv

2013-08-02 10:32

developer   ~0009366

I don't think the issue is

#if ITK_VERSION_MAJOR >= 4
extract->SetDirectionCollapseToGuess(); // ITKv3 compatible, but not recommended
#endif

The orientations should be being pulled from the MetaDataDictionary.

millerjv

millerjv

2013-08-02 10:57

developer   ~0009367

The third component of the direction cosines (first two vectors) is being set to zero somewhere. GDCM is then complaining that the direction cosines are invalid (probably because they are no longer orthogonal) and defaults back to the identity.

millerjv

millerjv

2013-08-02 12:08

developer   ~0009368

itkGDCMImageIO is inconsistent as to whether the itkImage parameters of Origin and Direction are written to DICOM files or whether DICOM tags for these same variables in the MetaDataDictionary are written to DICOM files.

For Origin, preference is given to the DICOM tag in the MetaDataDictionary over the ITK_Origin tag in the MetaDataDictionary.

For DIrection, the opposite is the case. Preference is given to the ITK_Direction tag in the MetaDataDictionary over the DICOM tag in the MetaDataDictionary.

CreateADICOMSeries writes each slice individually (as opposed to passing a volume to GDCM or using the ImageSeriesWriter to manage the conversion from a volume to a series of slices). As such, the ITK_Origin and ITK_Direction are really 2D and we need to rely on the DICOM tags in the MetaDataDictionary to provide the proper values.

A patch to ITK has been submitted to gerrit

http://review.source.kitware.com/#/c/12177/

If approved, this patch could be moved to the branch of ITK that Slicer uses.

pieper

pieper

2013-08-06 12:30

administrator   ~0009415

@Jim: We discussed on the slicer hangout and with Kent's negative review and the lack of a test this may not get into ITK for a while.

Can this be worked around at the slicer level?

millerjv

millerjv

2013-08-06 13:20

developer   ~0009417

I am trying to convince Kent :)

We might be able to work around at the Slicer level by using the ImageSeriesWriter<3D,2D> and not using DICOM fields in the meta data for origin and direction.

millerjv

millerjv

2013-08-27 12:29

developer   ~0009645

This has been merged into ITK.

jcfr

jcfr

2013-08-28 17:00

administrator   ~0009689

Earlier this evening I tested the release branch of ITK and it doesn't compile ... seems to be a problem that occured when backporting commits. This is discussed here: http://www.itk.org/pipermail/insight-developers/2013-August/023102.html

I also proposed a patch that should fix the problem.

jcfr

jcfr

2013-08-28 20:33

administrator   ~0009691

Fixed in r22355
See http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=22355

jcfr

jcfr

2013-08-28 21:06

administrator   ~0009694

Reminder sent to: fedorov, hjmjohnson, millerjv, pieper

One last question, now the issue is resolved ... is the following statement still required:

extract->SetDirectionCollapseToGuess(); // ITKv3 compatible, but not recommended

See https://github.com/Slicer/Slicer/blob/master/Modules/CLI/CreateDICOMSeries/CreateDICOMSeries.cxx#L254-L256

jcfr

jcfr

2017-06-07 23:27

administrator   ~0014602

Fix committed to 2145-support-for-installing-extension-from-file branch.

Related Changesets

Slicer: 2145-support-for-installing-extension-from-file 3d3e0101

2013-08-29 00:33:04

jcfr

Details Diff
BUG: Ensure tilted volumes keeps correct orientation on DICOM export

This commit update the ITKv4 tag associated with the ITK release branch
so that at least the following commit is included:

cf0bd26 - BUG: GDCMImageIO ignore image orienations from MetaDataDictionary

The other notable ITKv4 commits that are now included are the following:

f2b19f0 - BUG: Need to set 3rd dir cosine for DICOM images
e966e36 - DOC: Rename DCMTKException DCMTKExceptionOrErrorReturn
449c71b - ENH: Accomodate Philips 4D Multiframe DICOM files
1c09982 - COMP: Avoid MetaIO config conflict with USE_SYSTEM_GDCM.
268bb25 - COMP: New baseline image for MultiResImageRegistrationTest.
ab3d00c - BUG: A fix for using sys installed GDCM.
6954fa3 - ENH: Exclude ITKGDCM module when system GDCM is ON.
2c00ca5 - BUG: itkSingleLevelSetsv4WhitakerImage2DTest output clobber.
b24c9f0 - COMP: Do not try to include float.h for MinGW.
376aeec - BUG: Row/Column assignment into ImageDimensions was wrong
34deb5c - BUG: Guard against Divide by Zero
0f27099 - BUG: {Opening,Closing}ByReconstructionImageFilter information propagation
ed3538f - BUG: Two tests were writing to same filename.
424c76f - BUG: ConstPointer assigned to non-const raw pointer
e8dfc74 - BUG: Fix failure in InteractivePause test
e218909 - BUG: Check that region for thread is not empty
0f0c163 - COMP: Fixed compiler error in C++11

For a complete list, see https://github.com/Kitware/ITK/compare/35b90133a793ffd884820e499175db19366fe627...237932867d8491db6a7745e6b4cc2b25f8e4470c

Fixes 0003254

Co-authored-by: Jim Miller <millerjv@ge.com>
Co-authored-by: Matt McCormick <matt.mccormick@kitware.com>

git-svn-id: http://svn.slicer.org/Slicer4/trunk@22355 3bd1e089-480b-0410-8dfb-8563597acbee
mod - SuperBuild/External_ITKv4.cmake Diff File

Issue History

Date Modified Username Field Change
2013-07-26 11:36 fedorov New Issue
2013-07-26 11:36 fedorov Status new => assigned
2013-07-26 11:36 fedorov Assigned To => pieper
2013-07-29 12:26 pieper Relationship added duplicate of 0002945
2013-07-29 12:33 pieper Note Added: 0009258
2013-07-31 06:11 fedorov Note Added: 0009293
2013-07-31 06:11 fedorov File Added: Screen Shot 2013-07-31 at 10.06.11 .png
2013-07-31 06:11 fedorov File Added: Screen Shot 2013-07-31 at 10.06.31 .png
2013-07-31 06:12 fedorov File Added: DCEFrame.nrrd
2013-07-31 06:12 fedorov File Added: DCEFrameDICOMExport.zip
2013-07-31 14:19 pieper Note Added: 0009311
2013-07-31 14:19 pieper Target Version => Slicer 4.3.0
2013-07-31 14:21 pieper Note Added: 0009312
2013-08-02 10:32 millerjv Note Added: 0009366
2013-08-02 10:57 millerjv Note Added: 0009367
2013-08-02 12:08 millerjv Note Added: 0009368
2013-08-06 12:30 pieper Note Added: 0009415
2013-08-06 13:20 millerjv Note Added: 0009417
2013-08-27 12:18 jcfr Assigned To pieper => millerjv
2013-08-27 12:29 millerjv Note Added: 0009645
2013-08-28 17:00 jcfr Note Added: 0009689
2013-08-28 20:33 jcfr Note Added: 0009691
2013-08-28 20:33 jcfr Status assigned => resolved
2013-08-28 20:33 jcfr Fixed in Version => Slicer 4.3.0
2013-08-28 20:33 jcfr Resolution open => fixed
2013-08-28 21:06 jcfr Note Added: 0009694
2013-08-29 10:13 fedorov Status resolved => closed
2017-06-07 23:27 jcfr Changeset attached => Slicer 2145-support-for-installing-extension-from-file 3d3e0101
2017-06-07 23:27 jcfr Note Added: 0014602
2017-06-07 23:27 jcfr Assigned To millerjv => jcfr