18#ifndef itkPhasedArray3DSpecialCoordinatesImage_h
19#define itkPhasedArray3DSpecialCoordinatesImage_h
94template <
typename TPixel>
126 using typename Superclass::IOPixelType;
145 static constexpr unsigned int ImageDimension = 3;
152 using typename Superclass::OffsetType;
172 using typename Superclass::SpacingType;
185 template <
typename TIndexRep,
typename TCoordinate>
189 const RegionType region = this->GetLargestPossibleRegion();
190 const double maxAzimuth = region.
GetSize(0) - 1;
191 const double maxElevation = region.
GetSize(1) - 1;
206 index[0] =
static_cast<TCoordinate
>((azimuth / m_AzimuthAngularSeparation) + (maxAzimuth / 2.0));
207 index[1] =
static_cast<TCoordinate
>((elevation / m_ElevationAngularSeparation) + (maxElevation / 2.0));
208 index[2] =
static_cast<TCoordinate
>(((radius - m_FirstSampleDistance) / m_RadiusSampleSize));
220 template <
typename TCoordinate,
typename TIndexRep>
221 ITK_NODISCARD(
"Call the overload which has the point as the only parameter and returns the index")
222 bool TransformPhysicalPointToContinuousIndex(const
Point<TCoordinate, 3> &
point,
225 index = this->TransformPhysicalPointToContinuousIndex<TIndexRep>(
point);
228 const bool isInside = this->GetLargestPossibleRegion().IsInside(index);
236 template <
typename TCoordinate>
240 const RegionType region = this->GetLargestPossibleRegion();
241 const double maxAzimuth = region.
GetSize(0) - 1;
242 const double maxElevation = region.
GetSize(1) - 1;
257 index[0] =
static_cast<IndexValueType>((azimuth / m_AzimuthAngularSeparation) + (maxAzimuth / 2.0));
258 index[1] =
static_cast<IndexValueType>((elevation / m_ElevationAngularSeparation) + (maxElevation / 2.0));
259 index[2] =
static_cast<IndexValueType>(((radius - m_FirstSampleDistance) / m_RadiusSampleSize));
271 template <
typename TCoordinate>
272 ITK_NODISCARD(
"Call the overload which has the point as the only parameter and returns the index")
275 index = this->TransformPhysicalPointToIndex(
point);
278 const bool isInside = this->GetLargestPossibleRegion().IsInside(index);
287 template <
typename TCoordinate,
typename TIndexRep>
292 const RegionType region = this->GetLargestPossibleRegion();
293 const double maxAzimuth = region.
GetSize(0) - 1;
294 const double maxElevation = region.
GetSize(1) - 1;
298 const TCoordinate azimuth = (index[0] - (maxAzimuth / 2.0)) * m_AzimuthAngularSeparation;
299 const TCoordinate elevation = (index[1] - (maxElevation / 2.0)) * m_ElevationAngularSeparation;
300 const TCoordinate radius = (index[2] * m_RadiusSampleSize) + m_FirstSampleDistance;
303 const TCoordinate tanOfAzimuth = std::tan(azimuth);
304 const TCoordinate tanOfElevation = std::tan(elevation);
307 static_cast<TCoordinate
>(radius / std::sqrt(1 + tanOfAzimuth * tanOfAzimuth + tanOfElevation * tanOfElevation));
308 point[1] =
static_cast<TCoordinate
>(
point[2] * tanOfElevation);
309 point[0] =
static_cast<TCoordinate
>(
point[2] * tanOfAzimuth);
313 template <
typename TCoordinate,
typename TIndexRep>
318 this->TransformContinuousIndexToPhysicalPoint(index,
point);
328 template <
typename TCoordinate>
332 const RegionType region = this->GetLargestPossibleRegion();
333 const double maxAzimuth = region.
GetSize(0) - 1;
334 const double maxElevation = region.
GetSize(1) - 1;
338 const TCoordinate azimuth = (
static_cast<double>(index[0]) - (maxAzimuth / 2.0)) * m_AzimuthAngularSeparation;
339 const TCoordinate elevation = (
static_cast<double>(index[1]) - (maxElevation / 2.0)) * m_ElevationAngularSeparation;
340 const TCoordinate radius = (
static_cast<double>(index[2]) * m_RadiusSampleSize) + m_FirstSampleDistance;
343 const TCoordinate tanOfAzimuth = std::tan(azimuth);
344 const TCoordinate tanOfElevation = std::tan(elevation);
347 static_cast<TCoordinate
>(radius / std::sqrt(1.0 + tanOfAzimuth * tanOfAzimuth + tanOfElevation * tanOfElevation));
348 point[1] =
static_cast<TCoordinate
>(
point[2] * tanOfElevation);
349 point[0] =
static_cast<TCoordinate
>(
point[2] * tanOfAzimuth);
353 template <
typename TCoordinate>
358 this->TransformIndexToPhysicalPoint(index,
point);
364 itkSetMacro(AzimuthAngularSeparation,
double);
367 itkSetMacro(ElevationAngularSeparation,
double);
370 itkSetMacro(RadiusSampleSize,
double);
373 itkSetMacro(FirstSampleDistance,
double);
375 template <
typename TCoordinate>
380 template <
typename TCoordinate>
400 NeighborhoodAccessorFunctorType
407 const NeighborhoodAccessorFunctorType
416 m_RadiusSampleSize = 1;
417 m_AzimuthAngularSeparation = 1 * (2.0 *
itk::Math::pi / 360.0);
419 m_ElevationAngularSeparation = 1 * (2.0 *
itk::Math::pi / 360.0);
421 m_FirstSampleDistance = 0;
429 double m_AzimuthAngularSeparation{};
430 double m_ElevationAngularSeparation{};
431 double m_RadiusSampleSize{};
432 double m_FirstSampleDistance{};
436#ifndef ITK_MANUAL_INSTANTIATION
437# include "itkPhasedArray3DSpecialCoordinatesImage.hxx"
A templated class holding a point in n-Dimensional image space.
Base class for all data objects in ITK.
Provides a common API for pixel accessors for Image and VectorImage.
Give access to partial aspects a type.
typename IndexType::IndexValueType IndexValueType
An image region represents a structured region of data.
const SizeType & GetSize() const
Defines an itk::Image front-end to a standard C-array.
Control indentation during Print() invocation.
Provides accessor interfaces to Get pixels and is meant to be used on pointers contained within Neigh...
Base class for most ITK classes.
Templated 3D nonrectilinear-coordinate image class for phased-array "range" images.
typename PixelContainer::ConstPointer PixelContainerConstPointer
const NeighborhoodAccessorFunctorType GetNeighborhoodAccessor() const
NeighborhoodAccessorFunctorType GetNeighborhoodAccessor()
~PhasedArray3DSpecialCoordinatesImage() override=default
typename PixelContainer::Pointer PixelContainerPointer
AccessorType GetPixelAccessor()
Point< TCoordinate, 3 > TransformIndexToPhysicalPoint(const IndexType &index) const
Point< TCoordinate, 3 > TransformContinuousIndexToPhysicalPoint(const ContinuousIndex< TIndexRep, 3 > &index) const
void TransformLocalVectorToPhysicalVector(FixedArray< TCoordinate, 3 > &) const
void TransformIndexToPhysicalPoint(const IndexType &index, Point< TCoordinate, 3 > &point) const
ContinuousIndex< TIndexRep, 3 > TransformPhysicalPointToContinuousIndex(const Point< TCoordinate, 3 > &point) const
PhasedArray3DSpecialCoordinatesImage()
const AccessorType GetPixelAccessor() const
IndexType TransformPhysicalPointToIndex(const Point< TCoordinate, 3 > &point) const
void PrintSelf(std::ostream &os, Indent indent) const override
void TransformPhysicalVectorToLocalVector(const FixedArray< TCoordinate, 3 > &, FixedArray< TCoordinate, 3 > &) const
void TransformContinuousIndexToPhysicalPoint(const ContinuousIndex< TIndexRep, 3 > &index, Point< TCoordinate, 3 > &point) const
A templated class holding a geometric point in n-Dimensional space.
Templated n-dimensional nonrectilinear-coordinate image base class.
Implements a weak reference to an object.
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
ImageBaseType::RegionType RegionType
ImageBaseType::IndexType IndexType
ImageBaseType::PointType PointType
ImageBaseType::SizeType SizeType
static constexpr double pi_over_2
static constexpr double pi
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
*par Constraints *The filter image with at least two dimensions and a vector *length of at least The theory supports extension to scalar but *the implementation of the itk vector classes do not **The template parameter TRealType must be floating point(float or double) or *a user-defined "real" numerical type with arithmetic operations defined *sufficient to compute derivatives. **\par Performance *This filter will automatically multithread if run with *SetUsePrincipleComponents
unsigned long SizeValueType