Hi Jochen,
Thanks for your response. I followed the link to
mitk::QmitkStdMultiWidget::AddDisplayPlaneSubTree(), you given me, but I can't
find the line that includes the mitk::Geometry2DDataVtkMapper3D.
I try to create the mapper and add it to the mitk::DataNode which holds the
image. I try the same with the node that contains the plane to map the image
onto it. Both doesn't work??? Can you tell me exactly, how the
mitk::Geometry2DDataVtkMapper3D should be used?
Best regards
Matthias Mucha
Dear list,
I want to visualize arbitrarily transformed 2D images in the 3D-render-window
without the widget planes. My idea is to create a mitk::Plane and then map the
image as texture onto it. To visualize the plane is no problem, but how I can
map the image onto the plane? Is the Geometry2DDataVtkMapper3D a good option
for that?
Many thanks!
Matthias Mucha
Here is my code to show the plane:
mitk::Plane::Pointer plane = mitk::Plane::New(); //instantiate
a new plane
//m_MITKSlice is a mitk::Image::Pointer
plane->GetGeometry()->SetBounds(m_MITKSlice->GetGeometry()->GetBounds());
plane->GetGeometry()->SetSpacing(m_MITKSlice->GetGeometry()->GetSpacing());
//set transformation
itk::Matrix<float> mat = itk::Matrix<float>();
mat.SetIdentity();
mat.GetVnlMatrix().set_column(0,
m_MITKSlice->GetGeometry()->GetAxisVector(0).Get_vnl_vector());
mat.GetVnlMatrix().set_column(1,
m_MITKSlice->GetGeometry()->GetAxisVector(1).Get_vnl_vector());
mat.GetVnlMatrix().set_column(2,
m_MITKSlice->GetGeometry()->GetAxisVector(2).Get_vnl_vector());
plane->GetGeometry()->GetIndexToWorldTransform()->SetMatrix(mat);
plane->GetGeometry()->Modified();
plane->GetGeometry()->TransferItkToVtkTransform();
//generate a new node to store the plane into the DataStorage.
mitk::DataNode::Pointer node = mitk::DataNode::New();
node->SetData(plane);
node->SetName("Selected Slice");
node->SetColor(1.0, 0.0, 0.0); //color = red
this->GetDefaultDataStorage()->Add(node);
//Update mitkRenderer...
--
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
--
GMX DSL: Internet-, Telefon- und Handy-Flat ab 19,99 EUR/mtl.
Bis zu 150 EUR Startguthaben inklusive! http://portal.gmx.net/de/go/dsl
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users