<html><head/><body><html><head></head><body>What is the format of your point set? Is it vtkPolyData?<br>
<br>
Siavash<br><br><div class="gmail_quote">Petr Jilkine <petr.jilkine@cimtec-canada.ca> wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div dir="ltr"><div>Hello,</div><div> </div><div>I have 2 images fixed and moving. I apply some linear transform to moving image <br />to bring it to physical space of fixed image using ResampleImageFilter (see metacode)</div>
<p> typedef typename itk::ResampleImageFilter< InputImageType, OutputImageType > ResampleFilterType;<br /> ResampleFilterType::Pointer resample = ResampleFilterType::New();</p><p> resample->SetInput( moving );<br />
resample->SetTransform( transform );<br /> resample->SetSize( fixed->GetLargestPossibleRegion().GetSize() );<br /> resample->SetOutputOrigin( fixed->GetOrigin() );<br /> resample->SetOutputSpacing( fixed->GetSpacing() );<br />
resample->SetOutputDirection( fixed->GetDirection() );<br /> resample->SetDefaultPixelValue( zeroValue );<br /> <br />I also have 2 point sets, one in fixed, another in moving image. <br />I would like to resample moving point set in a similar way. <br />
For this I use (metacode)</p><p> typedef itk::TransformMeshFilter< MeshType, MeshType, TransformType > TransformMeshType;</p><p> TransformMeshType::Pointer movingTransformMesh = TransformMeshType::New();<br /> movingTransformMesh->SetInput(movingMesh); <br />
movingTransformMesh->SetTransform(transform);<br /> movingTransformMesh->Update();</p><div>Probably I need to use an inverse transform instead.</div><div>I guess if the points in point sets had world coordinates if would work.<br />
But coordinates of the points are wrt the center of corresponding image. <br />Now I need to convert these local coordinates to world coordinates taking <br />into account origin, spacing and direction matrix of the corresponding image. <br />
TransformMeshFilter seems a good candidate to do the job, but it is not clear <br />how to pass origin, spacing and direction matrix to the filter.</div><p>Coordinates conversion like this seems a standard problem and <br />I guess there is a standard way to do it in ITK. However, so far <br />
I couldn’t find an appropriate ITK class/function.</p><p>Any advice on this matter is really appreciated.</p><p>Thanks,<br />Peter Jilkine<br /></p></div>
<p style="margin-top: 2.5em; margin-bottom: 1em; border-bottom: 1px solid #000"></p><pre style="white-space: pre-wrap; word-wrap:break-word; font-family: sans-serif; margin-top: 0px"><hr /><br />Powered by <a href="http://www.kitware.com">www.kitware.com</a><br /><br />Visit other Kitware open-source projects at<br /><a href="http://www.kitware.com/opensource/opensource.html">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.php">http://www.kitware.com/products/protraining.php</a><br /><br />Please keep messages on-topic and check the ITK FAQ at:<br /><a href="http://www.itk.org/Wiki/ITK_FAQ">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">http://www.itk.org/mailman/listinfo/insight-users</a><br /></pre></blockquote></div><br>
-- <br>
Sent from my Android phone with K-9 Mail. Please excuse my brevity.</body></html></body></html>