[vtkusers] Memory problem while static MIP

Andreas Brüning mail-andi at web.de
Mon Jun 23 10:35:49 EDT 2008


Hello,

i implemented an orthogonal MPR like descriped one of  the vtk- medical examples for a stack of CT slices. Now i would like to enhance my system by displaying the same orthogonal MPR with a static maximum intensity projection(MIP). I found the vtkFixedPointVolumeRayCastMapper which works really good for a 3D- MIP. So i combined both and it works with small CT series. This is my code of the vtk-pipeline:

...

  	vtkImageReslice *vtkImageReslicer = vtkImageReslice::New();
	vtkImageReslicer->SetInput(m_vtkvolumedata);                           //vtkImageData comes from vtkImageImport
	vtkImageReslicer->SetOutputDimensionality(3);
	vtkImageReslicer->SetResliceAxes(vtkResliceAxes);
	vtkImageReslicer->SetInterpolationModeToLinear();
	
	vtkPiecewiseFunction *opacityTransferFunction = vtkPiecewiseFunction::New();
	opacityTransferFunction->AddPoint( m_dLevel- m_dWindow/2  , 0.0 );
	opacityTransferFunction->AddPoint( m_dLevel+ m_dWindow/2 , 1.0 );

	// Create a transfer function mapping scalar value to color (gray)
	vtkPiecewiseFunction *grayTransferFunction = vtkPiecewiseFunction::New();
	grayTransferFunction->AddSegment( m_dLevel- m_dWindow/2, 0.0 , m_dLevel+ m_dWindow/2, 1.0 );

	vtkVolumeProperty *mipProperty;

	mipProperty = vtkVolumeProperty::New();
	mipProperty->SetScalarOpacity( opacityTransferFunction );
	mipProperty->SetColor( grayTransferFunction );
	mipProperty->SetInterpolationTypeToLinear();

	vtkFixedPointVolumeRayCastMapper * volumeMapper =	vtkFixedPointVolumeRayCastMapper ::New();

	volumeMapper->SetBlendModeToMaximumIntensity();
	volumeMapper->SetInput( vtkImageReslicer->GetOutput()  );


	vtkPlane *plane1 = vtkPlane::New();
	plane1->SetOrigin( 0, 0, m_VolumeClipPlane_near );
	plane1->SetNormal( 0, 0, 1 );
	vtkPlane *plane2 = vtkPlane::New();
	plane2->SetOrigin( 0, 0, m_VolumeClipPlane_far );
	plane2->SetNormal( 0, 0, -1 );

	volumeMapper->AddClippingPlane( plane1 );
	volumeMapper->AddClippingPlane( plane2 );

	volumeMapper->ReleaseDataFlagOn();



	vtkVolume* volume = vtkVolume::New();
	volume->SetMapper( volumeMapper );
	volume->SetProperty( mipProperty );


	vtk_Renderer->AddVolume( volume );
	vtk_Renderer->ResetCamera();
	vtk_Renderer->GetActiveCamera()->ParallelProjectionOn();
	
...

Until now i didnt check the performance and maybe it is horrible slow but my main problem now is that i get a big memory problem with big CTseries. In orthogonal MPR you have three different windows which means three times the code above is executed. Three times the vtkImageReslicer makes new ImageData and also 3 new Volumes are created. 

So my question is, is there a way to reduce the memory effort or am i completely wrong and there is another approach to realize an orthogonal MPR with static MIP?

I hope i can get some advice.

Thanks in advance
Andi

_______________________________________________________________________
EINE FÜR ALLE: die kostenlose WEB.DE-Plattform für Freunde und Deine
Homepage mit eigenem Namen. Jetzt starten! http://unddu.de/?kid=kid@mf2




More information about the vtkusers mailing list