]> Creatis software - clitk.git/blobdiff - tools/clitkRelativePositionGenericFilter.txx
Order stations, remove debug, correct structures names
[clitk.git] / tools / clitkRelativePositionGenericFilter.txx
index 7ed172deaeea9c239783d7516e22e37bb83f890d..66c4be47cfa9c80e9e5b687675e30ecf6f6e1061 100644 (file)
@@ -3,7 +3,7 @@
 
   Authors belong to: 
   - University of LYON              http://www.universite-lyon.fr/
-  - Léon Bérard cancer center       http://oncora1.lyon.fnclcc.fr
+  - Léon Bérard cancer center       http://www.centreleonberard.fr
   - CREATIS CNRS laboratory         http://www.creatis.insa-lyon.fr
 
   This software is distributed WITHOUT ANY WARRANTY; without even
@@ -14,7 +14,7 @@
 
   - BSD        See included LICENSE.txt file
   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-  ======================================================================-====*/
+  ===========================================================================**/
 
 #include "clitkImageCommon.h"
 
@@ -74,15 +74,19 @@ SetOptionsFromArgsInfoToFilter(FilterType * f)
   }
   
   if (mArgsInfo.spacing_given) {
-    f->ResampleBeforeRelativePositionFilterOn();
+    f->IntermediateSpacingFlagOn();
     f->SetIntermediateSpacing(mArgsInfo.spacing_arg);
   }
+  else {
+    f->IntermediateSpacingFlagOff();
+  }
 
   f->SetFuzzyThreshold(mArgsInfo.threshold_arg);
   f->SetRemoveObjectFlag(!mArgsInfo.doNotRemoveObject_flag);
   f->SetAutoCropFlag(!mArgsInfo.noAutoCrop_flag);
   f->SetCombineWithOrFlag(mArgsInfo.combineWithOr_flag);
   f->SetInverseOrientationFlag(mArgsInfo.inverse_flag);
+  
 }
 
 //--------------------------------------------------------------------
@@ -112,7 +116,13 @@ UpdateWithInputImageType()
 
     // Set options only for SliceBySliceRelativePositionFilter
     filter->SetDirection(mArgsInfo.direction_arg);
-    filter->SetUniqueConnectedComponentBySlice(mArgsInfo.uniqueCCL_flag);
+    filter->SetUniqueConnectedComponentBySliceFlag(mArgsInfo.uniqueCCL_flag);
+    if (mArgsInfo.uniqueObjectCCL_flag) {
+      filter->UseTheLargestObjectCCLFlagOn();
+    }
+    else {
+      filter->UseTheLargestObjectCCLFlagOff();
+    }
     
     // Go !
     filter->Update();