]> Creatis software - clitk.git/commitdiff
Both the lower and the upper extent of the roi for the w feature should be in the...
authorSimon Rit <simon.rit@creatis.insa-lyon.fr>
Wed, 17 Feb 2016 16:32:10 +0000 (17:32 +0100)
committerSimon Rit <simon.rit@creatis.insa-lyon.fr>
Wed, 17 Feb 2016 16:32:10 +0000 (17:32 +0100)
vv/vvSlicer.cxx

index 0e3b3bf1fe9b870ba1b2be414a1b07d11ddc9282..48422cbcac9f0ed33998157702e773b1a6921ba9 100644 (file)
@@ -1549,11 +1549,13 @@ 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];
+    for(int j=0;j<2; j++) {
+      if(iLocalExtents[i*2+j]< mImageReslice->GetInputInformation()->Get(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT())[2*i])
+        iLocalExtents[i*2+j] = 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];
+      if(iLocalExtents[i*2+j]> mImageReslice->GetInputInformation()->Get(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT())[2*i+1])
+        iLocalExtents[i*2+j] = mImageReslice->GetInputInformation()->Get(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT())[2*i+1];
+    }
   }
 
   vtkSmartPointer<vtkExtractVOI> voiFilter = vtkSmartPointer<vtkExtractVOI>::New();