From 1d365ed1e37fdf249a317a721140288f4dc259cc Mon Sep 17 00:00:00 2001 From: David Sarrut Date: Fri, 4 Nov 2011 10:21:58 +0100 Subject: [PATCH] Explicit units for Angle (rad or deg) --- ...ddRelativePositionConstraintToLabelImageFilter.h | 7 ++++--- ...RelativePositionConstraintToLabelImageFilter.txx | 13 ++++++++++++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/itk/clitkAddRelativePositionConstraintToLabelImageFilter.h b/itk/clitkAddRelativePositionConstraintToLabelImageFilter.h index ee0b17a..00edd71 100644 --- a/itk/clitkAddRelativePositionConstraintToLabelImageFilter.h +++ b/itk/clitkAddRelativePositionConstraintToLabelImageFilter.h @@ -92,9 +92,10 @@ namespace clitk { void AddOrientationType(OrientationTypeEnumeration orientation); void AddOrientationTypeString(std::string s); void ClearOrientationType(); - void AddAngles(double a, double b); - double GetAngle1(int i) { return m_Angle1[i]; } - double GetAngle2(int i) { return m_Angle2[i]; } + void AddAnglesInRad(double a, double b); + void AddAnglesInDeg(double a, double b); + double GetAngle1InRad(int i) { return m_Angle1[i]; } + double GetAngle2InRad(int i) { return m_Angle2[i]; } int GetNumberOfAngles(); std::string GetOrientationTypeString(int i) { return m_OrientationTypeString[i]; } std::vector & GetOrientationTypeString() { return m_OrientationTypeString; } diff --git a/itk/clitkAddRelativePositionConstraintToLabelImageFilter.txx b/itk/clitkAddRelativePositionConstraintToLabelImageFilter.txx index 1ea25f0..e25f98b 100644 --- a/itk/clitkAddRelativePositionConstraintToLabelImageFilter.txx +++ b/itk/clitkAddRelativePositionConstraintToLabelImageFilter.txx @@ -179,7 +179,7 @@ GenerateInputRequestedRegion() template void clitk::AddRelativePositionConstraintToLabelImageFilter:: -AddAngles(double a, double b) +AddAnglesInRad(double a, double b) { m_OrientationTypeString.push_back("Angle"); m_OrientationType.push_back(Angle); @@ -189,6 +189,17 @@ AddAngles(double a, double b) //-------------------------------------------------------------------- +//-------------------------------------------------------------------- +template +void +clitk::AddRelativePositionConstraintToLabelImageFilter:: +AddAnglesInDeg(double a, double b) +{ + AddAnglesInRad(clitk::deg2rad(a), clitk::deg2rad(b)); +} +//-------------------------------------------------------------------- + + //-------------------------------------------------------------------- template void -- 2.47.1