ITK  4.4.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  itkGetConstMacro(MaxAzimuth, long);
182 
187  itkSetMacro(MaxElevation, long);
188  itkGetConstMacro(MaxElevation, long);
190 
192  itkSetMacro(RadiusSampleSize, double);
193  itkGetConstMacro(RadiusSampleSize, double);
195 
197  itkSetMacro(AzimuthAngularSeparation, double);
198  itkGetConstMacro(AzimuthAngularSeparation, double);
200 
202  itkSetMacro(ElevationAngularSeparation, double);
203  itkGetConstMacro(ElevationAngularSeparation, double);
205 
207  itkSetMacro(FirstSampleDistance, double);
208  itkGetConstMacro(FirstSampleDistance, double);
210 
211 protected:
214 
217 
219  void PrintSelf(std::ostream & s, Indent indent) const;
220 
221 private:
222  AzimuthElevationToCartesianTransform(const Self &); // purposely not
223  // implemented
224  void operator=(const Self &); //purposely not
225 
226  // implemented
227 
235 }; //class AzimuthElevationToCartesianTransform
236 } // namespace itk
237 
238 #ifndef ITK_MANUAL_INSTANTIATION
239 #include "itkAzimuthElevationToCartesianTransform.hxx"
240 #endif
241 
242 #endif /* __itkAzimuthElevationToCartesianTransform_h */
243