<br>Hi Wenjia,<br><br>Yes, <br>you will be able to make your programs assume an <br>identity transform by default if you do:<br><br><ul><li>Use itk::Image, and not itk::OrientedImage, and</li><li>Set ITK_IMAGE_BEHAVES_AS_ORIENTED_IMAGE = OFF<br>
</li></ul><br>Note that this is just to recover the previous behavior of your<br>code, however, it will be very dangerous to use this configuration<br>for any clinical application in which you need to produce reliable<br>
locations associated with the image data.<br><br><br>E.g. Don't do this if you are working in surgery planning or <br> surgery guidance.<br><br><br> Regards,<br><br><br> Luis<br><br><br>---------------------------------------------------------------------------<br>
<div class="gmail_quote">On Sun, Aug 16, 2009 at 8:45 AM, wenjia <span dir="ltr"><<a href="mailto:wenjia@robots.ox.ac.uk">wenjia@robots.ox.ac.uk</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;">
Hi Luis,<br>
<br>
I have not noticed the orientation problem before and written a lot of programs assuming the default direction to be identity. These programs work fine in ITK 3.8. However, after upgrading to ITK 3.14, a lot of programs function abnormally because itkImageBase starts using orientation information in conversion between index and physical point and the Analyze image has a non-identity direction.<br>
<br>
Is it possible to disable the default orientation of AnalyzeImageIO by setting ITK_USE_ORIENTED_IMAGE_DIRECTION=OFF when installing ITK 3.14?<br>
<br>
Many thanks,<br>
<font color="#888888">Wenjia<br>
</font><div><div></div><div class="h5"><br>
On 15 Aug 22:13, Luis Ibanez wrote:<br>
><br>
> Hi Wenjia,<br>
><br>
><br>
> Yes,<br>
> this is the default orientation for Analyze images.<br>
><br>
><br>
> Regards<br>
><br>
><br>
> Luis<br>
><br>
><br>
> ---------------------------<br>
> On Sat, Aug 15, 2009 at 10:15 AM, wenjia <<a href="mailto:wenjia@robots.ox.ac.uk">wenjia@robots.ox.ac.uk</a>> wrote:<br>
><br>
> Dear all,<br>
><br>
> I have just found that when ITK reads an Analyze image with unknown<br>
> orientation, it does not set the default image direction to identity.<br>
> Instead, it sets the direction to<br>
><br>
> [1 0 0<br>
> 0 0 -1<br>
> 0 1 0].<br>
><br>
> I am wondering why it uses this direction as default. Is this direction<br>
> defined in any Analyze format standard? Is it possible to change the<br>
> default to an identity matrix since it is easy to cope with?<br>
><br>
> I have put a test Analyze file on the website: <a href="http://www.robots.ox.ac.uk/" target="_blank">http://www.robots.ox.ac.uk/</a><br>
> ~wenjia/data/<br>
><br>
> In addition, my ITK version is 3.14. I am using the following code for<br>
> reading the direction,<br>
><br>
> #include "itkImage.h"<br>
> #include "itkImageFileReader.h"<br>
><br>
> int main(int argc, char *argv[])<br>
> {<br>
> // Check the number of input arguments<br>
> if(argc < 2){<br>
> std::cout << "Read an image and show its direction" << std::endl;<br>
> std::cout << "Usage: " << argv[0] << " image" << std::endl;<br>
> return -1;<br>
> }<br>
><br>
> const char *filename = argv[1];<br>
><br>
> // Read the image<br>
> const unsigned int Dimension = 3;<br>
> typedef double InternalPixelType;<br>
> typedef itk::Image<InternalPixelType, Dimension> ImageType;<br>
> typedef itk::ImageFileReader<ImageType> ImageReaderType;<br>
><br>
> ImageReaderType::Pointer reader = ImageReaderType::New();<br>
> reader->SetFileName(filename);<br>
> reader->Update();<br>
> ImageType::Pointer image = reader->GetOutput();<br>
><br>
> // Show the direction<br>
> std::cout << "The image direction is:" << std::endl;<br>
> std::cout << image->GetDirection() << std::endl;<br>
><br>
> return 0;<br>
> }<br>
><br>
><br>
> Many thanks,<br>
> Wenjia<br>
> --<br>
> Wenjia Bai<br>
> D.Phil Student<br>
> Wolfson Medical Vision Laboratory<br>
> Department of Engineering<br>
> University of Oxford<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>
> Please keep messages on-topic and check the ITK FAQ at: <a href="http://www.itk.org/" target="_blank">http://www.itk.org/</a><br>
> Wiki/ITK_FAQ<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>
</div></div></blockquote></div><br>