_visibleTissue[i] = false;
_representationType[i] = true;
}
- _visibleVolume=false;
- _isRayCasting=true;
- _isMIP=false;
- _interpolation=false;
- _shade=false;
+ _visibleVolume = false;
+ _isRayCasting = true;
+ _isMIP = false;
+ _interpolation = false;
+ _shade = false;
- _volumerendererdata = VolumeRendererData::New();
- _volumeMapper = vtkVolumeRayCastMapper::New();
- _newvol = vtkVolume::New();
- _volumeProperty = vtkVolumeProperty::New();
- _compositeFunction = vtkVolumeRayCastCompositeFunction::New();
- _compositeFunctionMIP = vtkVolumeRayCastMIPFunction::New();
+ _volumerendererdata = VolumeRendererData::New();
+ _volumeMapper = vtkVolumeRayCastMapper::New();
+ _newvol = vtkVolume::New();
+ _volumeProperty = vtkVolumeProperty::New();
+ _compositeFunction = vtkVolumeRayCastCompositeFunction::New();
+ _compositeFunctionMIP = vtkVolumeRayCastMIPFunction::New();
}
//-------------------------------------------------------------------
_visibleVolumeBox = visibleBox;
}
+
//-------------------------------------------------------------------
-void vtkClipping3DDataViewer::Configure_Tissue()
+void vtkClipping3DDataViewer::SetImage()
{
+ int i;
+ vtkImageData *imagedata=_vtkmprbasedata->GetImageData();
+ for (i=0; i< VTKMPRDATA_MAXTISSUE ; i++)
+ {
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ _mCubes[i]->SetInput( imagedata );
+#else
+ _mCubes[i]->SetInputData( imagedata );
+#endif
+ } // for
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ _volumeMapper->SetInput( imagedata );
+#else
+ _volumeMapper->SetInputData( imagedata );
+#endif
+ _volumerendererdata->SetImageData( imagedata );
+}
- double range[2];
+//-------------------------------------------------------------------
+void vtkClipping3DDataViewer::Configure_Tissue()
+{
int i;
- for (i=0; i< VTKMPRDATA_MAXTISSUE ; i++){
+ double range[2];
+ vtkImageData *imagedata=_vtkmprbasedata->GetImageData();
+ imagedata->GetScalarRange( range );
+ for (i=0; i< VTKMPRDATA_MAXTISSUE ; i++)
+ {
// Visualisation - original volume
- vtkImageData *imagedata=_vtkmprbasedata->GetImageData();
- imagedata->GetScalarRange( range );
_mCubes[i] = vtkMarchingCubes::New( );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_mCubes[i]->SetInput( imagedata );
+#else
+ _mCubes[i]->SetInputData( imagedata );
+#endif
_mCubes[i]->SetValue( 0, range[1]*(4+i) / 8 );
// _mCubes[i]->SetValue( 0, 1500 );
-
_tissueStripper[i] = vtkStripper::New();
- _tissueStripper[i]->SetInput( _mCubes[i]->GetOutput( ) );
-
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ _tissueStripper[i]->SetInput( _mCubes[i]->GetOutput( ) );
+#else
+ _tissueStripper[i]->SetInputData( _mCubes[i]->GetOutput( ) );
+#endif
_tissuePlanes[i] = vtkPlanes::New();
-
int x1,x2,y1,y2,z1,z2;
imagedata->GetExtent(x1,x2,y1,y2,z1,z2);
_tissuePlanes[i]->SetBounds (x1,x2,y1,y2,z1,z2);
-
_tissueClipper[i] = vtkClipPolyData::New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_tissueClipper[i]->SetInput( _tissueStripper[i]->GetOutput() );
+#else
+ _tissueClipper[i]->SetInputData( _tissueStripper[i]->GetOutput() );
+#endif
+
_tissueClipper[i]->SetClipFunction( _tissuePlanes[i] );
_tissueClipper[i]->InsideOutOn( );
-
_tissueMapper[i] = vtkPolyDataMapper::New( );
- _tissueMapper[i]->SetInput( _tissueClipper[i]->GetOutput() );
- _tissueMapper[i]->ScalarVisibilityOff( );
-// _tissueMapper[i]->Update();
- }
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ _tissueMapper[i]->SetInput( _tissueClipper[i]->GetOutput() );
+#else
+ _tissueMapper[i]->SetInputData( _tissueClipper[i]->GetOutput() );
+#endif
+ _tissueMapper[i]->ScalarVisibilityOff( );
+// _tissueMapper[i]->Update();
+ } // for i
// vtkActor tissue
for (i=0; i< VTKMPRDATA_MAXTISSUE ; i++){
// EED 13/03/2011
// _volumeMapper = vtkVolumeRayCastMapper::New();
+
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_volumeMapper->SetInput( this->GetVtkMPRBaseData()->GetImageData() );
+#else
+ _volumeMapper->SetInputData( this->GetVtkMPRBaseData()->GetImageData() );
+#endif
+
_volumeMapper->SetVolumeRayCastFunction(_compositeFunction);
_observerV->SetvtkVolumeRayCastMapper( _volumeMapper );
}
+//-----------------------------------------------------------------------------
void vtkClipping3DDataViewer::Configure_VolumeBox()
{
//_volumerendererdata->BoundingBoxChanged(event.IsChecked() );
}
+//-----------------------------------------------------------------------------
+
void vtkClipping3DDataViewer::SetRenderer(vtkRenderer* renderer)
{
_volumerendererdata->SetRenderer(renderer);
}
+//-----------------------------------------------------------------------------
void vtkClipping3DDataViewer::SetInteractor(vtkRenderWindowInteractor* interactor)
{
}
+//-----------------------------------------------------------------------------
void vtkClipping3DDataViewer::BoxActorChanged(bool changed)
{
vector<double> *gv = this->GetGreyValuesTransferenceFVector();
}
+//-----------------------------------------------------------------------------
void vtkClipping3DDataViewer::UpdateVolumeBox(vector<double> gf, vector<double> vf, vtkColorTransferFunction* ctfun)
{
_volumerendererdata->SetLookUpTable((vtkLookupTable*)(ctfun));
}
+//-----------------------------------------------------------------------------
void vtkClipping3DDataViewer::updateVolume()
{
Configure_VolumeBox();
// An outline provides context around the data.
//
- _outlineData = vtkOutlineFilter::New();
+ _outlineData = vtkOutlineFilter::New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_outlineData->SetInput((vtkDataSet *) _vtkmprbasedata->GetImageData() );
- _mapOutline = vtkPolyDataMapper::New();
- _mapOutline->SetInput(_outlineData->GetOutput());
- _outline = vtkActor::New();
+#else
+ _outlineData->SetInputData((vtkDataSet *) _vtkmprbasedata->GetImageData() );
+#endif
+
+ _mapOutline = vtkPolyDataMapper::New();
+
+//EED 4 nov 2015 Estelle
+// _mapOutline->SetInput(_outlineData->GetOutput());
+
+ _outline = vtkActor::New();
_outline->SetMapper(_mapOutline);
_outline->GetProperty()->SetColor(0,0,0);
}
vtkDataSetReader *reader = vtkDataSetReader::New();
reader->SetFileName(namefile);
reader->Update();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_tissueStripper[3]->SetInput( reader->GetPolyDataOutput() );
+#else
+ _tissueStripper[3]->SetInputData( reader->GetPolyDataOutput() );
+#endif
+
}
void vtkClipping3DDataViewer::setColorTransferFunction(vtkColorTransferFunction* colortable){