]> Creatis software - clitk.git/commitdiff
To be consistant, crop strictly above (not above or equal)
authorDavid Sarrut <david.sarrut@gmail.com>
Fri, 4 Nov 2011 09:24:59 +0000 (10:24 +0100)
committerDavid Sarrut <david.sarrut@gmail.com>
Fri, 4 Nov 2011 09:24:59 +0000 (10:24 +0100)
itk/clitkSegmentationUtils.txx

index 8fe69a0b13cdfaad0a98819090d35d0ba765a731..76572b594540e9f7393e38a535a40ff3f4ffcb52 100644 (file)
@@ -288,7 +288,7 @@ namespace clitk {
     sliceRelPosFilter->SetDirection(direction);
     sliceRelPosFilter->SetFuzzyThreshold(threshold);
     //    sliceRelPosFilter->AddOrientationTypeString(orientation);
-    sliceRelPosFilter->AddAngles(angle, 0.0);
+    sliceRelPosFilter->AddAnglesInRad(angle, 0.0);
     sliceRelPosFilter->SetIntermediateSpacingFlag((spacing != -1));
     sliceRelPosFilter->SetIntermediateSpacing(spacing);
     sliceRelPosFilter->SetUniqueConnectedComponentBySliceFlag(uniqueConnectedComponent);
@@ -385,7 +385,11 @@ namespace clitk {
     typename ImageType::PointType p;
     image->TransformIndexToPhysicalPoint(image->GetLargestPossibleRegion().GetIndex()+
                                          image->GetLargestPossibleRegion().GetSize(), p);
-    return CropImageAlongOneAxis<ImageType>(image, dim, max, p[dim], autoCrop, BG);
+    // Add GetSpacing because remove Lower or equal than
+    // DD(max);
+    // DD(p);
+    // DD(max+image->GetSpacing()[dim]);
+    return CropImageAlongOneAxis<ImageType>(image, dim, max+image->GetSpacing()[dim], p[dim], autoCrop, BG);
   }
   //--------------------------------------------------------------------