[vtkusers] vtkImageReslice

Massinissa Bandou Massinissa.Bandou at USherbrooke.ca
Wed Jul 17 16:48:25 EDT 2013


Hi VTK!

I have a 3D image 512x512x512 (16 bits littleEndian, signed short) and
sometime, I'm getting this error even if I make sure all my pointers are
deleted:

*vtkShortArray[0AC004B8]: Unable to allocate 134217728 elements of size...* 
after reader->Update();

I'm using vtkGPUVolumeRayCastMapper to render the volume but It's hard to
interact with it, very slow mouse movement. So I decided to use
vtkImageReslice to reduce the size. the following code is cutting my volume
instead of resampling. can anyone help me how I can keep the whole volume
and reduce the number of slices by half? thank you for your help! 



        vtkSmartPointer<vtkImageReader> reader =
vtkSmartPointer<vtkImageReader>::New(); 
	reader->SetFileName(file.toStdString().c_str());
	reader->SetFileDimensionality(3);
	reader->SetDataExtent(0,511,0,511,0,511);
	reader->SetDataSpacing(0.145, 0.145,0.145);
	reader->SetDataByteOrderToLittleEndian();
	reader->SetDataScalarTypeToShort();
	reader->Update();

	vtkSmartPointer<vtkImageReslice> reslice =
vtkSmartPointer<vtkImageReslice>::New();
	reslice->SetOutputExtent(0,255, 0,255, 0,255);
	reslice->SetOutputSpacing(0.145,0.145,0.145);
	reslice->SetInputConnection(reader->GetOutputPort());
	reslice->SetOutputDimensionality(3);
	reslice->SetInterpolationModeToCubic();
	reslice->AutoCropOutputOff();
	reslice->SetResliceAxesOrigin(0,0,0);
	reslice->Update();


Massi



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



More information about the vtkusers mailing list