_volumeMapper = vtkVolumeRayCastMapper::New();
_newvol = vtkVolume::New();
_volumeProperty = vtkVolumeProperty::New();
+ _compositeFunction = vtkVolumeRayCastCompositeFunction::New();
+ _compositeFunctionMIP = vtkVolumeRayCastMIPFunction::New();
+
}
//-------------------------------------------------------------------
vtkClipping3DDataViewer::~vtkClipping3DDataViewer()
// EED 13/03/2011
- _compositeFunction = vtkVolumeRayCastCompositeFunction::New();
- vtkVolumeRayCastMIPFunction* _compositeFunctionMIP = vtkVolumeRayCastMIPFunction::New();
// _volumeMapper = vtkVolumeRayCastMapper::New();
_volumeMapper->SetInput( this->GetVtkMPRBaseData()->GetImageData() );
-if(_isRayCasting)
-{
- cout<<"JPRG::vtkClipping3DDataViewer::Configure_Volume::isRayCasting"<<endl;
+
+
_volumeMapper->SetVolumeRayCastFunction(_compositeFunction);
-}
-else if(_isMIP)
-{
- cout<<"JPRG::vtkClipping3DDataViewer::Configure_Volume::isMIP"<<endl;
- _volumeMapper->SetVolumeRayCastFunction(_compositeFunctionMIP);
-}
+
+ // _volumeMapper->SetVolumeRayCastFunction(_compositeFunctionMIP);
//
_volumeMapper->SetClippingPlanes( _volumePlanes );
_volumeMapper->AutoAdjustSampleDistancesOn();
+ _volumeProperty->SetInterpolationTypeToNearest();
//_volumeProperty = vtkVolumeProperty::New();
_volumeProperty->SetColor(_ctfun);
_volumeProperty->SetScalarOpacity( _tfun );
_volumeProperty->DisableGradientOpacityOn();
-if(_interpolation)
-{
- _volumeProperty->SetInterpolationTypeToLinear();
-}
-else
-{
- _volumeProperty->SetInterpolationTypeToNearest();
-}
-if(_shade)
-{
- _volumeProperty->ShadeOn();
-}
-else
-{
- _volumeProperty->ShadeOff();
-}
// _
_observerV->SetvtkVolumeRayCastMapper( _volumeMapper );
}
+void vtkClipping3DDataViewer::updateVolume()
+{
+
+ if(_isRayCasting)
+ {
+ cout<<"JPRG::vtkClipping3DDataViewer::Configure_Volume::isRayCasting"<<endl;
+ _volumeMapper->SetVolumeRayCastFunction(_compositeFunction);
+ }
+ else if(_isMIP)
+ {
+ cout<<"JPRG::vtkClipping3DDataViewer::Configure_Volume::isMIP"<<endl;
+
+ _volumeMapper->SetVolumeRayCastFunction(_compositeFunctionMIP);
+ }
+
+ if(_interpolation)
+ {
+ _volumeProperty->SetInterpolationTypeToLinear();
+ }
+ else
+ {
+ _volumeProperty->SetInterpolationTypeToNearest();
+ }
+
+ if(_shade)
+ {
+ _volumeProperty->ShadeOn();
+ }
+ else
+ {
+ _volumeProperty->ShadeOff();
+ }
+
+}
//-------------------------------------------------------------------
void vtkClipping3DDataViewer::Configure()