John:<br><br>Its customary to use the camera to view the data at the desired orientation instead of changing the data.<br><br>--<br>karthik<br><br><div class="gmail_quote">On Tue, May 19, 2009 at 5:13 PM, John Drescher <span dir="ltr"><<a href="mailto:drescherjm@gmail.com">drescherjm@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">On Tue, May 19, 2009 at 4:48 PM, kent williams<br>
<<a href="mailto:nkwmailinglists@gmail.com">nkwmailinglists@gmail.com</a>> wrote:<br>
> Not to get all LOLCats on you or anything but UR DOING IT RONG.<br>
><br>
> The spacing is a size in centimeters -- usually. A negative size<br>
> won't do what you want.<br>
><br>
</div>I know but that seems to work while the correct way fails..<br>
<div class="im"><br>
><br>
> It sounds like you're using DICOM files, but you don't say so<br>
> explicitly.<br>
<br>
</div>Yes.<br>
<div class="im"><br>
>ITK will try and recover the proper orientation in<br>
> anatomical space from DICOM files.<br>
><br>
> The way to handle this properly would be to change the ITK Direction<br>
> Cosines for the image. It's perfectly reasonable for the slices to be<br>
> ordered in the negative image direction, but you have to clue in ITK<br>
> and VTK how it's oriented.<br>
><br>
> The easiest way is to load the file with ITK, and then set the<br>
> Direction Cosines to reflect the actual orientation of the image in 3D<br>
> space. In this case you'd probably specify<br>
><br>
> 1 0 0<br>
> 0 1 0<br>
> 0 0 -1<br>
><br>
</div>I initially did that, but vtk had the Coronal and Sagittal views<br>
upside down. Having vtk flip the output lead to problems because the<br>
display code is doing computations like the following:<br>
<br>
origin[axis] + slice * spacing[axis];<br>
<div class="im"><br>
><br>
> as the direction cosines. Then use the itk::OrientImageFilter to set<br>
> its orientation to identity, which according to<br>
> itk::OrientImageFilter's nomenclature is RAI.<br>
><br>
> The other solution would be to read the slices in reverse order -- the<br>
> itk::ImageSeriesReader allows you to customize the ordering -- you<br>
> could read all the names into a std::list and then reverse the list<br>
> before having the Series Reader do it's thing.<br>
><br>
<br>
</div>I want the images loaded this way because I pass the image on to 2<br>
different libraries (c array based) that requires this orientation for<br>
their processing. I could have let itk read the images in<br>
PatientPosition and flipped but I plan to eventually display the<br>
result so I wanted to keep the volume and the result in memory the<br>
same orientation..<br>
<font color="#888888"><br>
John<br>
</font><div><div></div><div class="h5">_____________________________________<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>
Please keep messages on-topic and check the ITK FAQ at: <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>
</div></div></blockquote></div><br>