X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FmaracasVisuLib%2Fsrc%2Finterface%2FwxWindows%2Fwidgets%2FvtkClipping3DDataViewer.cxx;h=a888215dc78262188dcaa7fade05be4dc4b72176;hb=b80b4dcc301c1c2c63c0f76cd06b0a434350f7a7;hp=335af08b1429898e41ed6ae1a151dc76840cee95;hpb=97dee12beaba08089198ed7bab9544b8b4c4f240;p=creaMaracasVisu.git diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkClipping3DDataViewer.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkClipping3DDataViewer.cxx index 335af08..a888215 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkClipping3DDataViewer.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkClipping3DDataViewer.cxx @@ -201,46 +201,49 @@ void vtkClipping3DDataViewer::SetVisibleVolumeBox(bool visibleBox) _visibleVolumeBox = visibleBox; } + //------------------------------------------------------------------- -void vtkClipping3DDataViewer::Configure_Tissue() +void vtkClipping3DDataViewer::SetImage() { + int i; + vtkImageData *imagedata=_vtkmprbasedata->GetImageData(); + for (i=0; i< VTKMPRDATA_MAXTISSUE ; i++) + { + _mCubes[i]->SetInput( imagedata ); + } // for + _volumeMapper->SetInput( imagedata ); + _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( ); _mCubes[i]->SetInput( imagedata ); - _mCubes[i]->SetValue( 0, range[1]*(4+i) / 8 ); // _mCubes[i]->SetValue( 0, 1500 ); - _tissueStripper[i] = vtkStripper::New(); _tissueStripper[i]->SetInput( _mCubes[i]->GetOutput( ) ); - - - _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(); _tissueClipper[i]->SetInput( _tissueStripper[i]->GetOutput() ); _tissueClipper[i]->SetClipFunction( _tissuePlanes[i] ); _tissueClipper[i]->InsideOutOn( ); - _tissueMapper[i] = vtkPolyDataMapper::New( ); _tissueMapper[i]->SetInput( _tissueClipper[i]->GetOutput() ); _tissueMapper[i]->ScalarVisibilityOff( ); // _tissueMapper[i]->Update(); - - } - - + } // for i // vtkActor tissue for (i=0; i< VTKMPRDATA_MAXTISSUE ; i++){ @@ -384,6 +387,7 @@ void vtkClipping3DDataViewer::Configure_Volume() _observerV->SetvtkVolumeRayCastMapper( _volumeMapper ); } +//----------------------------------------------------------------------------- void vtkClipping3DDataViewer::Configure_VolumeBox() { @@ -401,12 +405,15 @@ void vtkClipping3DDataViewer::Configure_VolumeBox() //_volumerendererdata->BoundingBoxChanged(event.IsChecked() ); } +//----------------------------------------------------------------------------- + void vtkClipping3DDataViewer::SetRenderer(vtkRenderer* renderer) { _volumerendererdata->SetRenderer(renderer); } +//----------------------------------------------------------------------------- void vtkClipping3DDataViewer::SetInteractor(vtkRenderWindowInteractor* interactor) { @@ -414,6 +421,7 @@ void vtkClipping3DDataViewer::SetInteractor(vtkRenderWindowInteractor* interacto } +//----------------------------------------------------------------------------- void vtkClipping3DDataViewer::BoxActorChanged(bool changed) { vector *gv = this->GetGreyValuesTransferenceFVector(); @@ -425,6 +433,7 @@ void vtkClipping3DDataViewer::BoxActorChanged(bool changed) } +//----------------------------------------------------------------------------- void vtkClipping3DDataViewer::UpdateVolumeBox(vector gf, vector vf, vtkColorTransferFunction* ctfun) { _volumerendererdata->SetLookUpTable((vtkLookupTable*)(ctfun)); @@ -432,6 +441,7 @@ void vtkClipping3DDataViewer::UpdateVolumeBox(vector gf, vector } +//----------------------------------------------------------------------------- void vtkClipping3DDataViewer::updateVolume() { @@ -481,7 +491,7 @@ void vtkClipping3DDataViewer::Configure() //EED 4 nov 2015 Estelle // _mapOutline->SetInput(_outlineData->GetOutput()); - _outline = vtkActor::New(); + _outline = vtkActor::New(); _outline->SetMapper(_mapOutline); _outline->GetProperty()->SetColor(0,0,0); }