Yes, I am interested in a plain formula for those conversions. The code in ITK is very convoluted - optimized for performance not for clarity.<div><br></div><div>Dženan<br><br><div class="gmail_quote">On Mon, Jun 28, 2010 at 15:08, Vincent Garcia <span dir="ltr">&lt;<a href="mailto:Vincent.Garcia@sophia.inria.fr">Vincent.Garcia@sophia.inria.fr</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Thank you. The only problem here is that you have to check the source code to interpret the origin, spacing, and direction cosine value.<br>

It should be written into the programming guide, or at least somewhere. When you know the correct formula, the answer is straight forward.<br>
I&#39;ll try to write something about that in a next email if anyone wants to know the answer to my question.<br>
One more time, thank you!<br><font color="#888888">
<br>
Vincent</font><div><div></div><div class="h5"><br>
<br>
<br>
Dan Mueller wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Vincent,<br>
<br>
The following will convert an index in &quot;image&quot; coordinates to a<br>
physical point in &quot;world&quot; coordinates:<br>
    image-&gt;TransformIndexToPhysicalPoint( index, point );<br>
<br>
This function is specified in Common/itkImageBase.h<br>
<br>
HTH<br>
<br>
Cheers, Dan<br>
<br>
On 28 June 2010 09:48, Vincent Garcia &lt;<a href="mailto:Vincent.Garcia@sophia.inria.fr" target="_blank">Vincent.Garcia@sophia.inria.fr</a>&gt; wrote:<br>
  <br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi all,<br>
<br>
When you read a medical image (let&#39;s say 3D), you have a 3D matrix<br>
containing image data and some information about the position/orientation of<br>
the image in the world coordinates. Given the image coordinates (i,j,k), I&#39;d<br>
like to understand how to compute the corresponding world coordinates<br>
(x,y,z).<br>
I have access to some information from the itk::Image object:<br>
<br>
GetOrigin () : (vector) position of the first voxel in the world coordinates<br>
GetSpacing () : (vector) size of the voxels in mm<br>
GetDirection () : (matrix) direction cosine<br>
<br>
I&#39;ve tried to search on the documentation but I haven&#39;t found the way to use<br>
these vectors and matrix to compute the world coordinates.<br>
The formula should be very simple but I just can&#39;t found it.<br>
<br>
Many thanks,<br>
<br>
Vincent Garcia<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.html" target="_blank">http://www.kitware.com/products/protraining.html</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>
</blockquote>
_____________________________________<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.html" target="_blank">http://www.kitware.com/products/protraining.html</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>
</blockquote>
_____________________________________<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.html" target="_blank">http://www.kitware.com/products/protraining.html</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>
</div></div></blockquote></div><br></div>