<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&lt; InputImageType, OutputImageType &gt; ResampleFilterType;<br>  ResampleFilterType::Pointer resample = ResampleFilterType::New();</p><p>  resample-&gt;SetInput( moving );<br>
  resample-&gt;SetTransform( transform );<br>  resample-&gt;SetSize( fixed-&gt;GetLargestPossibleRegion().GetSize() );<br>  resample-&gt;SetOutputOrigin(  fixed-&gt;GetOrigin() );<br>  resample-&gt;SetOutputSpacing( fixed-&gt;GetSpacing() );<br>
  resample-&gt;SetOutputDirection( fixed-&gt;GetDirection() );<br>  resample-&gt;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&lt; MeshType, MeshType, TransformType &gt; TransformMeshType;</p><p>  TransformMeshType::Pointer movingTransformMesh = TransformMeshType::New();<br>  movingTransformMesh-&gt;SetInput(movingMesh); <br>
  movingTransformMesh-&gt;SetTransform(transform);<br>  movingTransformMesh-&gt;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>