]> Creatis software - clitk.git/commitdiff
Add K1 accessors
authorDavid Sarrut <david.sarrut@gmail.com>
Fri, 3 Feb 2012 06:57:12 +0000 (07:57 +0100)
committerDavid Sarrut <david.sarrut@creatis.insa-lyon.fr>
Tue, 15 Jan 2013 10:22:12 +0000 (11:22 +0100)
itk/clitkAddRelativePositionConstraintToLabelImageFilter.h
itk/clitkAddRelativePositionConstraintToLabelImageFilter.txx

index 99465547695d6403dea2c271e55ffba93da8c14b..781775f0cc9541c488ca0ddfa4b8566b8ddc9779 100644 (file)
@@ -143,6 +143,9 @@ namespace clitk {
     itkGetConstMacro(Radius, double);
     itkSetMacro(Radius, double);
 
+    itkSetMacro(K1, double);
+    itkGetMacro(K1, double);
+
     typename FloatImageType::Pointer GetFuzzyMap() { return m_FuzzyMap; }
 
     // I dont want to verify inputs information
@@ -171,6 +174,7 @@ namespace clitk {
     bool m_FuzzyMapOnlyFlag;
     bool m_FastFlag;
     double m_Radius;
+    double m_K1;
 
     virtual void GenerateOutputInformation();
     virtual void GenerateInputRequestedRegion();
index ddcad0e16c445959381f5b197d7b94cce3f35ece..a3759f49fa2f69606401d0d5289faaf96c70f3d3 100644 (file)
@@ -65,6 +65,7 @@ AddRelativePositionConstraintToLabelImageFilter():
   FuzzyMapOnlyFlagOff();
   FastFlagOff();
   SetRadius(2.0);
+  SetK1(vcl_acos(-1.0)/2);
 }
 //--------------------------------------------------------------------
 
@@ -387,12 +388,9 @@ GenerateData()
     relPosFilter->SetInput(working_image);
     relPosFilter->SetAlpha1(m_Angle1[i]); // xy plane
     relPosFilter->SetAlpha2(m_Angle2[i]);
-    relPosFilter->SetK1(M_PI/2.0); // Opening parameter, default = pi/2
-
-    // relPosFilter->SetFast(true);
-    // relPosFilter->SetRadius(1); // seems sufficient in this case
-
+    relPosFilter->SetK1(GetK1());// M_PI/2.0); // Opening parameter, default = pi/2
     // relPosFilter->SetVerboseProgress(true);
+
     relPosFilter->Update();
     relPos = relPosFilter->GetOutput();
 
@@ -444,6 +442,7 @@ GenerateData()
       resampleFilter->SetGaussianFilteringEnabled(false);
       resampleFilter->Update();
       relPos = m_FuzzyMap = resampleFilter->GetOutput();
+      StopCurrentStep<FloatImageType>(relPos);
 
       // Need to put exactly the same size
       if (relPos->GetLargestPossibleRegion() != input->GetLargestPossibleRegion()) {