[vtkusers] How to Get rendered Volume Slices?

陆阳 thuluyang at gmail.com
Sun Sep 19 04:47:15 EDT 2010


i have the exatly desire as finsher has...
i am waiting for the answeer to...
best regards

2010/9/19 finsher <zhuyinghua01 at gmail.com>

>
> Hi all,
> 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?
>
> 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();
> ....
> --
> View this message in context:
> http://vtk.1045678.n5.nabble.com/How-to-Get-rendered-Volume-Slices-tp2845243p2845243.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>



-- 
陆阳
清华大学医学院生物医学工程系
Yang Lu
Department of Biomedical Engineering,
School of Medicine, Tsinghua University
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100919/b6693356/attachment.htm>


More information about the vtkusers mailing list