[Insight-users] Applying a transform to the orientation/origin of an image

Johnson, Hans J hans-johnson at uiowa.edu
Mon Feb 7 10:49:16 EST 2011


We do this all the time in our BRAINSFit program
http://www.nitrc.org/projects/multimodereg.

We wrote an Insight-Journal article and an ITK filter for doing this.

http://www.insight-journal.org/browse/publication/770

Hans


On 2/7/11 8:56 AM, "max power" <zouookmoetenwerken at gmail.com> wrote:

>Hi all,
>
>I'm trying to transform an image based on a rigid euler 3d transform
>that is generated by our code by matching some landmarks.  Normally
>I'd resample, but in this case, I would like to just 'impose' this
>transform onto the orientation of the image, so that I can use it
>in-place.
>
>My guess is that ChangeInformationImageFilter is the key component
>here, but I'm not 100% sure that I understand all the intrinsics of
>applying a transform to both the origin/center as well as the
>directions of an image.
>
>Lets assume I've succesfully built a VersorRigid3DTransform transform,
>by feeding a number of landmark points in _physical space_ to a
>LandmarkBasedTransformInitializer.
>
>Would something along these lines make sense:
>
>    typedef itk::ChangeInformationImageFilter< ImageType > ChangerType;
>    ChangerType::Pointer ch = ChangerType::New();
>    ch->SetInput( image );
>
>    ch->SetOutputOrigin( transform->GetTransform()->TransformPoint(
>image->GetOrigin() ));
>
>    ImageType::DirectionType dir = image->GetDirection() *
>transform->GetMatrix();
>    ch->SetOutputDirection( dir );
>
>    ch->SetChangeDirection( true );
>    ch->SetChangeOrigin( true );
>    ch->Update();
>
>I guess I'm on the right path, but applying the transform like above
>does not work, even after fiddling extensively with the order of the
>operations (or even applying inverses).  The resulting images do not
>seem to match my generated transform at all.
>
>I hope to find a way so that the following holds, where old_image is
>the untransformed image, and new_image is the output of the
>changeinformation filter:
>
>   transform.transformpoint( old_image.indextophysical( p ) ) ~=
>new_image.indextophysical( p )
>
>Any tips on how to approach this would be most welcome!
>
>Regards,
>Jorik
>_____________________________________
>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.html
>
>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



More information about the Insight-users mailing list