X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FmaracasVisuLib%2Fsrc%2Finterface%2FwxWindows%2Fwidgets%2FwxMPRBaseData.cxx;h=f3217a2e5b2f801419ea11328f6f542898987425;hb=a4ee3758aa0477f677fb981e2c4d6e29995e8db8;hp=9c86ffc4afd1cc37746ea8a17564d0924f61d9e4;hpb=e6b030ceb3ee4eea1f012e7d5c47503cf6322c61;p=creaMaracasVisu.git diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRBaseData.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRBaseData.cxx index 9c86ffc..f3217a2 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRBaseData.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRBaseData.cxx @@ -35,7 +35,7 @@ vtkBaseData::~vtkBaseData() void vtkBaseData::SetMarImageData(marImageData *marimagedata) { _marImageData = marimagedata; - Configure(); + //Configure(); } //------------------------------------------------------------------- @@ -57,7 +57,7 @@ void vtkBaseData::Configure() // virtual //------------------------------------------------------------------- void vtkBaseData::SetZ(double z){ - int maxZ; + //int maxZ; // int dim[3]; // _marImageData->GetDimensions(dim); @@ -66,18 +66,29 @@ void vtkBaseData::SetZ(double z){ int ext[6]; vtkImageData* img = _marImageData->GetImageData(); if(img!=NULL){ - img->GetWholeExtent(ext); + /*img->GetWholeExtent(ext); maxZ=ext[5]-ext[4]+1; if (z>=maxZ) { - z=maxZ-1; + //z=maxZ-1; } if (z<=0) { z=0; } + _z=z;*/ + img->GetExtent(ext); + if (z > ext[5]) + { + z = ext[5]; + } + if (z < ext[4]) + { + z = ext[4]; + } + _z=z; } } @@ -115,6 +126,7 @@ vtkMPRBaseData::vtkMPRBaseData() _y=0; _z=0; _transformOrientation = NULL; + _marImageData = NULL; } //------------------------------------------------------------------- vtkMPRBaseData::~vtkMPRBaseData() @@ -128,7 +140,10 @@ void vtkMPRBaseData::Configure() vtkImageData* img = _marImageData->GetImageData(); if(img !=NULL){ img->GetExtent (_x1,_x2,_y1,_y2,_z1,_z2); - _transformOrientation=vtkTransform::New(); + //std::cout<<"vtkMPRBaseData::Configure() _x1= "<<_x1<<" _x2= "<<_x2<<" _y1= "<<_y1<<" _y2= "<<_y2<<" _z1= "<<_z1<<" _z2= "<<_z2<Identity(); } } @@ -162,6 +177,7 @@ int vtkMPRBaseData::GetMaxPositionZ( ) //------------------------------------------------------------------- double vtkMPRBaseData::GetX() { + return _x; } //------------------------------------------------------------------- @@ -170,12 +186,17 @@ double vtkMPRBaseData::GetY() return _y; } //------------------------------------------------------------------- +/** +** Calculates the value of the slider and the layer in the image that is spouse to show +**/ void vtkMPRBaseData::SetX(double x) { - int dim[3]; + //int dim[3]; + int ext[6]; + vtkImageData* img = _marImageData->GetImageData(); if(img!=NULL){ - img->GetDimensions(dim); + /*img->GetDimensions(dim); if (x<0) { x=0; @@ -183,17 +204,31 @@ void vtkMPRBaseData::SetX(double x) if (x>=dim[0]) { x=dim[0]-1; - }; + } + _x=x;*/ + img->GetExtent(ext); + if (x < ext[0]) + { + x=ext[0]; + } + if (x > ext[1]) + { + x=ext[1]; + } _x=x; } } //------------------------------------------------------------------- +/** +** Calculates the value of the slider and the layer in the image that is spouse to show +**/ void vtkMPRBaseData::SetY(double y) { - int dim[3]; + //int dim[3]; + int ext[6]; vtkImageData* img = _marImageData->GetImageData(); if(img!=NULL){ - img->GetDimensions(dim); + /*img->GetDimensions(dim); if (y<0) { y=0; @@ -201,13 +236,23 @@ void vtkMPRBaseData::SetY(double y) if (y>=dim[1]) { y=dim[1]-1; - }; + } + _y=y;*/ + img->GetExtent(ext); + if (y ext[3]) + { + y=ext[3]; + } _y=y; } } //------------------------------------------------------------------- vtkTransform *vtkMPRBaseData::GetTransformOrientation() -{ +{ return _transformOrientation; } //------------------------------------------------------------------- @@ -238,6 +283,18 @@ vtkMPR3DDataViewer::vtkMPR3DDataViewer() _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; } //------------------------------------------------------------------- vtkMPR3DDataViewer::~vtkMPR3DDataViewer() @@ -284,7 +341,7 @@ void vtkMPR3DDataViewer::Refresh() int x = (int)(_vtkmprbasedata->GetX()); int y = (int)(_vtkmprbasedata->GetY()); int z = (int)(_vtkmprbasedata->GetZ()); - + std::cout<<" vtkMPR3DDataViewer::Refresh() x="<