<div dir="ltr"><div>Hi Omar,<br><br>Are you using GDCM or DCMTK as your reader?<br><br></div><div>Also, are you explicitly calling "reader->Update()" at some point before / after calling "<span style="white-space:pre-wrap"></span>reader->GetOutput()->SetSpacing(..)"?</div>
<div><br></div>Thanks,<br>Brian<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Nov 6, 2013 at 12:40 PM, O Hamo <span dir="ltr"><<a href="mailto:ohamo@live.de" target="_blank">ohamo@live.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div dir="ltr">Hello,<div><br></div><div><div>I am reading a single image slice belonging to an DICOM CT series.</div><div>The component type is short and number of dimension is 3.</div><div>Now I want to modify the voxel spacing.</div>
<div>To do that I tried this:</div><div><span style="white-space:pre-wrap"> </span>double newSpacing[3];</div><div><span style="white-space:pre-wrap"> </span>newSpacing[0] = x_spacing;</div><div><span style="white-space:pre-wrap"> </span>newSpacing[1] = y_spacing;</div>
<div><span style="white-space:pre-wrap"> </span>newSpacing[2] = z_spacing;</div><div><span style="white-space:pre-wrap"> </span>reader->GetOutput()->SetSpacing(newSpacing);</div><div>but this will modify only x- and y-spacing while z remains the same (=1mm)</div>
<div>Also writing z_spacing to the header entry 0018,0050 (Slice Thickness) won`t change the fact, </div><div>that calling GetSliceSpacing() at the resulting image will return the values of x-and y-spacing but still 1 instead of z-spacing.</div>
<div><br></div><div>How can the 3rd spacing component be modified?</div><div>Is this even possible for the givien image?</div><div>Because Im assuming that ITK is calculating the spacing by using ImagePositionPatient(0020,0032) and ImageOrientationPatient(0020,0037), </div>
<div>but sets it by default to 1 when it cant find more than one slice. (Just a guess)</div><div><br></div><div>Any help is apreciated.</div></div><div><br></div><div>Kind Regads,</div><div>Omar</div> </div></div>
<br>_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br>_______________________________________________<br>
Community mailing list<br>
<a href="mailto:Community@itk.org">Community@itk.org</a><br>
<a href="http://public.kitware.com/cgi-bin/mailman/listinfo/community" target="_blank">http://public.kitware.com/cgi-bin/mailman/listinfo/community</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Brian Helba<br>Medical Imaging<br>Kitware, Inc.<br>
</div>