[vtkusers] Which values does ImageResample change by no magnification ?

leandro leobbastos at gmail.com
Tue Nov 15 05:46:50 EST 2011


can someone explain this behavior?

In my test-program the user can choose which resample factor the volume
should be renderered into.

/resample -> SetAxisMagnificationFactor(0,factor);
resample -> SetAxisMagnificationFactor(1,factor);
resample -> SetAxisMagnificationFactor(2,factor);/

the colors and opacity values I use are the same of the VTK sample program
*"Medical4":*

/vtkSmartPointer<vtkColorTransferFunction>volumeColor =
vtkSmartPointer<vtkColorTransferFunction>::New();
		  volumeColor->AddRGBPoint(0,    0.0, 0.0, 0.0);
		  volumeColor->AddRGBPoint(500,  1.0, 0.5, 0.3);
		  volumeColor->AddRGBPoint(1000, 1.0, 0.5, 0.3);
		  volumeColor->AddRGBPoint(1150, 1.0, 1.0, 0.9);

	  vtkSmartPointer<vtkPiecewiseFunction> volumeScalarOpacity =
		vtkSmartPointer<vtkPiecewiseFunction>::New();
		  volumeScalarOpacity->AddPoint(0,    0.00);
		  volumeScalarOpacity->AddPoint(100,  0.15);
		  volumeScalarOpacity->AddPoint(1000, 0.15);
		  volumeScalarOpacity->AddPoint(1150, 0.85);

	  vtkSmartPointer<vtkPiecewiseFunction> volumeGradientOpacity =
		vtkSmartPointer<vtkPiecewiseFunction>::New();
		  volumeGradientOpacity->AddPoint(0,   0.0);
		  volumeGradientOpacity->AddPoint(90,  0.5);
		  volumeGradientOpacity->AddPoint(100, 1.0);

	  vtkSmartPointer<vtkVolumeProperty> volumeProperty =
vtkSmartPointer<vtkVolumeProperty>::New();
		  volumeProperty->SetColor(volumeColor);
		  volumeProperty->SetScalarOpacity(volumeScalarOpacity);
		  volumeProperty->SetGradientOpacity(volumeGradientOpacity);
		  volumeProperty->SetInterpolationTypeToLinear();
		  volumeProperty->ShadeOn();
		  volumeProperty->SetAmbient(0.4);
		  volumeProperty->SetDiffuse(0.6);
		  volumeProperty->SetSpecular(0.2);
	
	  volume -> SetProperty(volumeProperty);/


My test was to render the volume in full resolution and with resample factor
1 (no magnification, i supposed). For some reason I don't get the same
output, and I can't explain why. 

I used the method Print() to Debug and both data seem to have same extent,
spacing, dimensions, increments, and bound values. The only different were:

unsampled volume:
	Copy Tuple Flags: 1 1 1 1 1 *0 1*
	Interpolate Flags: 1 1 1 1 1 *0 0*
	Pass Through Flags: 1 1 1 1 1 1 1

sampled volume:
	Copy Tuple Flags: 1 1 1 1 1 1 1
	Interpolate Flags: 1 1 1 1 1 1 1
	Pass Through Flags: 1 1 1 1 1 1 1


I am not allowed to post the pictures, but I can say that the unsampled
volume shows the bones of the patient and the sampled volume shows skin with
quite some transparency. Are the voxel intensity values being changed? Can I
see these values somewhere?



--
View this message in context: http://vtk.1045678.n5.nabble.com/Which-values-does-ImageResample-change-by-no-magnification-tp4994027p4994027.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list