MantisBT - ITK
View Issue Details
0011538ITKITKpublic2010-11-30 04:322010-12-01 08:58
Dzenan Zukic 
Hans Johnson 
normalminoralways
closedfixed 
VisualStudio2008Windows7 x64
ITK-3-20 
 
2010-12-01
backlog
0011538: NRRD library does not write out spacing
NRRD writing library does not output spacing, which is a very important information for medical images.
//converting from DICOM
DicomSeriesReadImageWrite2.exe DzZ_1189272 DzZ_1189272.nrrd
//spacing information missing in resulting file
The offending datasets can be found here: http://www.cg.informatik.uni-siegen.de/data/Downloads/DzZ.zip [^]
No tags attached.
Issue History
2010-11-30 04:32Dzenan ZukicNew Issue
2010-11-30 11:38Hans JohnsonAssigned To => kentwilliams
2010-11-30 11:38Hans JohnsonStatusnew => assigned
2010-11-30 11:45Hans JohnsonAssigned Tokentwilliams => Hans Johnson
2010-11-30 11:52Hans JohnsonNote Added: 0023582
2010-11-30 11:52Hans JohnsonStatusassigned => closed
2010-11-30 11:52Hans JohnsonResolutionopen => unable to reproduce
2010-12-01 03:21Dzenan ZukicNote Added: 0023631
2010-12-01 03:21Dzenan ZukicStatusclosed => feedback
2010-12-01 03:21Dzenan ZukicResolutionunable to reproduce => reopened
2010-12-01 03:23Dzenan ZukicResolution Date => 2010-12-01
2010-12-01 03:23Dzenan ZukicNote Added: 0023632
2010-12-01 03:23Dzenan ZukicStatusfeedback => assigned
2010-12-01 03:23Dzenan ZukicStatusassigned => resolved
2010-12-01 03:23Dzenan ZukicResolutionreopened => no change required
2010-12-01 08:58Hans JohnsonNote Added: 0023637
2010-12-01 08:58Hans JohnsonStatusresolved => feedback
2010-12-01 08:58Hans JohnsonResolutionno change required => reopened
2010-12-01 08:58Hans JohnsonNote Added: 0023638
2010-12-01 08:58Hans JohnsonStatusfeedback => closed
2010-12-01 08:58Hans JohnsonResolutionreopened => fixed

Notes
(0023582)
Hans Johnson   
2010-11-30 11:52   
This code is used in all of the Slicer3 package that uses the NRRD format extensively.

I just tested a conversion of the dicom data to nrrd format, and the space dimensions are preserved in the simple ConvertBetweenFileformats program that uses a very simple ITK reader connected to an ITK writer to gernerate the file.

Resulting NRRD file:
space directions: (-0.028482222114689648,1.5622371807694435,-0.0031697461963631213) (5.7780221141001675e-05,-0.0031692197808297351,-1.5624967403709888) (-14.997506414999528,-0.27342986976399952,7.341039418622205e-1
1)

14.999999046325684 1.562500000000000 1.562500000000000

Original Dicom data:
<element tag="0018,0088" vr="DS" vm="1" len="4" name="SpacingBetweenSlices">15.0</element>

<element tag="0028,0030" vr="DS" vm="2" len="14" name="PixelSpacing">1.5625\1.5625</element>


This seems correct to me.
(0023631)
Dzenan Zukic   
2010-12-01 03:21   
This is the header of DzZ_1189272.nrrd (the converted file):

NRRD0004
# Complete NRRD file format specification at:
# http://teem.sourceforge.net/nrrd/format.html [^]
type: short
dimension: 3
space: left-posterior-superior
sizes: 432 432 24
space directions: (0.39350563447362186,0.00098769730873018492,-0.0030858777289763093) (0.00066693602513074885,0.34207230580911041,0.19453376351618767) (0.026589041933276651,-1.6313203263046741,2.8684535544373988)
kinds: domain domain domain
endian: little
encoding: raw
space origin: (-86.408600000000007,-47.069099999999999,-132.21199999999999)
ITK_CoordinateOrientation:=

Spacing information is not explicitly written, but I tried loading the dataset in a 3D viewer and it is displayed correctly. Then I realized that spacing can be inferred from transform matrix ("space directions" in NRRD), and that NRRD loading library does it.
(0023632)
Dzenan Zukic   
2010-12-01 03:23   
Other program misinterpreted this NRRD file, and I mistakenly thought there is a bug.
(0023637)
Hans Johnson   
2010-12-01 08:58   
Need to close this.
(0023638)
Hans Johnson   
2010-12-01 08:58   
Closed.