From: David Sarrut Date: Fri, 3 Feb 2012 06:57:12 +0000 (+0100) Subject: Add K1 accessors X-Git-Tag: v1.4.0~261 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=526dcf68974f2717cb7498353d7401f14df0108f;p=clitk.git Add K1 accessors --- 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()) {