18 #ifndef itkPhasedArray3DSpecialCoordinatesImage_h
19 #define itkPhasedArray3DSpecialCoordinatesImage_h
94 template <
typename TPixel>
145 static constexpr
unsigned int ImageDimension = 3;
188 template <
typename TCoordRep,
typename TIndexRep>
193 const RegionType region = this->GetLargestPossibleRegion();
194 const double maxAzimuth = region.
GetSize(0) - 1;
195 const double maxElevation = region.
GetSize(1) - 1;
202 azimuth = std::atan(point[0] / point[2]);
203 elevation = std::atan(point[1] / point[2]);
205 const TCoordRep radius = std::sqrt(point[0] * point[0] + point[1] * point[1] + point[2] * point[2]);
208 index[0] = static_cast<TCoordRep>((azimuth / m_AzimuthAngularSeparation) + (maxAzimuth / 2.0));
209 index[1] = static_cast<TCoordRep>((elevation / m_ElevationAngularSeparation) + (maxElevation / 2.0));
210 index[2] = static_cast<TCoordRep>(((radius - m_FirstSampleDistance) / m_RadiusSampleSize));
213 const bool isInside = region.
IsInside(index);
222 template <
typename TCoordRep>
226 const RegionType region = this->GetLargestPossibleRegion();
227 const double maxAzimuth = region.
GetSize(0) - 1;
228 const double maxElevation = region.
GetSize(1) - 1;
236 azimuth = std::atan(point[0] / point[2]);
237 elevation = std::atan(point[1] / point[2]);
239 const TCoordRep radius = std::sqrt(point[0] * point[0] + point[1] * point[1] + point[2] * point[2]);
242 index[0] = static_cast<IndexValueType>((azimuth / m_AzimuthAngularSeparation) + (maxAzimuth / 2.0));
243 index[1] = static_cast<IndexValueType>((elevation / m_ElevationAngularSeparation) + (maxElevation / 2.0));
244 index[2] = static_cast<IndexValueType>(((radius - m_FirstSampleDistance) / m_RadiusSampleSize));
247 const bool isInside = region.
IsInside(index);
256 template <
typename TCoordRep,
typename TIndexRep>
261 const RegionType region = this->GetLargestPossibleRegion();
262 const double maxAzimuth = region.
GetSize(0) - 1;
263 const double maxElevation = region.
GetSize(1) - 1;
267 const TCoordRep azimuth = (index[0] - (maxAzimuth / 2.0)) * m_AzimuthAngularSeparation;
268 const TCoordRep elevation = (index[1] - (maxElevation / 2.0)) * m_ElevationAngularSeparation;
269 const TCoordRep radius = (index[2] * m_RadiusSampleSize) + m_FirstSampleDistance;
272 const TCoordRep tanOfAzimuth = std::tan(azimuth);
273 const TCoordRep tanOfElevation = std::tan(elevation);
276 static_cast<TCoordRep>(radius / std::sqrt(1 + tanOfAzimuth * tanOfAzimuth + tanOfElevation * tanOfElevation));
277 point[1] = static_cast<TCoordRep>(point[2] * tanOfElevation);
278 point[0] = static_cast<TCoordRep>(point[2] * tanOfAzimuth);
286 template <
typename TCoordRep>
290 const RegionType region = this->GetLargestPossibleRegion();
291 const double maxAzimuth = region.
GetSize(0) - 1;
292 const double maxElevation = region.
GetSize(1) - 1;
296 const TCoordRep azimuth = (static_cast<double>(index[0]) - (maxAzimuth / 2.0)) * m_AzimuthAngularSeparation;
297 const TCoordRep elevation = (static_cast<double>(index[1]) - (maxElevation / 2.0)) * m_ElevationAngularSeparation;
298 const TCoordRep radius = (static_cast<double>(index[2]) * m_RadiusSampleSize) + m_FirstSampleDistance;
301 const TCoordRep tanOfAzimuth = std::tan(azimuth);
302 const TCoordRep tanOfElevation = std::tan(elevation);
305 static_cast<TCoordRep>(radius / std::sqrt(1.0 + tanOfAzimuth * tanOfAzimuth + tanOfElevation * tanOfElevation));
306 point[1] = static_cast<TCoordRep>(point[2] * tanOfElevation);
307 point[0] = static_cast<TCoordRep>(point[2] * tanOfAzimuth);
311 itkSetMacro(AzimuthAngularSeparation,
double);
314 itkSetMacro(ElevationAngularSeparation,
double);
317 itkSetMacro(RadiusSampleSize,
double);
320 itkSetMacro(FirstSampleDistance,
double);
322 template <
typename TCoordRep>
326 template <
typename TCoordRep>
346 NeighborhoodAccessorFunctorType
353 const NeighborhoodAccessorFunctorType
362 m_RadiusSampleSize = 1;
363 m_AzimuthAngularSeparation = 1 * (2.0 *
itk::Math::pi / 360.0);
365 m_ElevationAngularSeparation = 1 * (2.0 *
itk::Math::pi / 360.0);
367 m_FirstSampleDistance = 0;
372 PrintSelf(std::ostream & os,
Indent indent)
const override;
382 #ifndef ITK_MANUAL_INSTANTIATION
383 # include "itkPhasedArray3DSpecialCoordinatesImage.hxx"