]> Creatis software - clitk.git/commitdiff
add skipLastPyramidLevel option
authordsarrut <dsarrut>
Wed, 22 Sep 2010 03:23:29 +0000 (03:23 +0000)
committerdsarrut <dsarrut>
Wed, 22 Sep 2010 03:23:29 +0000 (03:23 +0000)
registration/clitkBLUTDIR.ggo
registration/clitkBLUTDIRGenericFilter.cxx

index 4d84fcebe1ddae0d0351d5b2d0eaca540effe2fc..4443da1d0defbda3c3ca8635c8edf4cc8da923db 100755 (executable)
@@ -82,6 +82,8 @@ option "upperBound"   -       "7: The upper bound"                                                    double  no      default="0.0"
 
 section "Registration"
 
-option "levels"                -       "Number of resolution levels"                                   int     no      default="1"                                             
+option "levels"                -       "Number of resolution levels"                                   int     no      default="1"
+option "skipLastPyramidLevel"          -       "Skip full resolution pyramid level"            flag    off
 option "intermediate"          -       "Write the coefficient image of the intermediate levels (provide levels filenames)"                                     string  no      multiple                                                
 
+
index 02ce0ddf3a0452f17694e54d949cfc68e772fb4a..2e0c756f363c8ac244f8789a94ac9ead17cd64d2 100755 (executable)
@@ -113,7 +113,7 @@ void BLUTDIRGenericFilter::InitializeImageType()
     typedef itk::SmartPointer<Self>  Pointer;
     itkNewMacro( Self );
   protected:
-    RegistrationInterfaceCommand() {};
+    RegistrationInterfaceCommand() { };
   public:
 
     // Registration
@@ -204,11 +204,22 @@ void BLUTDIRGenericFilter::InitializeImageType()
          m_Initializer->InitializeTransform();
          ParametersType* newParameters= new typename TransformType::ParametersType(m_Initializer->GetTransform()->GetNumberOfParameters());
 
+         // DS : if we want to skip the last pyramid level, force to only 1 iteration
+         DD(m_ArgsInfo.skipLastPyramidLevel_flag);
+         if (m_ArgsInfo.skipLastPyramidLevel_flag) {
+           DD(m_ArgsInfo.maxIt_arg);
+           std::cout << "I skip the last pyramid level : set max iteration to 1" << std::endl;
+           m_ArgsInfo.maxIt_arg = 1;
+           DD(m_ArgsInfo.maxIt_arg);
+         }
+
          // Reinitialize an Optimizer (!= number of parameters)
          m_GenericOptimizer = GenericOptimizerType::New();
          m_GenericOptimizer->SetArgsInfo(m_ArgsInfo);
          m_GenericOptimizer->SetMaximize(m_Maximize);
          m_GenericOptimizer->SetNumberOfParameters(m_Initializer->GetTransform()->GetNumberOfParameters());
+
+
          typedef itk::SingleValuedNonLinearOptimizer OptimizerType;
          OptimizerType::Pointer optimizer = m_GenericOptimizer->GetOptimizerPointer();
          optimizer->AddObserver( itk::IterationEvent(), m_CommandIterationUpdate);