<br>Hi Dženan,<br><br>Excellent !,<br><br><br>Thanks for joining the Adopt a Bug program.<br><br>--<br><br>Regarding your question:<br><br>               ITK is still using CVS,<br><br><br>    ...I know, I know... <br>    but it was cool ten years ago...      :-)<br>
<br><br>   We will skip SVN and will migrate directly to git<br>   as part of the refactoring for ITK 4.0 that should<br>   start by the end of June.<br><br><br>   Other projects at Kitware have already migrating<br>   to git (in particular VTK and ParaView).<br>
<br><br>For details, please see:<br><a href="http://www.kitware.com/news/home/browse/ITK?2010_04_20&amp;An+Update+on+VTK%27s+Git+Conversion">http://www.kitware.com/news/home/browse/ITK?2010_04_20&amp;An+Update+on+VTK%27s+Git+Conversion</a><br>
<br><br><br>       Regards,<br><br><br>          Luis<br><br><br>------------------------------------------------------------<br><div class="gmail_quote">2010/5/27 Dženan Zukić <span dir="ltr">&lt;<a href="mailto:dzenanz@gmail.com">dzenanz@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi Luis,<br><br>Yes, I could fix it. And write access could come in handy in similar situations later on. But I thought you abandoned CVS in favor of something else (svn maybe)?<br>
<br>Regards,<br>Dženan<br><br><div class="gmail_quote">
2010/5/26 Luis Ibanez <span dir="ltr">&lt;<a href="mailto:luis.ibanez@kitware.com" target="_blank">luis.ibanez@kitware.com</a>&gt;</span><div><div></div><div class="h5"><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

Hi Dženan,<br>
<br>
You seem to have identified a real bug.<br>
<br>
Could you please log a bug entry at:<br>
<a href="http://public.kitware.com/Bug/my_view_page.php" target="_blank">http://public.kitware.com/Bug/my_view_page.php</a><br>
<br>
As you already pointed out, it looks like the source of the<br>
error is the manual computation of conversions between<br>
indexes and point coordinates in lines 442-446:<br>
<br>
    point = points.Value();<br>
<br>
    newpoint[0] = (point[0]-m_Origin[0]) * invspacing[0];<br>
    newpoint[1] = (point[1]-m_Origin[1]) * invspacing[1];<br>
    newpoint[2] = (point[2]-m_Origin[2]) * invspacing[2];<br>
<br>
which should have been something like:<br>
<br>
    image-&gt;TransformPhysicalPointToIndex( point, newpoint );<br>
<br>
or even better, we should rename the variable &quot;newpoint&quot;<br>
as &quot;newindex&quot; to be<br>
<br>
    image-&gt;TransformPhysicalPointToIndex( point, newpoint );<br>
<br>
<br>
Also, the filter has settings for the Origin and Spacing of the<br>
output image, but not for its direction.<br>
<br>
It needs something like<br>
<br>
     itkSetMacro(Direction, DirectionType);<br>
<br>
in the header file,<br>
<br>
and then in lines 194 in the .txx file<br>
<br>
    OutputImage-&gt;SetLargestPossibleRegion( region);     //<br>
    OutputImage-&gt;SetBufferedRegion( region );           // set the region<br>
    OutputImage-&gt;SetRequestedRegion( region );          //<br>
    OutputImage-&gt;SetSpacing(m_Spacing);         // set spacing<br>
    OutputImage-&gt;SetOrigin(m_Origin);   //   and origin<br>
<br>
we should add<br>
<br>
    OutputImage-&gt;SetDirection(m_Direction);<br>
<br>
<br>
----<br>
<br>
<br>
<br>
Would you be interested in adopting this bug ?<br>
<br>
<a href="http://www.itk.org/Wiki/ITK_10th_Anniversary_Activities/Adopt-A-Bug_1.0" target="_blank">http://www.itk.org/Wiki/ITK_10th_Anniversary_Activities/Adopt-A-Bug_1.0</a><br>
<br>
The adoption process<br>
includes full CVS write access to ITK      :-)<br>
<br>
<br>
<br>
If so, we will be happy to assist you in the<br>
process of fixing it.<br>
<br>
<br>
    Regards,<br>
<br>
<br>
        Luis<br>
<br>
<br>
------------------<br>
2010/5/26 Dženan Zukić &lt;<a href="mailto:dzenanz@gmail.com" target="_blank">dzenanz@gmail.com</a>&gt;:<br>
<div><div></div><div>&gt; Update: by setting transform matrices to identity in order to experiment<br>
&gt; with them, I notices that my code for using<br>
&gt; DeformableMesh3DFilter was not wrong, but that filter does not respect<br>
&gt; direction cosines either. With identity cosines it worked without weird<br>
&gt; deformations I was experiencing with sagittal images.<br>
&gt; And since many (most?) filters which deal with images ignore direction<br>
&gt; cosines, again we come to the need of having a filter which will reorient<br>
&gt; image pixels in order to have identity cosines matrix (DICOM LPS<br>
&gt; orientation, ITK RAI orientation). And creating this filter does not have to<br>
&gt; be considered admitting &quot;ITK is not perfect&quot;, it can be considered as a<br>
&gt; stopgap measure until all filters use TransformPhysicalPointToIndex and<br>
&gt; other built-in transformation routines instead of custom (and incomplete)<br>
&gt; transformation code (such as in TriangleMeshToBinaryImageFilter).<br>
&gt; Regards,<br>
&gt; Dženan<br>
&gt; 2010/5/26 Dženan Zukić &lt;<a href="mailto:dzenanz@gmail.com" target="_blank">dzenanz@gmail.com</a>&gt;<br>
&gt;&gt;<br>
&gt;&gt; Hi everyone!<br>
&gt;&gt; While wrestling with DeformableMesh3DFilter, I wanted to create binary<br>
&gt;&gt; mask of my initial mesh (so I could use it with examples), but I ran into a<br>
&gt;&gt; problem. TriangleMeshToBinaryImageFilter is not designed to produce images<br>
&gt;&gt; with direction cosines matrix different from identity matrix. When I supply<br>
&gt;&gt; it with such an image and mesh which is valid with respect to ITK&#39;s physical<br>
&gt;&gt; coordinate handling routines (TransformPhysicalPointToContinuousIndex and<br>
&gt;&gt; friends), it crashes.<br>
&gt;&gt; typedef<br>
&gt;&gt; itk::TriangleMeshToBinaryImageFilter&lt;MeshType,VisualizingImageType&gt;<br>
&gt;&gt; MeshFilterType;<br>
&gt;&gt; MeshFilterType::Pointer meshFilter = MeshFilterType::New();<br>
&gt;&gt; meshFilter-&gt;SetInfoImage(visualizing); //TransformMatrix = 0 1 0<br>
&gt;&gt; -0.0939968 0 -0.995573 -0.995573 0 0.0939968<br>
&gt;&gt; meshFilter-&gt;SetInput(mesh);<br>
&gt;&gt; meshFilter-&gt;Update(); //crashes<br>
&gt;&gt; For usage in examples, I can edit my transform matrix in .mha files and<br>
&gt;&gt; set it to identity, but what about normal usage? Is there some quick (and<br>
&gt;&gt; possibly dirty) way to get this right, or do I have to do all the math on<br>
&gt;&gt; paper in order to transform between representations with and without<br>
&gt;&gt; direction cosines?<br>
&gt;&gt; Thanks,<br>
&gt;&gt; Dženan<br>
&gt;<br>
</div></div>&gt; _____________________________________<br>
&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;<br>
&gt; Visit other Kitware open-source projects at<br>
&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;<br>
&gt; Kitware offers ITK Training Courses, for more information visit:<br>
&gt; <a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br>
&gt;<br>
&gt; Please keep messages on-topic and check the ITK FAQ at:<br>
&gt; <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
&gt;<br>
&gt;<br>
</blockquote></div></div></div><br>
</blockquote></div><br>