X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FmaracasVisuLib%2Fsrc%2Finterface%2FwxWindows%2Fwidgets%2FvtkMPR3DDataViewer.cxx;h=cdfc9918532601438b1690cc80ac92c0ccc0e42b;hb=b80b4dcc301c1c2c63c0f76cd06b0a434350f7a7;hp=d1806fe0c1fd7654e357d6c5d5c802a3058e0c7f;hpb=e4ef2b5df5aac431ff3b806f83b7dd5e55e89d86;p=creaMaracasVisu.git diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkMPR3DDataViewer.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkMPR3DDataViewer.cxx index d1806fe..cdfc991 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkMPR3DDataViewer.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkMPR3DDataViewer.cxx @@ -32,19 +32,19 @@ vtkMPR3DDataViewer::vtkMPR3DDataViewer() _visiblePosition[0]=false; _visiblePosition[1]=false; _visiblePosition[2]=false; - _ctfun = NULL; - _vtkmprbasedata=NULL; - - _ctfun=NULL; - _saggitalColors=NULL; - _saggital=NULL; - _axialColors=NULL; - _axial=NULL; - _coronalColors=NULL; - _coronal=NULL; - _mapOutline=NULL; - _outline=NULL; - _outlineData=NULL; + _ctfun = NULL; + _vtkmprbasedata = NULL; + + _ctfun = NULL; + _saggitalColors = NULL; + _saggital = NULL; + _axialColors = NULL; + _axial = NULL; + _coronalColors = NULL; + _coronal = NULL; + _mapOutline = NULL; + _outline = NULL; + _outlineData = NULL; } //------------------------------------------------------------------- vtkMPR3DDataViewer::~vtkMPR3DDataViewer() @@ -53,16 +53,16 @@ vtkMPR3DDataViewer::~vtkMPR3DDataViewer() 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 (_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 (_saggital) _saggital->Delete(); + if (_axialColors) _axialColors->Delete(); + if (_axial) _axial->Delete(); + if (_coronalColors) _coronalColors->Delete(); + if (_coronal) _coronal->Delete(); } //------------------------------------------------------------------- @@ -74,17 +74,21 @@ vtkActor* vtkMPR3DDataViewer::GetOutlineActor() vtkImageActor* vtkMPR3DDataViewer::GetImageActor(int id) { vtkImageActor *tmpVtkActor=NULL; - if (id==0){ + if (id==0) + { tmpVtkActor = GetvtkActor_saggital(); } - if (id==1){ + if (id==1) + { tmpVtkActor = GetvtkActor_coronal(); } - if (id==2){ + if (id==2) + { tmpVtkActor = GetvtkActor_axial(); } return tmpVtkActor; } + //------------------------------------------------------------------- void vtkMPR3DDataViewer::Refresh() { @@ -135,6 +139,14 @@ std::vector* vtkMPR3DDataViewer::GetctFunVectorBlue() return &_ctFunVectorBlue; } +//------------------------------------------------------------------- +void vtkMPR3DDataViewer::SetImage() +{ + _saggitalColors->SetInput( _vtkmprbasedata->GetImageData() ); + _axialColors->SetInput( _vtkmprbasedata->GetImageData() ); + _coronalColors->SetInput( _vtkmprbasedata->GetImageData() ); +} + //------------------------------------------------------------------- void vtkMPR3DDataViewer::Configure() { @@ -171,8 +183,7 @@ void vtkMPR3DDataViewer::Configure() { _vtkmprbasedata->GetImageData()->GetScalarRange(range); delta = range[1]-range[0]; - - + _ctFunVectorPoint.clear(); _ctFunVectorPoint.push_back( range[0] + delta*0/4 ); _ctFunVectorPoint.push_back( range[0] + delta*1/4 ); @@ -201,7 +212,6 @@ void vtkMPR3DDataViewer::Configure() _ctFunVectorBlue.push_back(0.0); _ctFunVectorBlue.push_back(0.0); - if(_ctfun==NULL) { _ctfun = vtkColorTransferFunction::New(); @@ -343,30 +353,40 @@ vtkImageActor * vtkMPR3DDataViewer::GetvtkActor_axial() } //------------------------------------------------------------------------ -void vtkMPR3DDataViewer::SetPositionX(int pos){ +void vtkMPR3DDataViewer::SetPositionX(int pos) +{ int x1,x2,y1,y2,z1,z2; _vtkmprbasedata->GetDimensionExtention(&x1,&x2,&y1,&y2,&z1,&z2); if(_saggital) { _saggital->SetDisplayExtent( pos , pos , y1 ,y2 , z1 , z2 ); +//EED 2016/02/19 + _saggital->SetInterpolate( GetVtkMPRBaseData()->GetInterpolate() ); } } + //------------------------------------------------------------------------ -void vtkMPR3DDataViewer::SetPositionY(int pos){ +void vtkMPR3DDataViewer::SetPositionY(int pos) +{ int x1,x2,y1,y2,z1,z2; _vtkmprbasedata->GetDimensionExtention(&x1,&x2,&y1,&y2,&z1,&z2); if(_coronal) { _coronal->SetDisplayExtent(x1,x2, pos,pos, z1,z2); +//EED 2016/02/19 + _coronal->SetInterpolate( GetVtkMPRBaseData()->GetInterpolate() ); } } //------------------------------------------------------------------------ -void vtkMPR3DDataViewer::SetPositionZ(int pos){ +void vtkMPR3DDataViewer::SetPositionZ(int pos) +{ int x1,x2,y1,y2,z1,z2; _vtkmprbasedata->GetDimensionExtention(&x1,&x2,&y1,&y2,&z1,&z2); if(_axial) { _axial->SetDisplayExtent(x1,x2, y1,y2, pos,pos); +//EED 2016/02/19 + _axial->SetInterpolate( GetVtkMPRBaseData()->GetInterpolate() ); } } //-------------------------------------------------------------------