[vtkusers] How to Get rendered Volume Slices?

finsher zhuyinghua01 at gmail.com
Sat Sep 18 21:51:00 EDT 2010


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.



More information about the vtkusers mailing list