From 526dcf68974f2717cb7498353d7401f14df0108f Mon Sep 17 00:00:00 2001 From: David Sarrut Date: Fri, 3 Feb 2012 07:57:12 +0100 Subject: [PATCH] Add K1 accessors --- ...litkAddRelativePositionConstraintToLabelImageFilter.h | 4 ++++ ...tkAddRelativePositionConstraintToLabelImageFilter.txx | 9 ++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/itk/clitkAddRelativePositionConstraintToLabelImageFilter.h b/itk/clitkAddRelativePositionConstraintToLabelImageFilter.h index 9946554..781775f 100644 --- a/itk/clitkAddRelativePositionConstraintToLabelImageFilter.h +++ b/itk/clitkAddRelativePositionConstraintToLabelImageFilter.h @@ -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(); diff --git a/itk/clitkAddRelativePositionConstraintToLabelImageFilter.txx b/itk/clitkAddRelativePositionConstraintToLabelImageFilter.txx index ddcad0e..a3759f4 100644 --- a/itk/clitkAddRelativePositionConstraintToLabelImageFilter.txx +++ b/itk/clitkAddRelativePositionConstraintToLabelImageFilter.txx @@ -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(relPos); // Need to put exactly the same size if (relPos->GetLargestPossibleRegion() != input->GetLargestPossibleRegion()) { -- 2.47.1