X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=lib%2FmaracasVisuLib%2Fsrc%2Finterface%2FwxWindows%2Fwidgets%2FvtkMPR3DDataViewer.cxx;h=189bdfaeac5523108b4271a7e1a01a9310ede443;hb=15112ae15da4222831b0e8e7c9be87daf9e99a1c;hp=e43df9aa9ca1882dcb6e674f76ae7ab745037440;hpb=ba3bf1e05af2b03d6b013606b9d885d8fb0b2cb4;p=creaMaracasVisu.git diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkMPR3DDataViewer.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkMPR3DDataViewer.cxx index e43df9a..189bdfa 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkMPR3DDataViewer.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkMPR3DDataViewer.cxx @@ -34,7 +34,6 @@ vtkMPR3DDataViewer::vtkMPR3DDataViewer() _visiblePosition[2]=false; _ctfun = NULL; _vtkmprbasedata = NULL; - _ctfun = NULL; _saggitalColors = NULL; _saggital = NULL; @@ -49,27 +48,27 @@ vtkMPR3DDataViewer::vtkMPR3DDataViewer() //------------------------------------------------------------------- vtkMPR3DDataViewer::~vtkMPR3DDataViewer() { - if(_outlineData) {_outlineData-> Delete();} - if(_mapOutline) {_mapOutline-> Delete();} - if(_outline) {_outline-> Delete();} - -// if (_bwLut) _bwLut->Delete(); -// if (_hueLut) _hueLut->Delete(); -// if (_satLut) _satLut->Delete(); - if (_ctfun) _ctfun->Delete(); - if (_saggitalColors) _saggitalColors ->Delete(); - if (_saggital) _saggital->Delete(); - if (_axialColors) _axialColors->Delete(); - if (_axial) _axial->Delete(); - if (_coronalColors) _coronalColors->Delete(); - if (_coronal) _coronal->Delete(); - + if(_outlineData) {_outlineData -> Delete();} + if(_mapOutline) {_mapOutline -> Delete();} + if(_outline) {_outline -> Delete();} +// if (_bwLut) {_bwLut -> Delete();} +// if (_hueLut) {_hueLut -> Delete();} +// if (_satLut) {_satLut -> Delete();} + if (_ctfun) {_ctfun -> Delete();} + if (_saggitalColors) {_saggitalColors -> Delete();} + if (_saggital) {_saggital -> Delete();} + if (_axialColors) {_axialColors -> Delete();} + if (_axial) {_axial -> Delete();} + if (_coronalColors) {_coronalColors -> Delete();} + if (_coronal) {_coronal -> Delete();} } + //------------------------------------------------------------------- vtkActor* vtkMPR3DDataViewer::GetOutlineActor() { return _outline; } + //------------------------------------------------------------------- vtkImageActor* vtkMPR3DDataViewer::GetImageActor(int id) { @@ -144,16 +143,25 @@ void vtkMPR3DDataViewer::SetImage() { //EED 2017-01-01 Migration VTK7 #if VTK_MAJOR_VERSION <= 5 - _saggitalColors->SetInput( _vtkmprbasedata->GetImageData() ); - _axialColors->SetInput( _vtkmprbasedata->GetImageData() ); - _coronalColors->SetInput( _vtkmprbasedata->GetImageData() ); + _saggitalColors -> SetInput( _vtkmprbasedata->GetImageData() ); + _axialColors -> SetInput( _vtkmprbasedata->GetImageData() ); + _coronalColors -> SetInput( _vtkmprbasedata->GetImageData() ); + _outlineData -> SetInput((vtkDataSet *) _vtkmprbasedata->GetImageData() ); #else - _saggitalColors->SetInputData( _vtkmprbasedata->GetImageData() ); - _axialColors->SetInputData( _vtkmprbasedata->GetImageData() ); - _coronalColors->SetInputData( _vtkmprbasedata->GetImageData() ); + _saggitalColors -> SetInputData( _vtkmprbasedata->GetImageData() ); + _axialColors -> SetInputData( _vtkmprbasedata->GetImageData() ); + _coronalColors -> SetInputData( _vtkmprbasedata->GetImageData() ); + +//EED 2020-01-27 this is to slow ??? how can we accelerated +// _saggitalColors -> Update(); +// _axialColors -> Update(); +// _coronalColors -> Update(); + + _outlineData -> SetInputData((vtkDataSet *) _vtkmprbasedata->GetImageData() ); #endif } + //------------------------------------------------------------------- void vtkMPR3DDataViewer::Configure() { @@ -182,10 +190,8 @@ void vtkMPR3DDataViewer::Configure() _satLut->SetValueRange (1, 1); */ - double range[2]; double delta; - if(_vtkmprbasedata->GetImageData()) { //EED 2017-01-01 Migration VTK7 @@ -281,18 +287,18 @@ void vtkMPR3DDataViewer::Configure() _saggitalColors = vtkImageMapToColors::New(); } _saggitalColors->RemoveAllInputs(); + + // _saggitalColors->SetLookupTable(_bwLut); + _saggitalColors->SetLookupTable(_ctfun); //EED 2017-01-01 Migration VTK7 #if VTK_MAJOR_VERSION <= 5 _saggitalColors->SetInput( _vtkmprbasedata->GetImageData() ); #else _saggitalColors->SetInputData( _vtkmprbasedata->GetImageData() ); + _saggitalColors->Update(); #endif - // _saggitalColors->SetLookupTable(_bwLut); - _saggitalColors->SetLookupTable(_ctfun); - - if(_saggital==NULL) { _saggital = vtkImageActor::New(); @@ -305,29 +311,26 @@ void vtkMPR3DDataViewer::Configure() } //_saggitalColors->Update(); - - // Create the second (axial) plane of the three planes. We use the // same approach as before except that the extent differs. - if(_axialColors==NULL) { _axialColors = vtkImageMapToColors::New(); } - _axialColors->RemoveAllInputs(); + // _axialColors->SetLookupTable(_hueLut); + _axialColors->SetLookupTable(_ctfun); + //EED 2017-01-01 Migration VTK7 #if VTK_MAJOR_VERSION <= 5 _axialColors->SetInput( _vtkmprbasedata->GetImageData() ); #else _axialColors->SetInputData( _vtkmprbasedata->GetImageData() ); + _axialColors->Update(); #endif - // _axialColors->SetLookupTable(_hueLut); - _axialColors->SetLookupTable(_ctfun); - if(_axial==NULL) { _axial = vtkImageActor::New(); @@ -342,8 +345,6 @@ void vtkMPR3DDataViewer::Configure() } //_axialColors->Update(); - - // Create the third (coronal) plane of the three planes. We use // the same approach as before except that the extent differs. if(_coronalColors==NULL) @@ -351,16 +352,18 @@ void vtkMPR3DDataViewer::Configure() _coronalColors = vtkImageMapToColors::New(); } _coronalColors->RemoveAllInputs(); + // _coronalColors->SetLookupTable(_satLut); + _coronalColors->SetLookupTable(_ctfun); + //EED 2017-01-01 Migration VTK7 #if VTK_MAJOR_VERSION <= 5 _coronalColors->SetInput( _vtkmprbasedata->GetImageData() ); #else _coronalColors->SetInputData( _vtkmprbasedata->GetImageData() ); + _coronalColors->Update(); #endif - // _coronalColors->SetLookupTable(_satLut); - _coronalColors->SetLookupTable(_ctfun); if(_coronal==NULL) { @@ -375,8 +378,6 @@ void vtkMPR3DDataViewer::Configure() } // if _coronal - - // An outline provides context around the data. // if(_outlineData==NULL) @@ -391,6 +392,7 @@ void vtkMPR3DDataViewer::Configure() _outlineData->SetInput((vtkDataSet *) _vtkmprbasedata->GetImageData() ); #else _outlineData->SetInputData((vtkDataSet *) _vtkmprbasedata->GetImageData() ); + _outlineData->Update(); #endif } // if _image @@ -416,7 +418,6 @@ void vtkMPR3DDataViewer::Configure() _outline->GetProperty()->SetColor(0,0,0); } } - //int ext[6]; //_vtkmprbasedata->GetImageData()->GetExtent(ext); }