[vtkusers] about vtkImagePlaneWidget question

朱映华 zhuyinghua01 at gmail.com
Thu Sep 16 08:39:11 EDT 2010


Dear Lodron
Maybe i'm not expressed clearly.
i need to get the Maximum intensity projection(MIP) slices.
so I have a series of MR images.  I use these series to do MIP(or volume
render etc...).  when MIP rendering completed  I need to get the rendered
slices. if i use vtkResliceImage dor  imageplanewidget s the input data is
the voxel raw data, i got the  slices is the original image slices, not cut
from MIP volume slices.
so could you help me how to get the correct slices?

thank you.
best regards.

and below is my code :

//step 1: read raw image series data
vtkVolume16Reader* v16 =  vtkVolume16Reader::New();
v16->SetFilePrefix("d:\\aaa\\new\\a");
...
v16->Update();

//step.2: do MIP
vtkPiecewiseFunction *opacityTransferFunc = vtkPiecewiseFunction::New();
opacityTransferFunc->AddPoint(0.0, 0.0);
...
vtkColorTransferFunction *colorTransferFunc =
vtkColorTransferFunction::New();
colorTransferFunc->AddRGBPoint(0.0, 0.0, 0.0, 0.0);
...
volumeProperty = vtkVolumeProperty::New();
volumeProperty->SetColor(colorTransferFunc);
volumeProperty->SetScalarOpacity(opacityTransferFunc);

//step 3: set mip function and create volume data
vtkVolumeRayCastMIPFunction *mipFunc = vtkVolumeRayCastMIPFunction::New();
volumeMapper = vtkVolumeRayCastMapper::New();
volumeMapper->SetVolumeRayCastFunction(mipFunc);
volumeMapper->SetInput(v16->GetOutput());
volume = vtkVolume::New();
volume->SetMapper(volumeMapper);
volume->SetProperty(volumeProperty);
volume->Update();

//step.4: renderer volume show rendered window
render->AddVolume(volume);
renderWindow->Render();
...

//setp.5: get MIP slices
vtkImagePlaneWidget* planeWidget = vtkImagePlaneWidget::New();
...
*planeWidget->SetInput(v16->GetOutput()); <----i think this input data could
not be correct. but i don't know how ...*

//step.6 display the slices
imageViewer2->SetInput(planeWidget->GetResliceOutput());
renderWindowInteractor->Initialize();
imageViewer2->Render();
renderWindowInteractor->Start();
....

在 2010年9月16日 下午5:47,Lodron, Gerald <Gerald.Lodron at joanneum.at>写道:

>  I am not sure if i understand but if you want to create a 2D image and
> store it into a jpg you do not need any renderer.
>
> Then you should use the vtkResliceImage filter (which is implemented 3
> times into the vtkImagePlaneWidgets, one per axe). You only need to set the
> 3D image as input and specify the cut coordinates via a homogenious
> coordinate matrix. As output you get a 2D image which you can write with an
> imagefilewriter.
>
> If you want to use the imageplanewidget: There should be some Get functions
> to get direct access to the reslice filters (or its output), only pipe it to
> your writer...
> best regards
>
>  ------------------------------
> *Von:* 朱映华 [mailto:zhuyinghua01 at gmail.com]
> *Gesendet:* Donnerstag, 16. September 2010 11:14
> *An:* Lodron, Gerald; vtkusers at vtk.org; vtkusers-bounces at vtk.org
> *Betreff:* Re: [vtkusers] about vtkImagePlaneWidget question
>
>   Dear Lodron,
> Thanks for your help.
> I want to get the reconstructed slice data. i test the example mostly is
> about the get the voxel row slice data(not the reconstructed renderer data).
> and i want to get slices data and save data to special files such as
> dicom/bmp/jpg.
> how to get slices renderer pixel data?
>
> best regards.
> Yinghua.
>
> 在 2010年9月15日 下午10:53,Lodron, Gerald <Gerald.Lodron at joanneum.at>写道:
>
>>  Dear Yinghua
>>
>> Look at the examples in
>> http://www.vtk.org/doc/nightly/html/c2_vtk_e_3.html#c2_vtk_e_vtkImagePlaneWidget
>>
>> there you can see the most important parameters
>>
>> best regards
>>
>>  ------------------------------
>> *Von:* vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] *Im
>> Auftrag von *???
>> *Gesendet:* Mittwoch, 15. September 2010 14:16
>> *An:* vtkusers at vtk.org
>> *Betreff:* [vtkusers] about vtkImagePlaneWidget question
>>
>>   Hi friends.
>> i'm a new vtk developer.
>> i want to use vtkImagePlaneWidget to get the special angle plane
>> imagedata.
>> i want to know which parameters should i valued?
>> thanks
>> Yinghua.
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100916/9c071b5f/attachment.htm>


More information about the vtkusers mailing list