<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>