[vtkusers] How do I convert a vtkExtractVOI to vtkDataset? or using in a vtkProbe

Nico Vermaas vermaas at astron.nl
Thu Apr 3 06:29:45 EST 2003


Hi,

I have a 'vtkImageData' that I 'clipped' with 'SetVOI' to get a smaller datacube.
The result is a 'vtkExtractVOI' that I can use in the graphics pipeline.

I want to use 'vtkProbeFilter' to 'shoot' a line through the dataset and draw an XYPlot. It works for my complete dataset (the 'vtkImageData'), but not for my clipped dataset (the 'vtkExtractVOI').

My problem is that 'probe->SetSource' requires a 'vtkDataset' and not a 'vtkExtractVOI'.
I tried this to cast it to 'vtkDataSet', but I get a 'segmentation fault' when I run.

probe->SetSource(this->ImageData);
//probe->SetSource((vtkDataSet*)this->myExtractVOI);

(a) is there a way to convert my 'vtkExtractVOI' back to a 'vtkImageData' or a 'vtkDataset'?
(b) Is there a way to let 'probe->SetSource' accept a 'vtkExtractVOI'?

Thanks,

Nico Vermaas





More information about the vtkusers mailing list