<div dir="ltr"><div><div><div>Hi Norman,<br><br></div>    Thanks for the suggestion. I also tried DCMTK but it does not work. There are a lot of errors relating svd calculations. I think it has some issues when computing the orientation matrix.<br>

<br></div>   Supprisingly, when I tried to link with ITK-3.20.1, the meta image has the correct orientation and spacing. I don&#39;t know why ITK v4 or the newer version of GDCM in it causes this problem.<br><br>Thanks,<br>

</div>Mengda<br><div><div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Nov 11, 2013 at 10:40 AM, Williams, Norman K <span dir="ltr">&lt;<a href="mailto:norman-k-williams@uiowa.edu" target="_blank">norman-k-williams@uiowa.edu</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Try using DCMTKImageIO instead.  This needs to be turned on when you<br>
configure and build ITK.<br>
<br>
Module_ITKDCMTK:BOOL=ON<br>
Module_ITKIODCMTK:BOOL=ON<br>
GDCM has some issues with reading DICOM files. These may or may not be<br>
addressed with a more recent version of GDCM; the last time I tried using<br>
a current version of GDCM I couldn&#39;t get ITK to build with it.<br>
<br>
--<br>
Kent Williams <a href="mailto:norman-k-williams@uiowa.edu" target="_blank">norman-k-williams@uiowa.edu</a><br>
<div><div><br>
<br>
<br>
<br>
<br>
<br>
On 11/11/13 9:22 AM, &quot;Mengda Wu&quot; &lt;<a href="mailto:wumengda@gmail.com" target="_blank">wumengda@gmail.com</a>&gt; wrote:<br>
<br>
&gt;BTW, here is what I got by running gdcminfo (gdcm version 2.4.0) on one<br>
&gt;of the dicoms:<br>
&gt;======================================================================<br>
&gt;MediaStorage is 1.2.840.10008.5.1.4.1.1.7 [Secondary Capture Image<br>
&gt;Storage]<br>
&gt;TransferSyntax is 1.2.840.10008.1.2.1 [Explicit VR Little Endian]<br>
&gt;NumberOfDimensions: 2<br>
&gt;Dimensions: (512,512,1)<br>
&gt;SamplesPerPixel    :1<br>
&gt;BitsAllocated      :16<br>
&gt;BitsStored         :16<br>
&gt;HighBit            :15<br>
&gt;PixelRepresentation:1<br>
&gt;ScalarType found   :INT16<br>
&gt;PhotometricInterpretation: MONOCHROME2<br>
&gt;PlanarConfiguration: 0<br>
&gt;TransferSyntax: 1.2.840.10008.1.2.1<br>
&gt;Origin: (0,0,0)<br>
&gt;Spacing: (1,1,1)<br>
&gt;DirectionCosines: (1,0,0,0,1,0)<br>
&gt;Rescale Intercept/Slope: (-1024,1)<br>
&gt;Orientation Label: AXIAL<br>
&gt;=======================================================================<br>
&gt;<br>
&gt;<br>
&gt;Clearly, from<br>
&gt;(0018,0088)=0.449999988<br>
&gt;<br>
&gt;(0028,0030)=0.400391012\0.400391012<br>
&gt;<br>
&gt;The spacing should not be (1,1,1).<br>
&gt;<br>
&gt;Thanks,<br>
&gt;Mengda<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;On Mon, Nov 11, 2013 at 10:14 AM, Mengda Wu<br>
&gt;&lt;<a href="mailto:wumengda@gmail.com" target="_blank">wumengda@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt;Hi all,<br>
&gt;<br>
&gt;  I have some dicom images in my new project. But when I tried to convert<br>
&gt;them to the ITK metaimages, the origin and spacing are incorrect even<br>
&gt;though the intensities are right. The origin becomes (0,0,0) and spacing<br>
&gt;is (1,1,1). I am the example<br>
&gt;DicomSeriesReadImageWrite2.cxx<br>
</div></div>&gt;&lt;<a href="http://itk.org/gitweb?p=ITK.git;a=blob_plain;f=Examples/IO/DicomSeriesRea" target="_blank">http://itk.org/gitweb?p=ITK.git;a=blob_plain;f=Examples/IO/DicomSeriesRea</a><br>
&gt;dImageWrite2.cxx;hb=HEAD&gt;<br>
<div><div>&gt;<br>
&gt;<br>
&gt;<br>
&gt;from ITK 4.4.2. The code does not have any issue with other Dicoms for my<br>
&gt;previous projects. so my guess is the current dicoms miss some fields in<br>
&gt;the header that ITK needs.<br>
&gt;<br>
&gt;<br>
&gt;Can you help? I am attaching the fields from one dicom as follows:<br>
&gt;<br>
&gt;(0002,0000)    Group Length<br>
&gt;Value: 206<br>
&gt;(0002,0001)    File Meta Information Version<br>
&gt;Value: 0<br>
&gt;(0002,0002)    Media Storage SOP Class UID<br>
&gt;Value: 1.2.840.10008.5.1.4.1.1.7<br>
&gt;(0002,0003)    Media Storage SOP Instance UID<br>
&gt;Value: 1.2.276.0.28.3.2418833.1095761920.42.5040.2012041216272628700<br>
&gt;(0002,0010)    Transfer Syntax UID<br>
&gt;Value: 1.2.840.10008.1.2.1<br>
&gt;(0002,0012)    Implementation Class UID<br>
&gt;Value: 1.2.276.0.7230010.3.0.3.6.0<br>
&gt;(0002,0013)    Implementation Version Name<br>
&gt;Value: OFFIS_DCMTK_360<br>
&gt;<br>
&gt;(0008,0008)    Image Type<br>
&gt;Value: DERIVED\SECONDARY\REFORMATTED<br>
&gt;<br>
&gt;(0008,0016)    SOP Class UID<br>
&gt;Value: 1.2.840.10008.5.1.4.1.1.7<br>
&gt;(0008,0018)    SOP Instance UID<br>
&gt;Value: 1.2.276.0.28.3.2418833.1095761920.42.5040.2012041216272628700<br>
&gt;(0008,0020)    Study Date<br>
&gt;(0008,0022)    Acquisition Date<br>
&gt;Value: 20120116<br>
&gt;(0008,0023)    Image Date<br>
&gt;Value: 20120116<br>
&gt;(0008,0030)    Study Time<br>
&gt;(0008,0033)    Image Time<br>
&gt;Value: 120859.658000<br>
&gt;<br>
&gt;(0008,0050)    Accession Number<br>
&gt;(0008,0060)    Modality<br>
&gt;Value: CT<br>
&gt;(0008,0070)    Manufacturer<br>
&gt;Value: Philips<br>
&gt;<br>
&gt;(0008,0080)    Institution Name<br>
&gt;Value: Hide<br>
&gt;(0008,0090)    Referring Physician&#39;s Name<br>
&gt;(0008,103E)    Series Description<br>
&gt;Value: Hide<br>
&gt;(0008,1090)    Manufacturer&#39;s Model Name<br>
&gt;Value: Brillance 64<br>
&gt;(0010,0010)    Patient&#39;s Name<br>
&gt;Value: Patient00<br>
&gt;(0010,0020)    Patient ID<br>
&gt;(0010,0030)    Patient&#39;s Birth Date<br>
&gt;Value: NewDOB16<br>
&gt;(0010,0040)    Patient&#39;s Sex<br>
&gt;Value: F<br>
&gt;(0010,1010)    Patient&#39;s Age<br>
&gt;Value: 054Y<br>
&gt;(0018,0088)    Spacing Between Slices<br>
&gt;Value: 0.449999988<br>
&gt;<br>
&gt;(0018,1151)    X-ray Tube Current<br>
&gt;Value: 429<br>
&gt;(0020,000D)    Study Instance UID<br>
&gt;Value: 1.2.276.0.28.3.2418833.1095761920.42.3628.2012011611085965900<br>
&gt;(0020,000E)    Series Instance UID<br>
&gt;Value: 1.2.276.0.28.3.2418833.1095761920.42.3628.2012011611085965901<br>
&gt;(0020,0010)    Study ID<br>
&gt;(0020,0011)    Series Number<br>
&gt;(0020,0013)    Image Number<br>
&gt;Value: 1<br>
&gt;(0020,0020)    Patient Orientation<br>
&gt;(0020,0032)    Image Position (Patient)<br>
&gt;Value: 0.200195506\0.200195506\0.224999994<br>
&gt;<br>
&gt;(0020,0037)    Image Orientation (Patient)<br>
&gt;Value: 1\0\0\0\1\0<br>
&gt;<br>
&gt;(0020,4000)    Image Comments<br>
&gt;(0021,0010)<br>
&gt;Value: Timepoint Information<br>
&gt;<br>
&gt;(0021,1010)<br>
&gt;Value: 20120116 120608.154000<br>
&gt;(0021,1011)<br>
&gt;Value: UNKNOWN<br>
&gt;<br>
&gt;(0028,0002)    Samples per Pixel<br>
&gt;Value: 1<br>
&gt;(0028,0004)    Photometric Interpretation<br>
&gt;Value: MONOCHROME2<br>
&gt;<br>
&gt;(0028,0008)    Number of Frames<br>
&gt;Value: 1<br>
&gt;(0028,0010)    Rows<br>
&gt;Value: 512<br>
&gt;(0028,0011)    Columns<br>
&gt;Value: 512<br>
&gt;(0028,0030)    Pixel Spacing<br>
&gt;Value: 0.400391012\0.400391012<br>
&gt;<br>
&gt;(0028,0100)    Bits Allocated<br>
&gt;Value: 16<br>
&gt;(0028,0101)    Bits Stored<br>
&gt;Value: 16<br>
&gt;(0028,0102)    High Bit<br>
&gt;Value: 15<br>
&gt;(0028,0103)    Pixel Representation<br>
&gt;Value: 1<br>
&gt;(0028,0106)    Smallest Image Pixel Value<br>
&gt;Value: 0<br>
&gt;(0028,0107)    Largest Image Pixel Value<br>
&gt;Value: 2610<br>
&gt;(0028,1050)    Window Center<br>
&gt;Value: 150<br>
&gt;(0028,1051)    Window Width<br>
&gt;Value: 500<br>
&gt;(0028,1052)    Rescale Intercept<br>
&gt;Value: -1024<br>
&gt;(0028,1053)    Rescale Slope<br>
&gt;Value: 1<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;Thanks,<br>
&gt;Mengda<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
<br>
<br>
<br>
</div></div>________________________________<br>
Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged.  If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited.  Please reply to the sender that you have received the message in error, then delete it.  Thank you.<br>


________________________________<br>
</blockquote></div><br></div></div></div></div></div></div>