X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FmaracasVisuLib%2Fsrc%2Finterface%2FwxWindows%2Fwidgets%2FThresholdImageView%2FLayerImageBase.cxx;h=8f1fc5e04406beae38226215da1528ddab6cd2fc;hb=d1de4d9e4121e4602daf11142cbc4b03c386d98a;hp=a86251cddaa68abde26eba60a6d3a7b2560c367e;hpb=0780b53e8b105636030b2c9fcbbc423d8ed48c30;p=creaMaracasVisu.git diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.cxx index a86251c..8f1fc5e 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.cxx @@ -152,7 +152,14 @@ int LayerImageBase::GetZ() // virtual vtkImageData* LayerImageBase::GetImage() { // return _image; - return _imageChangeInformation->GetOutput(); + vtkImageData *result; + if (_image==NULL) + { + result = NULL; + } else { + result = _imageChangeInformation->GetOutput(); + } + return result; } //---------------------------------------------------------------------------- @@ -402,26 +409,16 @@ void LayerImageBase::onThreshold() { if ((_image!=NULL) && (_baseView!=NULL)) { -double spc[3]; -GetImage()-> GetSpacing(spc); -printf("EED LayerImageBase::onThreshold A img-spc %f %f %f\n", spc[0],spc[1],spc[2]); double x=GetX(); double y=GetY(); double z=GetZ(); -// x = x*spc[0]; -// y = y*spc[1]; -// z = z*spc[2]; - - x = x*_spcBase[0]; y = y*_spcBase[1]; z = z*_spcBase[2]; - CleanXYZ(x,y,z); - vtkCamera *camera = _baseView->GetRenderer()->GetActiveCamera(); int directionViewer=0; if (camera->GetParallelProjection()==1) @@ -430,7 +427,6 @@ printf("EED LayerImageBase::onThreshold A img-spc %f %f %f\n", spc[0],spc[1] directionViewer = wxvtk2dbasevie->GetDirection(); } // ParallelProjection - if (!GetActorPresent()) { if (_thresholdTable==NULL) @@ -516,9 +512,6 @@ printf("EED LayerImageBase::onThreshold A img-spc %f %f %f\n", spc[0],spc[1] // _scalarbarActor->SetTextPad(4); ?? -GetImage()-> GetSpacing(spc); -printf("EED LayerImageBase::onThreshold B img-spc %f %f %f\n", spc[0],spc[1],spc[2]); - } // _image }