NifTK
16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
|
Class to project a ray through a 3D volume. More...
Public Types | |
typedef itk::Point< TCoordRep, 3 > | InputPointType |
typedef itk::Point< TCoordRep, 2 > | OutputPointType |
typedef TInputImage | InputImageType |
typedef InputImageType::PixelType | PixelType |
typedef InputImageType::IndexType | IndexType |
typedef InputImageType::SizeType | SizeType |
typedef InputImageType::OffsetValueType | OffsetValueType |
typedef itk::Matrix< double, 4, 4 > | ProjectionMatrixType |
Public Member Functions | |
Ray () | |
Constructor. More... | |
virtual | ~Ray () |
Destructor. More... | |
void | SetProjectionMatrix (const ProjectionMatrixType input) |
Set the combined affine and projection matrix. More... | |
void | SetImage (const InputImageType *input) |
bool | SetRay (OutputPointType RayPosn) |
void | SetProjectionResolution2Dmm (double xRes, double yRes) |
double | GetCurrentIntensity (void) const |
Return the interpolated intensity of the current ray point. More... | |
double | GetRayPointSpacing (void) const |
Return the ray point spacing in mm. More... | |
int | GetNumberOfRayPoints (void) |
Return the number of points on the ray. More... | |
void | GetBilinearCoefficients (double &y, double &z) const |
Get the the bilinear coefficient for the current ray point. More... | |
PixelType ** | GetRayIntersectionVoxels (void) |
const int * | GetRayIntersectionVoxelIndex (void) const |
Get the voxel index of the intersection. More... | |
int | GetTraversalDirection (void) |
Get the traversal direction. More... | |
bool | Integrate (double &integral) |
Integrate the interpolated intensities along the ray and return the result. More... | |
bool | IntegrateAboveThreshold (double &integral, double threshold) |
Integrate the interpolated intensities above a given threshold, along the ray and return the result. More... | |
bool | IncrementRayVoxelIntensities (double increment) |
Increment each of the intensities of the 4 planar voxels surrounding every point along the ray using bilinear interpolation. More... | |
void | IncrementIntensities (double increment) |
Increment each of the intensities of the 4 planar voxels surrounding the current ray point using bilinear interpolation. More... | |
void | IncrementIntensities (void) |
Increment each of the intensities of the 4 planar voxels surrounding the current ray point by one. More... | |
void | Reset (void) |
Reset the iterator to the start of the ray. More... | |
bool | NextPoint (void) |
Step along the ray. More... | |
Protected Types | |
enum | TraversalDirection { UNDEFINED_DIRECTION =0, TRANSVERSE_IN_X, TRANSVERSE_IN_Y, TRANSVERSE_IN_Z, LAST_DIRECTION } |
Protected Member Functions | |
void | ZeroState () |
Set the initial zero state of the object. More... | |
void | Initialise (void) |
Initialise the object. More... | |
void | EndPointsInVoxels (void) |
Calculate the endpoint coordinats of the ray in voxels. More... | |
void | CalcDirnVector (void) |
bool | AdjustRayLength (void) |
void | InitialiseVoxelPointers (void) |
void | IncrementVoxelPointers (void) |
Increment the voxel pointers surrounding the current point on the ray. More... | |
void | RecordVolumeDimensions (void) |
Record volume dimensions and resolution. More... | |
void | DefineCorners (void) |
Define the corners of the volume. More... | |
void | CalcPlanesAndCorners (void) |
Calculate the planes which define the volume. More... | |
bool | CalcRayIntercepts (void) |
Calculate the ray intercepts with the volume. More... | |
void | Line3D (double x2D, double y2D, double r[3], double u[3]) |
Calculate the equation of the ray throught the volume. More... | |
Protected Attributes | |
const InputImageType * | m_Image |
bool | m_ValidRay |
Flag indicating whether the current ray is valid. More... | |
double | m_RayPosition2Dmm [2] |
The ray intercept 2D coordinate. More... | |
double | m_ProjectionResolution2Dmm [2] |
The resolution of the 2D projection image. More... | |
double | m_RayVoxelStartPosition [3] |
The start position of the ray in voxels. More... | |
double | m_RayVoxelEndPosition [3] |
The end coordinate of the ray in voxels. More... | |
double | m_Position3Dvox [3] |
The current coordinate on the ray in voxels. More... | |
double | m_VoxelIncrement [3] |
TraversalDirection | m_TraversalDirection |
The direction in which the ray is incremented thorough the volume (x, y or z). More... | |
int | m_TotalRayVoxelPlanes |
The total number of planes of voxels traversed by the ray. More... | |
int | m_NumVoxelPlanesTraversed |
The current number of planes of voxels traversed by the ray. More... | |
PixelType * | m_RayIntersectionVoxels [4] |
Pointers to the current four voxels surrounding the ray's trajectory. More... | |
int | m_RayIntersectionVoxelIndex [3] |
int | m_NumberOfVoxelsInX |
The dimension in voxels of the 3D volume in along the x axis. More... | |
int | m_NumberOfVoxelsInY |
The dimension in voxels of the 3D volume in along the y axis. More... | |
int | m_NumberOfVoxelsInZ |
The dimension in voxels of the 3D volume in along the z axis. More... | |
double | m_VoxelDimensionInX |
Voxel dimension in x. More... | |
double | m_VoxelDimensionInY |
Voxel dimension in y. More... | |
double | m_VoxelDimensionInZ |
Voxel dimension in z. More... | |
double | m_RayStartCoordInMM [3] |
The coordinate of the point at which the ray enters the volume in mm. More... | |
double | m_RayEndCoordInMM [3] |
The coordinate of the point at which the ray exits the volume in mm. More... | |
double | m_BoundingPlane [6][4] |
Planes which define the boundary of the volume in mm (six planes and four parameters: Ax+By+Cz+D). More... | |
double | m_BoundingCorner [8][3] |
The eight corners of the volume (x,y,z coordinates for each). More... | |
double | m_CurrentRayPositionInMM [3] |
The position of the ray in 3D. More... | |
double | m_RayDirectionInMM [3] |
The direction of the ray. More... | |
ProjectionMatrixType | m_ProjectionMatrix |
The combined affine and perspective transformation. More... | |
Class to project a ray through a 3D volume.
typedef InputImageType::IndexType itk::Ray< TInputImage, TCoordRep >::IndexType |
typedef TInputImage itk::Ray< TInputImage, TCoordRep >::InputImageType |
typedef itk::Point<TCoordRep, 3> itk::Ray< TInputImage, TCoordRep >::InputPointType |
typedef InputImageType::OffsetValueType itk::Ray< TInputImage, TCoordRep >::OffsetValueType |
typedef itk::Point<TCoordRep, 2> itk::Ray< TInputImage, TCoordRep >::OutputPointType |
typedef InputImageType::PixelType itk::Ray< TInputImage, TCoordRep >::PixelType |
typedef itk::Matrix<double, 4, 4> itk::Ray< TInputImage, TCoordRep >::ProjectionMatrixType |
The combined affine and perspective projection matrix type. NB: defined as a square matrix because ITK does not appear to support matrix multiplication of non square matrices.
typedef InputImageType::SizeType itk::Ray< TInputImage, TCoordRep >::SizeType |
|
protected |
Constructor.
|
inlinevirtual |
Destructor.
|
protected |
Reduce the length of the ray until both start and end coordinates lie inside the volume.
|
protected |
Calculate the incremental direction vector in voxels, 'dVoxel', required to traverse the ray.
|
protected |
Calculate the planes which define the volume.
Member function to calculate the equations of the planes of 4 of the sides of the volume, calculate the positions of the 8 corners of the volume in mm in World, also calculate the values of the slopes of the lines which go to make up the volume( defined as lines in cube x,y,z dirn and then each of these lines has a slope in the world x,y,z dirn [3]) and finally also to return the length of the sides of the lines in mm.
|
protected |
Calculate the ray intercepts with the volume.
See where the ray cuts the volume, check that truncation does not occur, if not, then start ray where it first intercepts the volume and set x_max to be where it leaves the volume.
|
protected |
Define the corners of the volume.
|
protected |
Calculate the endpoint coordinats of the ray in voxels.
void itk::Ray< TInputImage, TCoordRep >::GetBilinearCoefficients | ( | double & | y, |
double & | z | ||
) | const |
Get the the bilinear coefficient for the current ray point.
double itk::Ray< TInputImage, TCoordRep >::GetCurrentIntensity | ( | void | ) | const |
Return the interpolated intensity of the current ray point.
|
inline |
Return the number of points on the ray.
|
inline |
Get the voxel index of the intersection.
|
inline |
|
inline |
Return the ray point spacing in mm.
|
inline |
Get the traversal direction.
void itk::Ray< TInputImage, TCoordRep >::IncrementIntensities | ( | double | increment | ) |
Increment each of the intensities of the 4 planar voxels surrounding the current ray point using bilinear interpolation.
increment Intensity increment for each of the current 4 voxels
void itk::Ray< TInputImage, TCoordRep >::IncrementIntensities | ( | void | ) |
Increment each of the intensities of the 4 planar voxels surrounding the current ray point by one.
bool itk::Ray< TInputImage, TCoordRep >::IncrementRayVoxelIntensities | ( | double | increment | ) |
Increment each of the intensities of the 4 planar voxels surrounding every point along the ray using bilinear interpolation.
increment Intensity increment for each of the current 4 voxels
|
protected |
Increment the voxel pointers surrounding the current point on the ray.
|
protected |
Initialise the object.
|
protected |
Obtain pointers to the four voxels surrounding the point where the ray enters the volume.
|
inline |
Integrate the interpolated intensities along the ray and return the result.
This routine can be called after instantiating the ray and calling SetProjectionCoord2D() or Reset(). It may then be called as many times thereafter for different 2D projection coordinates.
integral | The integrated intensities along the ray. |
bool itk::Ray< TInputImage, TCoordRep >::IntegrateAboveThreshold | ( | double & | integral, |
double | threshold | ||
) |
Integrate the interpolated intensities above a given threshold, along the ray and return the result.
This routine can be called after instantiating the ray and calling SetProjectionCoord2D() or Reset(). It may then be called as many times thereafter for different 2D projection coordinates.
integral | The integrated intensities along the ray. |
threshold | The integration threshold [default value: 0] |
|
protected |
Calculate the equation of the ray throught the volume.
|
protected |
Record volume dimensions and resolution.
void itk::Ray< TInputImage, TCoordRep >::Reset | ( | void | ) |
Reset the iterator to the start of the ray.
|
inline |
Set the image class
|
inline |
Set the combined affine and projection matrix.
|
inline |
Set the resolution of the 2D projection image. This is used to normalise the projected intensities to ensure the back-projected 3D image will have similar sum of intensities to the original volume.
bool itk::Ray< TInputImage, TCoordRep >::SetRay | ( | OutputPointType | RayPosn | ) |
Initialise the ray using the position of a point on the 2D projection image
RayPosn | The position of the ray in 2D (mm). |
|
protected |
Set the initial zero state of the object.
|
protected |
The eight corners of the volume (x,y,z coordinates for each).
|
protected |
Planes which define the boundary of the volume in mm (six planes and four parameters: Ax+By+Cz+D).
|
protected |
The position of the ray in 3D.
|
protected |
|
protected |
The dimension in voxels of the 3D volume in along the x axis.
|
protected |
The dimension in voxels of the 3D volume in along the y axis.
|
protected |
The dimension in voxels of the 3D volume in along the z axis.
|
protected |
The current number of planes of voxels traversed by the ray.
|
protected |
The current coordinate on the ray in voxels.
NB. Two of the components of this coordinate (i.e. those lying within the planes of voxels being traversed) will be shifted by half a voxel. This enables indices of the neighbouring voxels within the plane to be determined by simply casting to 'int' and optionally adding 1.
|
protected |
The combined affine and perspective transformation.
|
protected |
The resolution of the 2D projection image.
|
protected |
The direction of the ray.
|
protected |
The coordinate of the point at which the ray exits the volume in mm.
|
protected |
The voxel coordinate of the bottom-left voxel of the current four voxels surrounding the ray's trajectory.
|
protected |
Pointers to the current four voxels surrounding the ray's trajectory.
|
protected |
The ray intercept 2D coordinate.
|
protected |
The coordinate of the point at which the ray enters the volume in mm.
|
protected |
The end coordinate of the ray in voxels.
NB. Two of the components of this coordinate (i.e. those lying within the planes of voxels being traversed) will be shifted by half a voxel. This enables indices of the neighbouring voxels within the plane to be determined by simply casting to 'int' and optionally adding 1.
|
protected |
The start position of the ray in voxels.
NB. Two of the components of this coordinate (i.e. those lying within the planes of voxels being traversed) will be shifted by half a voxel. This enables indices of the neighbouring voxels within the plane to be determined by simply casting to 'int' and optionally adding 1.
|
protected |
The total number of planes of voxels traversed by the ray.
|
protected |
The direction in which the ray is incremented thorough the volume (x, y or z).
|
protected |
Flag indicating whether the current ray is valid.
|
protected |
Voxel dimension in x.
|
protected |
Voxel dimension in y.
|
protected |
Voxel dimension in z.
|
protected |
The incremental direction vector of the ray in voxels.