From: David Sarrut Date: Fri, 4 Nov 2011 09:21:58 +0000 (+0100) Subject: Explicit units for Angle (rad or deg) X-Git-Tag: v1.3.0~174^2~14 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=1d365ed1e37fdf249a317a721140288f4dc259cc;p=clitk.git Explicit units for Angle (rad or deg) --- 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