<br><br>Hi Xiangn,<br><br><br>In order to write the track out into a binary image,<br>you will have to discretize the continous index.<br><br><br>As described in my previous email,<br>you can do this with the following code:<br>
<br> ImageType::IndexType index;<br><br> index.CopyWithRound( continousIndex );<br><br> image->SetPixel( index, tractValue );<br><br><br>Note that, <br>by doing this, you are losing information<br>on the actual position of the tract.<br>
<br><br><br> Regards,<br><br><br> Luis<br><br><br>---------------------------------------------<br><div class="gmail_quote">On Wed, Jul 1, 2009 at 3:53 PM, Xiang Hao <span dir="ltr"><<a href="mailto:haoxiang@yahoo.cn">haoxiang@yahoo.cn</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 can compute the features at the continuous index by following your suggestion. Thank you again. Now I want to save the tract(path) in an binary image, but I have a problem about how to write an value in a continuous index.<br>
<br>Cheers,<br>Xiang<div><div></div><div class="h5"><br><br><div class="gmail_quote">On Tue, Jun 30, 2009 at 12:41 PM, Xiang Hao <span dir="ltr"><<a href="mailto:haoxiang@yahoo.cn" target="_blank">haoxiang@yahoo.cn</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;">
Great, Luis. Thank you again. I appreciate it very much.<br><br>Cheers,<br>Xiang<div><div></div><div><br><br><div class="gmail_quote">On Tue, Jun 30, 2009 at 11:30 AM, Luis Ibanez <span dir="ltr"><<a href="mailto:luis.ibanez@kitware.com" target="_blank">luis.ibanez@kitware.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;"><br>Hi Xiang,<br><br>If you need to evaluat the image at ContinousIndex positions,<br>or at Point positions you will need to use an Interpolator.<br>
<br>Something like<br><br> interpolator->SetImage( image );<br> interpolator->Evaluate( point );<br>
interpolator->Evaluate( continuousIndex );<br><br>For a list of ITK Interpolators, please look at:<br><a href="http://public.kitware.com/Insight/Doxygen/html/group__ImageInterpolators.html" target="_blank">http://public.kitware.com/Insight/Doxygen/html/group__ImageInterpolators.html</a><br>
<br><br>Note however, that, depending on how you track<br>fibers, what you may actually need is to compute<br>features at those points (or continuous indices)<br>and therefore you may have to use ImageFunctions<br>there.<br>
<br>For example:<br><br>itkGaussianBlurImageFunction.h<br>itkGaussianDerivativeImageFunction.h<br><br><br><br> Regards,<br><br><br> Luis<br><br><br><br><div class="gmail_quote">----------------------------------------------------------------------<div>
<div></div><div><br>
On Tue, Jun 30, 2009 at 1:22 PM, Xiang Hao <span dir="ltr"><<a href="mailto:haoxiang@yahoo.cn" target="_blank">haoxiang@yahoo.cn</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>Thank you so much, Luis. I will try it, and BTW, as I remember, there is a problem about setPixel() and getPixel() method while I am using the ContinuousIndex. It said it cannot find the corresponding method. Anyway, I will try your method and try to make it work.<br>
<br>Thank you again,<br>Xiang<div><div></div><div><br><br><div class="gmail_quote">On Tue, Jun 30, 2009 at 10:29 AM, Luis Ibanez <span dir="ltr"><<a href="mailto:luis.ibanez@kitware.com" target="_blank">luis.ibanez@kitware.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;">
<br><br>Hi Xian,<br><br>If you need sub-pixel locations for the points of the fibers,<br>yes, it makes sense to use ContinuousIndex instead of <br>Indexes for representing the location of fibers centers.<br><br>That said, it may be preferable to use itk::Point<> since<br>
that will take into account also the pixel spacing, image <br>origin, and image orientation, and you will be able to<br>do things like overlapping a visualization of the fibers<br>with the original image.<br><br>A) If you need to convert Index to ContinousIndex you <br>
can use the method:<br><br> Constructor<br><br> IndexType index;<br> ContinuousIndexType cindex( index );<br><br>B) In order to convert Continuous index to Index you<br> can use the method CopyWithRound()<br>
<br> index.CopyWithRound( continousIndex )<br><br>C) In order to convert an index into a physical point<br> and back you can use the image methods<br><br> TransformIndexToPhysicalPoint( index, point );<br> TransformPhysicalPointToIndex(point, index );<br>
<br><br><br> Regards,<br><br><br><br> Luis<br><br><br><br>----------------------------------------------------------------------------------------------<br><div class="gmail_quote"><div><div></div><div>
On Sun, Jun 28, 2009 at 2:42 PM, Xiang Hao <span dir="ltr"><<a href="mailto:haoxiang@yahoo.cn" target="_blank">haoxiang@yahoo.cn</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div>Hi,<br><br>I am trying to write a tractography program. <br>
Now I use discrete index:<br><br>
Dimension =3;<br clear="all">typedef int OutputPixelType;<br>typedef itk::Image< OutputPixelType, Dimension > OutputImageType;<br>
OutputImageType::IndexType pixelIndex;<br><br>So
now the pixelIndex is discrete index and I want to change it to
continuous index. I know there is an ContinuousIndex class in ITK. I
wonder whether I should use this class and how to use it in order to
change the index to continuous index.<br>
<br><br>-- <br>Cheers,<br><font color="#888888">Xiang<br>
</font><br clear="all"><br>-- <br>Cheers,<br><font color="#888888">Xiang<br>
</font><br></div></div>_____________________________________<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>
<br></blockquote></div><br>
</blockquote></div><br><br clear="all"><br></div></div>-- <br>Cheers,<br><font color="#888888">Xiang<br>
<div style="height: 32px; width: 32px;"><img></div>
</font></blockquote></div></div></div><br>
</blockquote></div><br><br clear="all"><br></div></div>-- <br>Cheers,<br><font color="#888888">Xiang<br>
</font></blockquote></div><br><br clear="all"><br></div></div>-- <br>Cheers,<br><font color="#888888">Xiang<br>
<div style="height: 32px; width: 32px;"><img></div>
</font></blockquote></div><br>