Hi Thomas,

I checked my code again and found where the issue comes from. The code is 
correct but their sequence needs to be changed. 

In the step of connecting DataStorage to render, MITK will update the 
m_CurrentWorldGeometry2D with default value, so the step of set up a 2D 
geometry in renderer must appear behind the DataStorage connection.

Thanks anyway

Li
________________________________________
发件人: Liu, Li [[email protected]]
发送时间: 2012年4月30日 16:38
收件人: Kilgus, Thomas; [email protected]
主题: [mitk-users] 答复:  spatial placement of slice in mitk::ImageVtkMapper2D

Hi Thomas,

I only want to rendering 2D image now, so I think it is good for me. Arbitrary 
reslicing is absolutely useful for me in future design and I am looking forward 
to seeing it.

A simple question about the rendering, I can 2D view of volume data, but it is 
not what I set up in Geometry of BaseRenderer. Now the view is  always the 
first slice in Transversal direction. I have read several discussions and 
introduction, but no clue to continue. Can you give me some advices?

Here is what I did in my code:

1. New Qmitk render window
 renderWindow = new QmitkRenderWindow();

2. Load in 3D volume data to MITK Data Node (Volume data size is 309*547*478)
nodeReader = mitk::DataNodeFactory::New();
nodeReader->SetFileName(infilename);
nodeReader->Update();

node = mitk::DataNode::New();
node = nodeReader->GetOutput();

3. New imageVtkMapper
vtkMapper = mitk::ImageVtkMapper2D::New();
vtkMapper->SetDefaultProperties(node,renderWindow->GetRenderer());

4. Initialize a plane and set up a 2D geometry (I am sure 200 is inside of 
volume data)
planeGeo = mitk:: PlaneGeometry::New();
planeGeo->InitializeStandardPlane(node->GetData()->GetGeometry(),mitk::PlaneGeometry::PlaneOrientation::Transversal,200);

5. Set up renderer geometry (It will use 
mitk::BaseRenderer::SetCurrentWorldGeometry2D)
renderWindow->GetRenderer()->SetWorldGeometry(planeGeo);

6. Set up data note mapper
node->SetMapper(mitk::BaseRenderer::Standard2D,vtkMapper);

7. Connect Data Storage to renderer
storage=mitk::StandaloneDataStorage::New();
storage->Add(node);
renderWindow->GetRenderer()->SetDataStorage(storage);

8. Update renderer
mitk::RenderingManager::GetInstance()->RequestUpdateAll();

9. show rendering window
renderWindow->show();

Thanks

Li

________________________________________
发件人: Kilgus, Thomas [[email protected]]
发送时间: 2012年4月27日 3:43
收件人: Liu, Li; [email protected]
主题: AW: [mitk-users] spatial placement of slice in mitk::ImageVtkMapper2D

Hi Li,

if you set up the geometry of the 2D slice of the corresponding renderer 
correctly (see mitk::BaseRenderer::SetCurrentWorldGeometry2D(Geometry2D* 
geometry2d
)), the current implementation of the ImageVtkMapper2D will compute the extent 
for your arbitrary slice internally. This happens in the method 
CalculateClippedPlaneBounds.


Note: I would rather not recommend to use this mapper, which is meant for 
rendering, as a filter. We are currently working on a filter class performing 
arbitrary reslicing. It is almost ready for being merged into the master.

Regards,
Thomas

________________________________________
Von: Liu, Li [[email protected]]
Gesendet: Dienstag, 24. April 2012 01:01
An: [email protected]
Betreff: [mitk-users] spatial placement of slice in mitk::ImageVtkMapper2D

Hi All,

I am trying to use ImageVtkMapper2D to cut a 2D slice from 3D volume data. But 
I got a question here after quickly browsing the 
ImageVtkMapper2D::GenerateDataForRenderer, it seems this function requires user 
to set up the 2D geometry of slice, like extent, origin, plane vector etc. In 
contrast, the vtkImageReslice only needs user inputs the vector of plane and a 
point that the plane passes through in its example code.

If I don't compute slice extent, I think the ImageVtkMapper2D can not work like 
I expect. If slice vector is aligned to axial, coronal or sagittal direction, 
it is easy to know the extent of slice, but for any others, it needs additional 
coding to get extent. My question is if MITK can get 2D slice that is bounded 
by 3D volume geometry when only imputing plane vector and a point that plane 
passes through?

Thanks.

Li


------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to