]> Creatis software - clitk.git/commitdiff
Debug wrong extent with local windowing (w) outside of the image
authortbaudier <thomas.baudier@creatis.insa-lyon.fr>
Wed, 17 Feb 2016 09:08:50 +0000 (10:08 +0100)
committertbaudier <thomas.baudier@creatis.insa-lyon.fr>
Wed, 17 Feb 2016 09:08:50 +0000 (10:08 +0100)
vv/vvSlicer.cxx

index f74bdb8873559cf29a59548df95df303faacdcc7..0e3b3bf1fe9b870ba1b2be414a1b07d11ddc9282 100644 (file)
@@ -1548,6 +1548,12 @@ void vvSlicer::GetExtremasAroundMousePointer(double & min, double & max, vtkImag
 
     if(iLocalExtents[i*2  ]>iLocalExtents[i*2+1])
       std::swap(iLocalExtents[i*2], iLocalExtents[i*2+1]);
+
+    if(iLocalExtents[i*2]< mImageReslice->GetInputInformation()->Get(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT())[2*i])
+        iLocalExtents[i*2] = mImageReslice->GetInputInformation()->Get(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT())[2*i];
+
+    if(iLocalExtents[i*2+1]> mImageReslice->GetInputInformation()->Get(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT())[2*i+1])
+        iLocalExtents[i*2+1] = mImageReslice->GetInputInformation()->Get(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT())[2*i+1];
   }
 
   vtkSmartPointer<vtkExtractVOI> voiFilter = vtkSmartPointer<vtkExtractVOI>::New();