Grangeat-based 2D/3D image registration
Loading...
Searching...
No Matches
Functions
General Tools

Small functions used throughout the codebase. More...

Functions

template<typename T >
__host__ __device__ T reg23::Square (const T &x)
 Returns the square of the given value.
 
template<typename T >
__host__ __device__ T reg23::Modulo (const T &x, const T &y)
 Modulo operation that respect the sign.
 
template<typename T >
__host__ __device__ T reg23::Sign (const T &x)
 
template<typename T , std::size_t faceCount>
__host__ __device__ T reg23::RayConvexPolyhedronDistance (const std::array< Vec< T, 3 >, faceCount > &facePoints, const std::array< Vec< T, 3 >, faceCount > &faceOutUnitNormals, const Vec< T, 3 > &rayPoint, const Vec< T, 3 > &rayUnitDirection)
 Calculate the length of the intersection between a ray and a convex polyhedron.
 

Detailed Description

Small functions used throughout the codebase.

Function Documentation

◆ Modulo()

template<typename T >
__host__ __device__ T reg23::Modulo ( const T x,
const T y 
)

Modulo operation that respect the sign.

Template Parameters
TType of the parameters and result
Parameters
x
y
Returns
x modulo y, respecting the sign of x.

◆ RayConvexPolyhedronDistance()

template<typename T , std::size_t faceCount>
__host__ __device__ T reg23::RayConvexPolyhedronDistance ( const std::array< Vec< T, 3 >, faceCount > &  facePoints,
const std::array< Vec< T, 3 >, faceCount > &  faceOutUnitNormals,
const Vec< T, 3 > &  rayPoint,
const Vec< T, 3 > &  rayUnitDirection 
)

Calculate the length of the intersection between a ray and a convex polyhedron.

Template Parameters
TReal type
faceCountNumber of faces of the polyhedron
Parameters
facePointsAn array of points, one for each polyhedron face, where each point lies on its corresponding face
faceOutUnitNormalsAn array of unit vectors, one for each polyhedron face, where each vector is the outward-facing normal vector of its corresponding face
rayPointA point that lies on the given ray
rayUnitDirectionA unit vector parallel to the given ray's direction
Returns
The length of the section of the given ray that lies within the given polyhedron. If such a section doesn't exist, 0 is returned.

The polyhedron is defined by its faces. Each face is defined with an intersecting point and a unit normal vector. The ray is defined by an intersecting point and a unit direction vector. The ray is considered to be infinite; this function will return the same value if rayUnitDirection is multiplied by -1. The number of faces that the polyhedron has must be known at compile time.

◆ Sign()

template<typename T >
__host__ __device__ T reg23::Sign ( const T x)

◆ Square()

template<typename T >
__host__ __device__ T reg23::Square ( const T x)

Returns the square of the given value.

Template Parameters
TType of parameter and result
Parameters
xInput value
Returns
The input value squared using operator*