[Insight-users] coordinate conversion

Siavash Khallaghi siavashk at ece.ubc.ca
Tue Sep 10 11:45:18 EDT 2013


What is the format of your point set? Is it vtkPolyData?

Siavash

Petr Jilkine <petr.jilkine at cimtec-canada.ca> wrote:

>Hello,
>
>I have 2 images fixed and moving. I apply some linear transform to
>moving
>image
>to bring it to physical space of fixed image using ResampleImageFilter
>(see
>metacode)
>
>  typedef typename itk::ResampleImageFilter< InputImageType,
>OutputImageType > ResampleFilterType;
>  ResampleFilterType::Pointer resample = ResampleFilterType::New();
>
>  resample->SetInput( moving );
>  resample->SetTransform( transform );
>  resample->SetSize( fixed->GetLargestPossibleRegion().GetSize() );
>  resample->SetOutputOrigin(  fixed->GetOrigin() );
>  resample->SetOutputSpacing( fixed->GetSpacing() );
>  resample->SetOutputDirection( fixed->GetDirection() );
>  resample->SetDefaultPixelValue( zeroValue );
>
>I also have 2 point sets, one in fixed, another in moving image.
>I would like to resample moving point set in a similar way.
>For this I use (metacode)
>
>  typedef itk::TransformMeshFilter< MeshType, MeshType, TransformType >
>TransformMeshType;
>
>TransformMeshType::Pointer movingTransformMesh =
>TransformMeshType::New();
>  movingTransformMesh->SetInput(movingMesh);
>  movingTransformMesh->SetTransform(transform);
>  movingTransformMesh->Update();
>Probably I need to use an inverse transform instead.
>I guess if the points in point sets had world coordinates if would
>work.
>But coordinates of the points are wrt the center of corresponding
>image.
>Now I need to convert these local coordinates to world coordinates
>taking
>into account origin, spacing and direction matrix of the corresponding
>image.
>TransformMeshFilter seems a good candidate to do the job, but it is not
>clear
>how to pass origin, spacing and direction matrix to the filter.
>
>Coordinates conversion like this seems a standard problem and
>I guess there is a standard way to do it in ITK. However, so far
>I couldn’t find an appropriate ITK class/function.
>
>Any advice on this matter is really appreciated.
>
>Thanks,
>Peter Jilkine
>
>
>------------------------------------------------------------------------
>
>_____________________________________
>Powered by www.kitware.com
>
>Visit other Kitware open-source projects at
>http://www.kitware.com/opensource/opensource.html
>
>Kitware offers ITK Training Courses, for more information visit:
>http://www.kitware.com/products/protraining.php
>
>Please keep messages on-topic and check the ITK FAQ at:
>http://www.itk.org/Wiki/ITK_FAQ
>
>Follow this link to subscribe/unsubscribe:
>http://www.itk.org/mailman/listinfo/insight-users

-- 
Sent from my Android phone with K-9 Mail. Please excuse my brevity.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20130910/df9a3546/attachment.htm>


More information about the Insight-users mailing list