Hi Hongzhi,

the size/geometry of the slice is fine (you can check this by Reinit on the 
slice in the Data Manager. However, the standard PlaneGeometry mappers do not 
work as you may expect. They use the reference geometry bounds or the world 
bounds to cut the planes in shape. You could try to write your own 
PlaneGeometry mapper(s) for your PlaneGeometry node or try a different approach 
which requires less work, e.g., use a rectangular PlanarFigure to highlight the 
ROI in your image slice.

Best,
Stefan

From: Hongzhi Lan [mailto:hong...@stanford.edu]
Sent: Dienstag, 22. März 2016 07:55
To: mitk-users@lists.sourceforge.net
Subject: [mitk-users] Showing an arbitrary reslice of 3D image in 
QmitkSliceWidget


Hello everyone,


I'm tring to show an arbitrary reslice of 3D image in QmitkSliceWidget and also 
3D view in QmitkStdMultiWidget at the same time.
The orientation of the reslice looks fine, but in QmitkSliceWidget and 3D view 
QmitkStdMultiWidget the sizes are not right (see the attachments). It should be 
a small square(40x40) (see the source code below).
I really need some help on thie issue. I'm using MITK 2015.05.2 and Ubuntu 14.

Thanks!

Hongzhi

The code is as below:
======================

    QmitkSliceWidget* m_SliceWidget=new QmitkSliceWidget(parent);
    m_SliceWidget->SetDataStorage(dataStorage);

    mitk::PlaneGeometry::Pointer planegeometry = mitk::PlaneGeometry::New();
    mitk::Point3D origin;
    mitk::Vector3D right, bottom, normal;

    mitk::FillVector3D(origin, 1.0, 1.0, 1.0);
    mitk::FillVector3D(right,  1.0, 0, 0);
    mitk::FillVector3D(bottom,  0, 1.0, 1.0);

    planegeometry->InitializeStandardPlane(40,40, right.GetVnlVector(), 
bottom.GetVnlVector());
    planegeometry->SetOrigin(origin);

    mitk::SlicedGeometry3D::Pointer slicedGeo3D=mitk::SlicedGeometry3D::New();
    slicedGeo3D->InitializeSlicedGeometry(1);
    slicedGeo3D->SetPlaneGeometry(planegeometry,0);

    
slicedGeo3D->SetReferenceGeometry(node_image3D->GetData()->GetTimeGeometry()->GetGeometryForTimeStep(0));

    
m_SliceWidget->GetSliceNavigationController()->SetInputWorldGeometry3D(slicedGeo3D);
    
m_SliceWidget->GetSliceNavigationController()->SetViewDirection(mitk::SliceNavigationController::Original);
    m_SliceWidget->GetSliceNavigationController()->Update();

    
GetDataStorage()->Add(m_SliceWidget->GetRenderer()->GetCurrentWorldPlaneGeometryNode());

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
_______________________________________________
mitk-users mailing list
mitk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to