18 #ifndef itkPhasedArray3DSpecialCoordinatesImage_h
19 #define itkPhasedArray3DSpecialCoordinatesImage_h
94 template<
typename TPixel >
146 static constexpr
unsigned int ImageDimension = 3;
189 template<
typename TCoordRep,
typename TIndexRep >
194 const RegionType region = this->GetLargestPossibleRegion();
195 const double maxAzimuth = region.
GetSize(0) - 1;
196 const double maxElevation = region.
GetSize(1) - 1;
201 if( point[2] != 0.0 )
203 azimuth = std::atan(point[0] / point[2]);
204 elevation = std::atan(point[1] / point[2]);
206 const TCoordRep radius = std::sqrt(point[0] * point[0]
207 + point[1] * point[1]
208 + point[2] * point[2]);
211 index[0] =
static_cast< TCoordRep
>( ( azimuth / m_AzimuthAngularSeparation )
212 + ( maxAzimuth / 2.0 ) );
213 index[1] =
static_cast< TCoordRep
>( ( elevation / m_ElevationAngularSeparation )
214 + ( maxElevation / 2.0 ) );
215 index[2] =
static_cast< TCoordRep
>( ( ( radius - m_FirstSampleDistance )
216 / m_RadiusSampleSize ) );
219 const bool isInside = region.
IsInside(index);
228 template<
typename TCoordRep >
233 const RegionType region = this->GetLargestPossibleRegion();
234 const double maxAzimuth = region.
GetSize(0) - 1;
235 const double maxElevation = region.
GetSize(1) - 1;
241 if( point[2] != 0.0 )
243 azimuth = std::atan(point[0] / point[2]);
244 elevation = std::atan(point[1] / point[2]);
246 const TCoordRep radius = std::sqrt(point[0] * point[0]
247 + point[1] * point[1]
248 + point[2] * point[2]);
252 ( azimuth / m_AzimuthAngularSeparation )
253 + ( maxAzimuth / 2.0 ) );
255 ( elevation / m_ElevationAngularSeparation )
256 + ( maxElevation / 2.0 ) );
258 ( ( radius - m_FirstSampleDistance )
259 / m_RadiusSampleSize ) );
262 const bool isInside = region.
IsInside(index);
271 template<
typename TCoordRep,
typename TIndexRep >
276 const RegionType region = this->GetLargestPossibleRegion();
277 const double maxAzimuth = region.
GetSize(0) - 1;
278 const double maxElevation = region.
GetSize(1) - 1;
282 const TCoordRep azimuth = ( index[0] - ( maxAzimuth / 2.0 ) )
283 * m_AzimuthAngularSeparation;
284 const TCoordRep elevation = ( index[1] - ( maxElevation / 2.0 ) )
285 * m_ElevationAngularSeparation;
286 const TCoordRep radius = ( index[2] * m_RadiusSampleSize ) + m_FirstSampleDistance;
289 const TCoordRep tanOfAzimuth = std::tan(azimuth);
290 const TCoordRep tanOfElevation = std::tan(elevation);
292 point[2] =
static_cast< TCoordRep
>( radius
294 + tanOfAzimuth * tanOfAzimuth
295 + tanOfElevation * tanOfElevation) );
296 point[1] =
static_cast< TCoordRep
>( point[2] * tanOfElevation );
297 point[0] =
static_cast< TCoordRep
>( point[2] * tanOfAzimuth );
305 template<
typename TCoordRep >
310 const RegionType region = this->GetLargestPossibleRegion();
311 const double maxAzimuth = region.
GetSize(0) - 1;
312 const double maxElevation = region.
GetSize(1) - 1;
316 const TCoordRep azimuth =
317 (
static_cast< double >( index[0] ) - ( maxAzimuth / 2.0 ) )
318 * m_AzimuthAngularSeparation;
319 const TCoordRep elevation =
320 (
static_cast< double >( index[1] ) - ( maxElevation / 2.0 ) )
321 * m_ElevationAngularSeparation;
322 const TCoordRep radius =
323 (
static_cast< double >( index[2] ) * m_RadiusSampleSize )
324 + m_FirstSampleDistance;
327 const TCoordRep tanOfAzimuth = std::tan(azimuth);
328 const TCoordRep tanOfElevation = std::tan(elevation);
330 point[2] =
static_cast< TCoordRep
>(
332 1.0 + tanOfAzimuth * tanOfAzimuth + tanOfElevation * tanOfElevation) );
333 point[1] =
static_cast< TCoordRep
>( point[2] * tanOfElevation );
334 point[0] =
static_cast< TCoordRep
>( point[2] * tanOfAzimuth );
338 itkSetMacro(AzimuthAngularSeparation,
double);
341 itkSetMacro(ElevationAngularSeparation,
double);
344 itkSetMacro(RadiusSampleSize,
double);
347 itkSetMacro(FirstSampleDistance,
double);
349 template<
typename TCoordRep >
354 template<
typename TCoordRep >
379 m_RadiusSampleSize = 1;
380 m_AzimuthAngularSeparation = 1 * ( 2.0 *
itk::Math::pi / 360.0 );
382 m_ElevationAngularSeparation = 1 * ( 2.0 *
itk::Math::pi / 360.0 );
384 m_FirstSampleDistance = 0;
388 void PrintSelf(std::ostream & os,
Indent indent)
const override;
398 #ifndef ITK_MANUAL_INSTANTIATION
399 #include "itkPhasedArray3DSpecialCoordinatesImage.hxx"
static constexpr double pi_over_2
bool TransformPhysicalPointToIndex(const Point< TCoordRep, 3 > &point, IndexType &index) const
unsigned long SizeValueType
bool IsInside(const IndexType &index) const
AccessorType GetPixelAccessor()
double m_AzimuthAngularSeparation
static constexpr double pi
An image region represents a structured region of data.
double m_FirstSampleDistance
Templated n-dimensional nonrectilinear-coordinate image base class.
void TransformLocalVectorToPhysicalVector(FixedArray< TCoordRep, 3 > &) const
Implements a weak reference to an object.
typename PixelContainer::ConstPointer PixelContainerConstPointer
Simulate a standard C array with copy semnatics.
const AccessorType GetPixelAccessor() const
ImageBaseType::SizeType SizeType
Provides accessor interfaces to Get pixels and is meant to be used on pointers contained within Neigh...
ImageBaseType::IndexType IndexType
void TransformContinuousIndexToPhysicalPoint(const ContinuousIndex< TIndexRep, 3 > &index, Point< TCoordRep, 3 > &point) const
signed long IndexValueType
const NeighborhoodAccessorFunctorType GetNeighborhoodAccessor() const
Represent a n-dimensional size (bounds) of a n-dimensional image.
Represent a n-dimensional offset between two n-dimensional indexes of n-dimensional image...
const SizeType & GetSize() const
typename SizeType::SizeValueType SizeValueType
Provides a common API for pixel accessors for Image and VectorImage.
void TransformIndexToPhysicalPoint(const IndexType &index, Point< TCoordRep, 3 > &point) const
typename Superclass::IOPixelType IOPixelType
double m_RadiusSampleSize
A templated class holding a point in n-Dimensional image space.
double m_ElevationAngularSeparation
Control indentation during Print() invocation.
ImageBaseType::PointType PointType
Templated 3D nonrectilinear-coordinate image class for phased-array "range" images.
bool TransformPhysicalPointToContinuousIndex(const Point< TCoordRep, 3 > &point, ContinuousIndex< TIndexRep, 3 > &index) const
Get the continuous index from a physical point.
Give access to partial aspects a type.
Base class for most ITK classes.
ImageBaseType::RegionType RegionType
typename IndexType::IndexValueType IndexValueType
typename PixelContainer::Pointer PixelContainerPointer
Base class for all data objects in ITK.
PhasedArray3DSpecialCoordinatesImage()
NeighborhoodAccessorFunctorType GetNeighborhoodAccessor()
Defines an itk::Image front-end to a standard C-array.
void TransformPhysicalVectorToLocalVector(const FixedArray< TCoordRep, 3 > &, FixedArray< TCoordRep, 3 > &) const