ITK  4.2.0
Insight Segmentation and Registration Toolkit
itkAzimuthElevationToCartesianTransform.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef __itkAzimuthElevationToCartesianTransform_h
19 #define __itkAzimuthElevationToCartesianTransform_h
20 
21 #include "itkAffineTransform.h"
22 #include "vnl/vnl_math.h"
23 
24 namespace itk
25 {
79 template< class TScalarType = float, // Data type for scalars
80  unsigned int NDimensions = 3 >
81 // (e.g. float or double)
83  public AffineTransform< TScalarType, NDimensions >
84 {
85 public:
91 
93  itkStaticConstMacro(SpaceDimension, unsigned int, NDimensions);
94  itkStaticConstMacro( ParametersDimension, unsigned int,
95  NDimensions * ( NDimensions + 1 ) );
97 
100 
102  itkNewMacro(Self);
103 
105  typedef typename Superclass::ParametersType ParametersType;
106 
108  typedef typename Superclass::JacobianType JacobianType;
109 
111  typedef typename Superclass::ScalarType ScalarType;
112 
114  typedef typename Superclass::InputPointType InputPointType;
115  typedef typename Superclass::OutputPointType OutputPointType;
116 
118  typedef Matrix< TScalarType, itkGetStaticConstMacro(SpaceDimension),
119  itkGetStaticConstMacro(SpaceDimension) > MatrixType;
120 
122  void SetAzimuthElevationToCartesianParameters(
123  const double sampleSize,
124  const double blanking,
125  const long maxAzimuth,
126  const long maxElevation,
127  const double azimuthAngleSeparation,
128  const double elevationAngleSeparation);
129 
130  void SetAzimuthElevationToCartesianParameters(const double sampleSize,
131  const double blanking,
132  const long maxAzimuth,
133  const long maxElevation);
134 
136  OutputPointType TransformPoint(const InputPointType & point) const;
137 
139  inline InputPointType BackTransform(const OutputPointType & point) const
140  {
141  InputPointType result;
142 
143  if ( m_ForwardAzimuthElevationToPhysical )
144  {
145  result = static_cast< InputPointType >( TransformCartesianToAzEl(point) );
146  }
147  else
148  {
149  result = static_cast< InputPointType >( TransformAzElToCartesian(point) );
150  }
151  return result;
152  }
153 
154  inline InputPointType BackTransformPoint(const OutputPointType & point) const
155  {
156  return BackTransform(point);
157  }
158 
161  void SetForwardAzimuthElevationToCartesian();
162 
165  void SetForwardCartesianToAzimuthElevation();
166 
169  OutputPointType TransformAzElToCartesian(const InputPointType & point) const;
170 
173  OutputPointType TransformCartesianToAzEl(const OutputPointType & point) const;
174 
179  itkSetMacro(MaxAzimuth, long);
180 
185  itkSetMacro(MaxElevation, long);
186 
188  itkSetMacro(RadiusSampleSize, double);
189 
191  itkSetMacro(AzimuthAngularSeparation, double);
192 
194  itkSetMacro(ElevationAngularSeparation, double);
195 
197  itkSetMacro(FirstSampleDistance, double);
198 protected:
199 
202 
205 
207  void PrintSelf(std::ostream & s, Indent indent) const;
208 
209 private:
210  AzimuthElevationToCartesianTransform(const Self &); // purposely not
211  // implemented
212  void operator=(const Self &); //purposely not
213 
214  // implemented
215 
223 }; //class AzimuthElevationToCartesianTransform
224 } // namespace itk
225 
226 // Define instantiation macro for this template.
227 #define ITK_TEMPLATE_AzimuthElevationToCartesianTransform(_, EXPORT, TypeX, TypeY) \
228  namespace itk \
229  { \
230  _( 2 ( class EXPORT AzimuthElevationToCartesianTransform< ITK_TEMPLATE_2 TypeX > ) ) \
231  namespace Templates \
232  { \
233  typedef AzimuthElevationToCartesianTransform< ITK_TEMPLATE_2 TypeX > \
234  AzimuthElevationToCartesianTransform##TypeY; \
235  } \
236  }
237 
238 #if ITK_TEMPLATE_EXPLICIT
239 #include "Templates/itkAzimuthElevationToCartesianTransform+-.h"
240 #endif
241 
242 #if ITK_TEMPLATE_TXX
243 #include "itkAzimuthElevationToCartesianTransform.hxx"
244 #endif
245 
246 #endif /* __itkAzimuthElevationToCartesianTransform_h */
247