[vtkusers] vtkFixedPointVolumeRayCastMapper Problem in java

Stef_D stephane.dallongeville at pasteur.fr
Tue Apr 27 07:00:19 EDT 2010


Afaik i already though about that solution of moving several component in a
single one by adding different scalar range in a final one and adjusting
final color function. My problem is that my source image can already have a
complexe colormap schem *per component* so it becomes very difficult to map
all them in a single component... 
Thanks for your help anyway, it's really appreciated.
So you never found any solution to fix the problem with the
vtkFixedPointVolumeRayCastMapper ? too bad... i wonder if i should report it
as VTK bug.

Thanks again.

Cheers. 


Afaik my component can already have very 


Sercani wrote:
> 
> Hi;
> 
> I couldn't solve this problem, but you can of course use 
> vtkVolumeRayCastMapper for maximum intensity(or minimum intensity) 
> projection, here is an example:
> 
> 
> int scalarRangeMin = reader.GetOutput().GetScalarRange()[0];
> int scalarRangeMax = reader.GetOutput().GetScalarRange()[1];
> 
> int window = (int) (scalarRangeMax - scalarRangeMin);
> int level = (int) (scalarRangeMin + (window / 2));
> 
> vtkImageShiftScale shiftscale = new vtkImageShiftScale();
> shiftscale.SetInputConnection(reader.GetOutputPort());
> shiftscale.SetOutputScalarTypeToUnsignedShort();
> if (scalarRangeMin < 0) {
> shiftscale.SetShift(-1 * scalarRangeMin);
> }
> shiftscale.Update();
> vtkPiecewiseFunction opacityFunction=new vtkPiecewiseFunction();
> opacityFunction.AddPoint(scalarRangeMin, 0.0);
> opacityFunction.AddPoint((level + window / 2), 1.0);
> opacityFunction.AddPoint((level - window / 2), 0.0);
> opacityFunction.AddPoint(scalarRangeMax, 0.0);
> 
> vtkPiecewiseFunction grayFunction = new vtkPiecewiseFunction();
> grayFunction.AddSegment(0, 0.0, 255, 1.0);
> 
> volumeProperty.SetColor(grayFunction);
> volumeProperty.SetScalarOpacity(opacityFunction);
> volumeProperty.SetInterpolationTypeToLinear();
> volumeProperty.ShadeOff();
> 
> vtkVolumeRayCastMIPFunction mipFunction = new
> vtkVolumeRayCastMIPFunction();
> raycastMapper.SetInputConnection(shiftscale.GetOutputPort());
> raycastMapper.SetBlendModeToMaximumIntensity();
> raycastMapper.SetVolumeRayCastFunction(mipFunction);
> raycastMapper.ReleaseDataFlagOn();
> 
> vtkVolume volume=new vtkVolume();
> volume.SetMapper(raycastMapper);
> volume.SetProperty(volumeProperty);
> 
> this.getRenderer().AddVolume(volume);
> this.getRenderer().ResetCamera();
> 

-- 
View this message in context: http://old.nabble.com/vtkFixedPointVolumeRayCastMapper-Problem-in-java-tp22659058p28375515.html
Sent from the VTK - Users mailing list archive at Nabble.com.




More information about the vtkusers mailing list