Hello,

I saw in MITK code that in order to transform a Surface Data Node, you do
it like this:

1) To get the IndexToWorldTransform of the node I want to transform:
mitk::AffineTransform3D::Pointer originalTransform = surfaceToTransform->
GetData()->GetGeometry()->GetIndexToWorldTransform();
2) To concatenate the "originalTransform" with the one I want to apply,
let's call it "registrationTransformation"
originalTransform->Compose(registrationTransformation);
3) Then save the result in a new Transformation and
mitk::AffineTransform3D::Pointer newTransform = mitk::AffineTransform3D::New();
//create new image transform... setting the composed directly leads to an
error
itk::Matrix<mitk::ScalarType, 3, 3> rotationFloatNew = originalTransform->
GetMatrix();
itk::Vector<mitk::ScalarType, 3> translationFloatNew = originalTransform->
GetOffset();
newTransform->SetMatrix(rotationFloatNew);
newTransform->SetOffset(translationFloatNew);
4) To set this new transform to the IndexToWorldTransform of the Node:
surfaceToTransform->GetData()->GetGeometry()->SetIndexToWorldTransform
(newImageTransform);

My question is: If I want to undo the transformation, let's say to come
back to the original IndexToWorldTransform, the only way is to save it into
a new variable before modifying its values? But If I have to work with many
transformed objects, saving all its original transformations would be the
correct approach?

And another topic related with this. Very simple example: I have a
vtkConeSource created into a mitkSurface stored in a DataNode. If I operate
on its Geometry and apply mitk::Operations over the cone node it works
perfectly. BUT, if I want to use any vtk filters and operate with the cone
vtkPolyData, it has still the original transformation. So I have to apply
vtkTransform appart from mitk::Operation to the polydata to be able to use
it... Is that OK?? It seems to me that I am duplicating efforts...

Thank you very much in advance!
Best,

Rocío
-- 

Rocío López Velazco

*SimbioSYS** group, BCN MedTech*

*UniversityPompeu Fabra*




*Department of Information and Communication Technologies Roc Boronat, 122
(Tànger Building),  08018 Barcelona                    Office 55 119
https://bcn-medtech.upf.edu/ <https://bcn-medtech.upf.edu/>*
_______________________________________________
mitk-users mailing list
mitk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to