[vtkusers] How Extract Image From vtkImagePlaneWidget

Mathieu Coursolle mcoursolle at rogue-research.com
Fri Mar 23 10:21:20 EDT 2007


Hi,

You can extract the images to get a vtkImageData using the
following steps:

	// Create a surface to extract the plane content.
	vtkPolyData* surface = vtkPolyData::New();
	widget->GetPolyData(surface);
	
	// Retrieve the image on the plane.
	vtkImageData* imageData = widget->GetResliceOutput();
	
	// Create a filter to extract the part of the image on the plane.
	vtkImageReslice* slicer = vtkImageReslice::New();
	slicer->SetInput(imageData);
	slicer->SetInformationInput(imageData);
	slicer->SetAutoCropOutput(TRUE);

 vtkImageData* result = slicer->GetOutput();

Mathieu

>Hello, I want to extract the images stemming from the
>VtkImagePlaneWidget. It is possible to obtain that without uses
>vtkrenderwindow. It is possible to extract the plane as stream of data?
> 
>Thanks' in advance.
> 
>Best regards, Francois Louis.




More information about the vtkusers mailing list