[vtkusers] vtkExtractVOI

Massinissa Bandou Massinissa.Bandou at USherbrooke.ca
Mon Aug 5 11:07:50 EDT 2013


Hello everyone!!

I tried to use vtkExtractVOI to extract a volume of interest with setVOI()
and view the result with vtkGPUVolumeRayCastMapper but it doesn't display
anything. On the other hand, if I use SetCroppingRegionPlanes() from
vtkGPUVolumeRayCastMapper, it works. What is wrong with vtkExtractVOI in my
code? Do I need to specify something? I really want to use vtkExtractVOI
because I want to extract the subvolume as vtkImageData*.

I'll appreciate your help!!!!! thx! 

int main(int argc, char *argv[])
{
        vtkSmartPointer<vtkExtractVOI> extractVOI =
vtkSmartPointer<vtkExtractVOI>::New();
	extractVOI->SetInputConnection(img->GetProducerPort());
	extractVOI->SetVOI(0,10,0,10,0,10);
	extractVOI->Update();

vtkSmartPointer<vtkGPUVolumeRayCastMapper> volumeMapper =
vtkSmartPointer<vtkGPUVolumeRayCastMapper>::New();
volumeMapper->SetInputConnection(extractVOI->GetOutputPort());
volumeMapper->AutoAdjustSampleDistancesOff();

	//volumeMapper->CroppingOn();
	//volumeMapper->SetCroppingRegionPlanes(0,10,0,10,0,10);
	//volumeMapper->SetCroppingRegionFlagsToSubVolume();

vtkSmartPointer<vtkVolumeProperty> volumeProperty =
vtkSmartPointer<vtkVolumeProperty>::New();
vtkSmartPointer<vtkPiecewiseFunction> compositeOpacity =
vtkSmartPointer<vtkPiecewiseFunction>::New();
compositeOpacity->AddPoint(0,0);
compositeOpacity->AddPoint(255,1);
volumeProperty->SetInterpolationTypeToLinear();
volumeProperty->SetScalarOpacity(compositeOpacity);
volumeProperty->ShadeOn();
vtkSmartPointer<vtkVolume> volume = vtkSmartPointer<vtkVolume>::New();
volume->SetMapper(volumeMapper);
volume->SetProperty(volumeProperty);

....
...
renderer->AddVolume(volume);

}




--
View this message in context: http://vtk.1045678.n5.nabble.com/vtkExtractVOI-tp5722484.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list