[Insight-users] Reading Transform using TransformFileReader
Lars Nygard
lnygard at yahoo.com
Mon May 28 18:20:51 EDT 2007
Hi Vince,
Thanks for the info. Maybe you can clear up another thing. Ive been trying to set
the RotationMatrix manually but I get an error about the rotation matrix not being
orthogonal. Ive tried computing the cross product to make sure they're orthogonal
but Im still getting the error.
Is this something that you've come across? and is there a way to get around
this condition?
regards,
Lars
----- Original Message ----
From: "Magnotta, Vincent A" <vincent-magnotta at uiowa.edu>
To: Lars Nygard <lnygard at yahoo.com>; insight-users at itk.org
Sent: Monday, May 28, 2007 12:24:35 PM
Subject: RE: [Insight-users] Reading Transform using TransformFileReader
Lars,
This example does not use a TransformFileWriter. Instead it is writing the transform using the SpatialObjectWriter. The code for this is on line 1138 of guiMainImplementation.cxx for this application. You will want to use a SpatialObjectReader and follow the code in this method to read the transform from disk.
Vince
----------------------
Assistant Professor
Department of Radiology
0453-D JCP
200 Hawkins Drive
Iowa City, IA 52242
E-mail: vincent-magnotta at uiowa.edu
Phone: 319-356-8255 Fax: 319-353-6275
Website: http://www.radiology.uiowa.edu
-----Original Message-----
From: insight-users-bounces+vincent-magnotta=uiowa.edu at itk.org on behalf of Lars Nygard
Sent: Sun 5/27/2007 5:00 PM
To: insight-users at itk.org
Subject: [Insight-users] Reading Transform using TransformFileReader
Hi all,
If anybody can help me with this, id really appreciate it. I have a
transform file (.tfm) which I obtained from the LandmarkInitializedMutualInformationRegistration
application. Now I want to use this transform in my own application without
having to enter in the matrix and so on. I tried to use the TransformFileReader
but when I update the transform reader I get a error (window saying abort, retry or cancel).
Here's the code I use:
typedef itk::TransformFileReader TransformReaderType;
TransformReaderType::Pointer transformreader = TransformReaderType::New();
transformreader->SetFileName( "GoldenTransform.tfm" );
transformreader->Update();
And here's the transform file:
ObjectType = Scene
NDims = 3
NObjects = 1
ObjectType = Group
NDims = 3
Color = 1 0 0 1
BinaryData = False
TransformMatrix = 0.999994 -0.000926597 0.00323312 0.000938676 0.999993 -0.00373678 -0.00322963 0.00373979 0.999988
Offset = 22.6712 25.3394 27.1312
CenterOfRotation = 106.858 109.269 58.7379
ElementSpacing = 1 1 1
EndGroup =
regards,
Lars Nygard
_________________________________________________________
Alt i én. Få Yahoo! Mail med adressekartotek, kalender og
notisblokk. http://no.mail.yahoo.com
_______________________________________________
Insight-users mailing list
Insight-users at itk.org
http://www.itk.org/mailman/listinfo/insight-users
_________________________________________________________
Alt i én. Få Yahoo! Mail med adressekartotek, kalender og
notisblokk. http://no.mail.yahoo.com
More information about the Insight-users
mailing list