18 #ifndef itkPhasedArray3DSpecialCoordinatesImage_h
19 #define itkPhasedArray3DSpecialCoordinatesImage_h
94 template<
typename TPixel >
144 itkStaticConstMacro(ImageDimension,
unsigned int, 3);
187 template<
typename TCoordRep,
typename TIndexRep >
192 const RegionType region = this->GetLargestPossibleRegion();
193 const double maxAzimuth = region.
GetSize(0) - 1;
194 const double maxElevation = region.
GetSize(1) - 1;
199 if( point[2] != 0.0 )
201 azimuth = std::atan(point[0] / point[2]);
202 elevation = std::atan(point[1] / point[2]);
204 const TCoordRep radius = std::sqrt(point[0] * point[0]
205 + point[1] * point[1]
206 + point[2] * point[2]);
209 index[0] =
static_cast< TCoordRep
>( ( azimuth / m_AzimuthAngularSeparation )
210 + ( maxAzimuth / 2.0 ) );
211 index[1] =
static_cast< TCoordRep
>( ( elevation / m_ElevationAngularSeparation )
212 + ( maxElevation / 2.0 ) );
213 index[2] =
static_cast< TCoordRep
>( ( ( radius - m_FirstSampleDistance )
214 / m_RadiusSampleSize ) );
217 const bool isInside = region.
IsInside(index);
226 template<
typename TCoordRep >
231 const RegionType region = this->GetLargestPossibleRegion();
232 const double maxAzimuth = region.
GetSize(0) - 1;
233 const double maxElevation = region.
GetSize(1) - 1;
239 if( point[2] != 0.0 )
241 azimuth = std::atan(point[0] / point[2]);
242 elevation = std::atan(point[1] / point[2]);
244 const TCoordRep radius = std::sqrt(point[0] * point[0]
245 + point[1] * point[1]
246 + point[2] * point[2]);
250 ( azimuth / m_AzimuthAngularSeparation )
251 + ( maxAzimuth / 2.0 ) );
253 ( elevation / m_ElevationAngularSeparation )
254 + ( maxElevation / 2.0 ) );
256 ( ( radius - m_FirstSampleDistance )
257 / m_RadiusSampleSize ) );
260 const bool isInside = region.
IsInside(index);
269 template<
typename TCoordRep,
typename TIndexRep >
274 const RegionType region = this->GetLargestPossibleRegion();
275 const double maxAzimuth = region.
GetSize(0) - 1;
276 const double maxElevation = region.
GetSize(1) - 1;
280 const TCoordRep azimuth = ( index[0] - ( maxAzimuth / 2.0 ) )
281 * m_AzimuthAngularSeparation;
282 const TCoordRep elevation = ( index[1] - ( maxElevation / 2.0 ) )
283 * m_ElevationAngularSeparation;
284 const TCoordRep radius = ( index[2] * m_RadiusSampleSize ) + m_FirstSampleDistance;
287 const TCoordRep tanOfAzimuth = std::tan(azimuth);
288 const TCoordRep tanOfElevation = std::tan(elevation);
290 point[2] =
static_cast< TCoordRep
>( radius
292 + tanOfAzimuth * tanOfAzimuth
293 + tanOfElevation * tanOfElevation) );
294 point[1] =
static_cast< TCoordRep
>( point[2] * tanOfElevation );
295 point[0] =
static_cast< TCoordRep
>( point[2] * tanOfAzimuth );
303 template<
typename TCoordRep >
308 const RegionType region = this->GetLargestPossibleRegion();
309 const double maxAzimuth = region.
GetSize(0) - 1;
310 const double maxElevation = region.
GetSize(1) - 1;
314 const TCoordRep azimuth =
315 (
static_cast< double >( index[0] ) - ( maxAzimuth / 2.0 ) )
316 * m_AzimuthAngularSeparation;
317 const TCoordRep elevation =
318 (
static_cast< double >( index[1] ) - ( maxElevation / 2.0 ) )
319 * m_ElevationAngularSeparation;
320 const TCoordRep radius =
321 (
static_cast< double >( index[2] ) * m_RadiusSampleSize )
322 + m_FirstSampleDistance;
325 const TCoordRep tanOfAzimuth = std::tan(azimuth);
326 const TCoordRep tanOfElevation = std::tan(elevation);
328 point[2] =
static_cast< TCoordRep
>(
330 1.0 + tanOfAzimuth * tanOfAzimuth + tanOfElevation * tanOfElevation) );
331 point[1] =
static_cast< TCoordRep
>( point[2] * tanOfElevation );
332 point[0] =
static_cast< TCoordRep
>( point[2] * tanOfAzimuth );
336 itkSetMacro(AzimuthAngularSeparation,
double);
339 itkSetMacro(ElevationAngularSeparation,
double);
342 itkSetMacro(RadiusSampleSize,
double);
345 itkSetMacro(FirstSampleDistance,
double);
347 template<
typename TCoordRep >
352 template<
typename TCoordRep >
377 m_RadiusSampleSize = 1;
378 m_AzimuthAngularSeparation = 1 * ( 2.0 *
itk::Math::pi / 360.0 );
380 m_ElevationAngularSeparation = 1 * ( 2.0 *
itk::Math::pi / 360.0 );
382 m_FirstSampleDistance = 0;
386 void PrintSelf(std::ostream & os,
Indent indent)
const ITK_OVERRIDE;
398 #ifndef ITK_MANUAL_INSTANTIATION
399 #include "itkPhasedArray3DSpecialCoordinatesImage.hxx"
Superclass::SpacingType SpacingType
bool TransformPhysicalPointToIndex(const Point< TCoordRep, 3 > &point, IndexType &index) const
bool IsInside(const IndexType &index) const
signed long IndexValueType
SmartPointer< const Self > ConstPointer
double m_AzimuthAngularSeparation
Superclass::RegionType RegionType
PixelContainer::Pointer PixelContainerPointer
An image region represents a structured region of data.
static ITK_CONSTEXPR_VAR double pi
double m_FirstSampleDistance
Templated n-dimensional nonrectilinear-coordinate image base class.
void TransformLocalVectorToPhysicalVector(FixedArray< TCoordRep, 3 > &) const
Implements a weak reference to an object.
unsigned long SizeValueType
AccessorType GetPixelAccessor(void)
Simulate a standard C array with copy semnatics.
SpecialCoordinatesImage< TPixel, 3 > Superclass
Provides accessor interfaces to Get pixels and is meant to be used on pointers contained within Neigh...
virtual ~PhasedArray3DSpecialCoordinatesImage() override
ImageBaseType::PointType PointType
void TransformContinuousIndexToPhysicalPoint(const ContinuousIndex< TIndexRep, 3 > &index, Point< TCoordRep, 3 > &point) const
Superclass::PointType PointType
DefaultPixelAccessor< PixelType > AccessorType
const NeighborhoodAccessorFunctorType GetNeighborhoodAccessor() const
const SizeType & GetSize() const
const AccessorType GetPixelAccessor(void) const
Provides a common API for pixel accessors for Image and VectorImage.
DefaultPixelAccessorFunctor< Self > AccessorFunctorType
WeakPointer< const Self > ConstWeakPointer
void TransformIndexToPhysicalPoint(const IndexType &index, Point< TCoordRep, 3 > &point) const
PixelContainer::ConstPointer PixelContainerConstPointer
double m_RadiusSampleSize
A templated class holding a point in n-Dimensional image space.
double m_ElevationAngularSeparation
Control indentation during Print() invocation.
ImageBaseType::SizeType SizeType
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.
ImportImageContainer< SizeValueType, PixelType > PixelContainer
Superclass::IOPixelType IOPixelType
SmartPointer< Self > Pointer
Give access to partial aspects a type.
A templated class holding a geometric point in n-Dimensional space.
NeighborhoodAccessorFunctor< Self > NeighborhoodAccessorFunctorType
Superclass::IndexValueType IndexValueType
PhasedArray3DSpecialCoordinatesImage Self
static ITK_CONSTEXPR_VAR double pi_over_2
Superclass::SizeType SizeType
Base class for all data objects in ITK.
IndexType::IndexValueType IndexValueType
PhasedArray3DSpecialCoordinatesImage()
NeighborhoodAccessorFunctorType GetNeighborhoodAccessor()
Superclass::SizeValueType SizeValueType
Superclass::IndexType IndexType
ImageBaseType::IndexType IndexType
Defines an itk::Image front-end to a standard C-array.
void TransformPhysicalVectorToLocalVector(const FixedArray< TCoordRep, 3 > &, FixedArray< TCoordRep, 3 > &) const
Superclass::OffsetType OffsetType