]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.cxx
#2855 creaMaracasVisu Bug New Normal - ColorLayer box spacing size not identified
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / ThresholdImageView / LayerImageBase.cxx
index a86251cddaa68abde26eba60a6d3a7b2560c367e..8f1fc5e04406beae38226215da1528ddab6cd2fc 100644 (file)
@@ -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
 }