Hi Matthias,

Take a look at QmitkStdMultiWidget::AddDisplayPlaneSubTree() 
(http://docs.mitk.org/nightly-qt4/classQmitkStdMultiWidget.html#dc39ec0ecec0e5507c0f127e5bdab294).
 This is the code that creates the transversal/coronal/sagittal plane nodes. As 
you expected, Geometry2DDataVtkMapper3D is used.

Regards, 
 Jochen

> -----Ursprüngliche Nachricht-----
> Von: Matthias Mucha [mailto:[email protected]]
> Gesendet: Mittwoch, 7. Juli 2010 20:23
> An: [email protected]
> Betreff: [mitk-users] Map Image onto an arbitrarily transformed plane in 3D-
> window
> 
> 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
> 
> ------------------------------------------------------------------------------
> 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
------------------------------------------------------------------------------
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

Reply via email to