Hi Li,


mitk::PlaneGeometry::InitializePlane is right, but you have to make sure that 
it actually is a worldGeometry. As these have some special characteristic you 
have do something like this:





mitk::PlaneGeometry::Pointer obliquePlane = mitk::PlaneGeometry::New();

obliquePlane->InitializeStandardPlane(planeSizeX, planeSizeY, spacing, 
mitk::PlaneGeometry::Sagittal, zPosition, true, false);//or one of the other 
initialize mehtods

obliquePlane->ChangeImageGeometryConsideringOriginOffset(true);



origin = obliquePlane->GetOrigin();

normal = obliquePlane->GetNormal();





normal.Normalize();



origin += normal * spacingInDerectionOfNormal  * 0.5;



obliquePlane->SetOrigin(origin);

//that’s the thing about the worldGeometries, they are surrounding the pixel in 
two directions but are located in center of the third.

//you have to do this after the initialization, if you are constructing one 
from scratch, as an plane is not worldGeometry.



mitk::Vector3D rotationVector;

rotationVector[0] = 0.2;

rotationVector[1] = 0.4;

rotationVector[2] = 0.62;



float degree = 37.0;

//here you have calculate the rotation you need, to define the oblique plane



mitk::RotationOperation* op = new mitk::RotationOperation(mitk::OpROTATE, 
obliquePlane->GetCenter(), rotationVector, degree);

obliquePlane->ExecuteOperation(op);

delete op;





Also the origin, the spacing and the size/bounding box should be considered to 
be right (proper).



But instead if want to reslice at what the display is showing you can also 
retrieve a worldGeometry from the renderer.

I recommend the second version.





The workflow with the filter is:



mitk::ExtractDirectedPlaneImageFilterNew::Pointer extractFilter = 
mitk::ExtractDirectedPlaneImageFilterNew::New();

extractFilter::SetInput(yourVolume);

extractFilter::SetCurrentWorldGeometry(yourPlane);

extractFilter:: SetActualInputTimestep(yourTimeStep); //if you are dealing with 
4D images



extractFilter::Update();



Image::Pointer slice = newExtractor->GetOutput();





That’s it. Now You can use the slice.

I hope it helps.





Best Regards



Tobi







>-----Ursprüngliche Nachricht-----

>Von: Liu, Li [mailto:[email protected]]<mailto:[mailto:[email protected]]>

>Gesendet: Mittwoch, 7. März 2012 05:54

>An: Schröder, Tobias

>Cc: [email protected]<mailto:[email protected]>

>Betreff: 答复: [mitk-users] extract 2D slice from a 3D image volume along 
>arbitrary directions



>Hi Tobi,



>Thanks for your quick reply. Here are some questions about your answer.



>What is a proper initialization for PlaneGeometry? I think you mean 
>mitk::PlaneGeometry::InitializePlane, right?



>Setting the position of plane is through 
>mitk::BaseRenderer::SetCurrentWorldGeometry2D or 
>mitk::ExtractDirectedPlaneImageFilterNew::SetCurrentWorldGeometry2D?



>Now, I load the volume data into mitk::StandaloneDataStorage, but how can I 
>set volume data as the input of ExtractDirectedPlaneImageFilterNew.



>Thanks



Li



________________________________________

发件人: Schröder, Tobias [[email protected]]

发送时间: 2012年3月6日 2:11

收件人: Liu, Li; 
[email protected]<mailto:[email protected]>

主题: Re: [mitk-users] extract 2D slice from a 3D image volume along arbitrary 
directions



Hi Li,



there is a mitk class called ExtractDirectedPlaneImageFilterNew which meets 
your needs.

A PlaneGeometry specifies the axes where to reslice at. The plane can be 
arbitrary oriented and is set via SetCurrentWorldGeometry2D.

So just initialize a proper PlaneGeometry and set it together with your volume 
as the input for the filter.



If this won't help provide me some further infos.



Regards



Tobi







>Von: Liu, Li [mailto:[email protected]]<mailto:[mailto:[email protected]]>

>Gesendet: Montag, 5. März 2012 20:14

>An: [email protected]<mailto:[email protected]>

>Betreff: [mitk-users] extract 2D slice from a 3D image volume along arbitrary 
>directions



>Hi,



> I am new to MITK and got a problem. Currently, I am using MITK to construct a 
> platform to implement extract arbitrary 2D slice from a 3D image volume (raw 
> data format). I looked at the tutorial examples and ext app and all of them 
> are only to extract 2D slice along transversal, sagittal and coronal 
> direction. For me, they are x,y,z axes. If I want to extract 2D slices along 
> other directions than transversal, sagittal and coronal direction, how can I 
> do that?



>Thanks



>Li





------------------------------------------------------------------------------

>Try before you buy = See our experts in action!

>The most comprehensive online learning library for Microsoft developers is 
>just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro 
>Style Apps, more. Free future >releases when you subscribe now!

>http://p.sf.net/sfu/learndevnow-dev2

_______________________________________________

>mitk-users mailing list

>[email protected]<mailto:[email protected]>

>https://lists.sourceforge.net/lists/listinfo/mitk-users

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to