Classes | Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Friends

cmtk::UniformVolume Class Reference
[cmtkBase Library]

Uniform volume. More...

#include <cmtkUniformVolume.h>

Inheritance diagram for cmtk::UniformVolume:
Inheritance graph
[legend]
Collaboration diagram for cmtk::UniformVolume:
Collaboration graph
[legend]

List of all members.

Classes

class  ResampleTaskInfo
 Thread parameter block for volume resampling. More...

Public Types

typedef UniformVolume Self
 This class.
typedef Volume Superclass
 Superclass.
typedef SmartPointer< SelfSmartPtr
 Smart pointer to UniformVolume.
typedef SmartConstPointer< SelfSmartConstPtr
 Smart pointer to const UniformVolume.
typedef
Superclass::CoordinateRegionType 
CoordinateRegionType
 Region type.
typedef
Superclass::CoordinateVectorType 
CoordinateVectorType
 Index type.

Public Member Functions

const CoordinateVectorTypeDeltas () const
 Get pixel size vector.
CoordinateVectorTypeDeltas ()
 Get pixel size vector.
virtual ~UniformVolume ()
 Destructor.
 UniformVolume (const UniformVolume &other, const Types::Coordinate resolution=0, const bool allowUpsampling=false)
 Resample other volume to given resolution.
 UniformVolume (const DataGrid::IndexType &dims, const Self::CoordinateVectorType &size, TypedArray::SmartPtr &data=TypedArray::SmartPtr::Null)
 Create uniform volume "from scratch".
 UniformVolume (const DataGrid::IndexType &dims, const Types::Coordinate deltaX, const Types::Coordinate deltaY, const Types::Coordinate deltaZ, TypedArray::SmartPtr &data=TypedArray::SmartPtr::Null)
 Create uniform volume "from scratch".
bool GridMatches (const Self &other) const
 Test whether this grid matches another one, i.e., has the same pixel sizes.
virtual void ChangeCoordinateSpace (const std::string &newSpace)
 Change volume coordinate space.
std::string GetOrientationFromDirections () const
 Get anatomical orientation from space directions.
virtual void CreateDefaultIndexToPhysicalMatrix ()
 Create a default index-to-physical transformation matrix.
virtual AffineXform::MatrixType GetImageToPhysicalMatrix () const
 Get matrix that maps form image coordinates to physical space.
Self::SmartPtr Clone (const bool copyData)
 Create a physical copy of this object.
Self::SmartPtr Clone () const
Self::SmartPtr CloneGrid () const
 Create igsUniformObject with identical geometry but no data.
virtual Types::Coordinate GetDelta (const int axis) const
 Get delta (pixel size) in one dimension.
virtual Types::Coordinate GetMinDelta () const
 Get minimum grid spacing for all dimensions.
virtual Types::Coordinate GetMaxDelta () const
 Get maximum grid spacing for all dimensions.
virtual TypedArray::SmartPtr Resample (const UniformVolume &) const
 Resample other volume.
const UniformVolume::SmartPtr GetReoriented (const char *newOrientation=AnatomicalOrientation::ORIENTATION_STANDARD) const
 Get volume reoriented to a different anatomical axis alignment.
virtual UniformVolumeGetDownsampledAndAveraged (const int downsample, const bool approxIsotropic=false) const
 Downsampling constructor function.
virtual UniformVolumeGetDownsampledAndAveraged (const int(&downsample)[3]) const
 Downsampling constructor function.
UniformVolumeGetInterleavedSubVolume (const int axis, const int factor, const int idx) const
 Get interleaved sub-volume along given axis and with given interleave offset.
UniformVolumeGetInterleavedPaddedSubVolume (const int axis, const int factor, const int idx) const
 Get interleaved sub-volume along given axis and with given interleave offset, padded with empty image planes.
virtual void Mirror (const int axis=AXIS_X)
 Mirror volume and associated data.
virtual ScalarImageGetOrthoSlice (const int axis, const unsigned int plane) const
 Return orthogonal slice.
Self::SmartPtr ExtractSlice (const int axis, const int plane) const
 Extract orthogonal slice as a new volume.
virtual ScalarImageGetOrthoSliceInterp (const int axis, const Types::Coordinate location) const
 Return interpolated orthogonal slice.
virtual ScalarImageGetNearestOrthoSlice (const int axis, const Types::Coordinate location) const
 Return orthogonal slice by location.
virtual const
Self::CoordinateVectorType 
GetGradientAt (const int i, const int j, const int k)
 Get date gradient vector at pixel using central differences.
virtual void GetHessianAt (Matrix3x3< Types::DataItem > &H, const int i, const int j, const int k)
 Get data Hessian matrix at pixel using central differences.
template<class TData >
bool ProbeData (TData &result, const TData *dataPtr, const Self::CoordinateVectorType &location) const
 Get data value at specified coordinate.
bool ProbeNoXform (ProbeInfo &, const Self::CoordinateVectorType &) const
 Return linearly interpolated voxel without applying a transformation.
bool FindVoxel (const Self::CoordinateVectorType &location, int *const idx, Types::Coordinate *const from, Types::Coordinate *const to) const
 Find a voxel in the volume.
bool FindVoxel (const Self::CoordinateVectorType &location, int *const idx) const
 Find a voxel in the volume.
void GetVoxelIndexNoBounds (const Self::CoordinateVectorType &location, int *const idx) const
 Find a grid index inside or outside the volume.
bool FindVoxelByIndex (const Self::CoordinateVectorType &fracIndex, int *const idx, Types::Coordinate *const frac) const
 Find a voxel in the volume by fractional index.
const UniformVolume::RegionType GetGridRange (const Self::CoordinateVectorType &fromVOI, const Self::CoordinateVectorType &toVOI) const
 Get 3D grid region from continuous lower and upper corner.
virtual Types::Coordinate GetPlaneCoord (const int axis, const int plane) const
 Get plane coordinate.
virtual int GetCoordIndex (const int axis, const Types::Coordinate location) const
 Get grid index of slice with highest coordinate smaller than given.
virtual int GetClosestCoordIndex (const int axis, const Types::Coordinate location) const
 Get grid index corresponding (as close as possible) to coordinate.
virtual bool GetClosestGridPointIndex (const Self::CoordinateVectorType v, int *const xyz) const
 Get grid index corresponding (as close as possible) to coordinate.
virtual int GetTruncCoordIndex (const int axis, const Types::Coordinate location) const
 Get grid index corresponding to coordinate by truncation, not rounding.
virtual bool GetTruncGridPointIndex (const Self::CoordinateVectorType v, int *const xyz) const
 Get grid index corresponding to coordinate by truncation, not rounding.
virtual const
Self::CoordinateVectorType 
GetGridLocation (const int x, const int y, const int z) const
 Get a grid location in image coordinates.
virtual const
Self::CoordinateVectorType 
IndexToPhysical (const Self::CoordinateVectorType &idxV) const
 Get a grid location in physical coordinates.
virtual const
Self::CoordinateVectorType 
GetGridLocation (const size_t idx) const
 Get a grid coordinate by continuous pixel index.
void SetHighResCropRegion (const Self::CoordinateRegionType &crop)
 Set cropping region in real-world coordinates.
const Self::CoordinateRegionType GetHighResCropRegion () const
 Get cropped volume in real-world coordinates.
virtual void SetCropRegion (const Self::RegionType &region)
 Catch calls to inherited SetCropRegion() and reset high-res crop region.
Self::CoordinateVectorType GetCenterCropRegion () const
 Calculate volume center.
Self::SmartPtr GetCroppedVolume () const
 Return cropped uniform volume.
template<class TAccumulator >
ScalarImageComputeProjection (const int axis) const
 Return projection (e.g., MIP, sum) along one axis.
virtual Self::CoordinateVectorType GetCenterOfMass () const
 Get center of mass of pixel data.
virtual Self::CoordinateVectorType GetCenterOfMass (Self::CoordinateVectorType &firstOrderMoment) const
 Get center of mass of pixel data.
void GetPrincipalAxes (Matrix3x3< Types::Coordinate > &directions, Self::CoordinateVectorType &centerOfMass) const
 Get principal axes.

Public Attributes

CoordinateVectorType m_Delta
 Grid spacing for three dimensions.
AffineXform::MatrixType m_IndexToPhysicalMatrix
 Coordinate transformation from index to physical position.

Protected Member Functions

virtual SelfCloneVirtual (const bool copyData)
 Create a physical copy of this object.
virtual SelfCloneVirtual () const
virtual SelfCloneGridVirtual () const
 Virtual grid cloning constructor.

Private Member Functions

virtual SelfExtractSliceVirtual (const int axis, const int plane) const
 Extract orthogonal slice as a new volume.

Static Private Member Functions

static void ResampleThreadPoolExecuteGrey (void *const arg, const size_t taskIdx, const size_t taskCnt, const size_t threadIdx, const size_t threadCnt)
 Multi-threaded resampling for grey data.
static void ResampleThreadPoolExecuteLabels (void *const arg, const size_t taskIdx, const size_t taskCnt, const size_t threadIdx, const size_t threadCnt)
 Multi-threaded resampling for label data (using partial volume averaging).

Private Attributes

Self::CoordinateRegionType::SmartPtr m_HighResCropRegion
 Optional high-resolution crop region.

Friends

class WarpXform
 Friend declaration of WarpXform class.
class VolumeAxesHash
 Make axes hash a friend.
class VolumeGridToGridLookup
 Grid grid-to-grid lookup friend.
class ResampleThreadInfo
 Give thread parameter class access to local types.

Detailed Description

Uniform volume.

This class handles 3D isotropic data of any scalar type.

Definition at line 58 of file cmtkUniformVolume.h.


Member Typedef Documentation

Region type.

Reimplemented from cmtk::Volume.

Reimplemented in cmtk::ImageTemplate< TPixelType >.

Definition at line 76 of file cmtkUniformVolume.h.

Index type.

Reimplemented from cmtk::Volume.

Reimplemented in cmtk::ImageTemplate< TPixelType >.

Definition at line 79 of file cmtkUniformVolume.h.

This class.

Reimplemented from cmtk::Volume.

Reimplemented in cmtk::ImageTemplate< TPixelType >.

Definition at line 64 of file cmtkUniformVolume.h.

Smart pointer to const UniformVolume.

Reimplemented from cmtk::DataGrid.

Reimplemented in cmtk::ImageTemplate< TPixelType >.

Definition at line 73 of file cmtkUniformVolume.h.

Smart pointer to UniformVolume.

Reimplemented from cmtk::Volume.

Reimplemented in cmtk::ImageTemplate< TPixelType >.

Definition at line 70 of file cmtkUniformVolume.h.

Superclass.

Reimplemented from cmtk::Volume.

Reimplemented in cmtk::ImageTemplate< TPixelType >.

Definition at line 67 of file cmtkUniformVolume.h.


Constructor & Destructor Documentation

virtual cmtk::UniformVolume::~UniformVolume (  ) [inline, virtual]

Destructor.

Definition at line 97 of file cmtkUniformVolume.h.

cmtk::UniformVolume::UniformVolume ( const UniformVolume other,
const Types::Coordinate  resolution = 0,
const bool  allowUpsampling = false 
)

Resample other volume to given resolution.

Parameters:
otherOriginal volume that will be resampled.
resolutionResolution of the newly created volume in world units.
allowUpsamplingIf true, then local upsampling is allowed in regions where the original image resolution (non-uniform) was coarser than the given resolution of the resampled volume.

Definition at line 75 of file cmtkUniformVolume.cxx.

References GetHighResCropRegion(), m_Delta, cmtk::DataGrid::m_Dims, m_IndexToPhysicalMatrix, cmtk::MetaInformationObject::m_MetaInformation, cmtk::Volume::m_Offset, and cmtk::Volume::Size.

cmtk::UniformVolume::UniformVolume ( const DataGrid::IndexType dims,
const Self::CoordinateVectorType size,
TypedArray::SmartPtr data = TypedArray::SmartPtr::Null 
)

Create uniform volume "from scratch".

Parameters:
dimsNumber of grid elements for the three spatial dimensions.
sizeSize of the volume in real-world coordinates.
dataAn existing TypedArray containing the scalar voxel data.

Definition at line 43 of file cmtkUniformVolume.cxx.

cmtk::UniformVolume::UniformVolume ( const DataGrid::IndexType dims,
const Types::Coordinate  deltaX,
const Types::Coordinate  deltaY,
const Types::Coordinate  deltaZ,
TypedArray::SmartPtr data = TypedArray::SmartPtr::Null 
)

Create uniform volume "from scratch".

Parameters:
dimsNumber of grid elements for the three spatial dimensions.
deltaXPixel size in x direction.
deltaYPixel size in y direction.
deltaZPixel size in z direction.
dataAn existing TypedArray containing the scalar voxel data.

Definition at line 58 of file cmtkUniformVolume.cxx.


Member Function Documentation

void cmtk::UniformVolume::ChangeCoordinateSpace ( const std::string &  newSpace ) [virtual]

Change volume coordinate space.

Re-arrange volume's direction vectors to refer to a different coordinate space.

Invariant:
This should keep the result of GetOrientationFromDirections invariant.

Definition at line 70 of file cmtkUniformVolume_Space.cxx.

References cmtk::META_SPACE.

Self::SmartPtr cmtk::UniformVolume::Clone ( const bool  copyData ) [inline]
Self::SmartPtr cmtk::UniformVolume::Clone (  ) const [inline]

Definition at line 168 of file cmtkUniformVolume.h.

Self::SmartPtr cmtk::UniformVolume::CloneGrid (  ) const [inline]
UniformVolume * cmtk::UniformVolume::CloneGridVirtual (  ) const [protected, virtual]

Virtual grid cloning constructor.

Definition at line 149 of file cmtkUniformVolume.cxx.

References m_IndexToPhysicalMatrix, cmtk::MetaInformationObject::m_MetaInformation, and cmtk::Volume::SetOffset().

UniformVolume * cmtk::UniformVolume::CloneVirtual ( const bool  copyData ) [protected, virtual]

Create a physical copy of this object.

Parameters:
copyDataIf true, the associated data array is also copied.

Definition at line 115 of file cmtkUniformVolume.cxx.

UniformVolume * cmtk::UniformVolume::CloneVirtual (  ) const [protected, virtual]

Definition at line 131 of file cmtkUniformVolume.cxx.

void cmtk::UniformVolume::CreateDefaultIndexToPhysicalMatrix (  ) [virtual]

Create a default index-to-physical transformation matrix.

The new matrix is the identity matrix with diagonal elements scaled according to pixel size.

Definition at line 43 of file cmtkUniformVolume_Space.cxx.

CoordinateVectorType& cmtk::UniformVolume::Deltas (  ) [inline]

Get pixel size vector.

Definition at line 91 of file cmtkUniformVolume.h.

const CoordinateVectorType& cmtk::UniformVolume::Deltas (  ) const [inline]
Self::SmartPtr cmtk::UniformVolume::ExtractSlice ( const int  axis,
const int  plane 
) const [inline]

Extract orthogonal slice as a new volume.

Reimplemented from cmtk::DataGrid.

Definition at line 255 of file cmtkUniformVolume.h.

UniformVolume * cmtk::UniformVolume::ExtractSliceVirtual ( const int  axis,
const int  plane 
) const [private, virtual]

Extract orthogonal slice as a new volume.

Reimplemented from cmtk::DataGrid.

Definition at line 345 of file cmtkUniformVolume.cxx.

Self::CoordinateVectorType cmtk::UniformVolume::GetCenterCropRegion (  ) const [inline]

Calculate volume center.

Returns:
Returned is the center of the bounding box.

Definition at line 467 of file cmtkUniformVolume.h.

Referenced by cmtk::MakeInitialAffineTransformation::AlignDirectionVectors(), cmtk::MakeInitialAffineTransformation::AlignFieldsOfView(), and cmtk::QtTriplanarWindow::slotCenter().

virtual Self::CoordinateVectorType cmtk::UniformVolume::GetCenterOfMass (  ) const [inline, virtual]

Get center of mass of pixel data.

Definition at line 487 of file cmtkUniformVolume.h.

Referenced by cmtk::MakeInitialAffineTransformation::AlignCentersOfMass().

virtual Self::CoordinateVectorType cmtk::UniformVolume::GetCenterOfMass ( Self::CoordinateVectorType firstOrderMoment ) const [inline, virtual]

Get center of mass of pixel data.

Definition at line 496 of file cmtkUniformVolume.h.

virtual int cmtk::UniformVolume::GetClosestCoordIndex ( const int  axis,
const Types::Coordinate  location 
) const [inline, virtual]

Get grid index corresponding (as close as possible) to coordinate.

Parameters:
axisThe coordinate axis that the location parameters refers to.
locationThe location along the selected coordinate axis in the range from 0 to Size[axis].

Definition at line 365 of file cmtkUniformVolume.h.

Referenced by cmtk::QtTriplanarWindow::slotMouse3D(), cmtk::QtTriplanarWindow::slotMouseAx(), cmtk::QtTriplanarWindow::slotMouseCo(), and cmtk::QtTriplanarWindow::slotMouseSa().

virtual bool cmtk::UniformVolume::GetClosestGridPointIndex ( const Self::CoordinateVectorType  v,
int *const   xyz 
) const [inline, virtual]

Get grid index corresponding (as close as possible) to coordinate.

Returns:
True if given point is inside image, false if outside.

Definition at line 374 of file cmtkUniformVolume.h.

virtual int cmtk::UniformVolume::GetCoordIndex ( const int  axis,
const Types::Coordinate  location 
) const [inline, virtual]

Get grid index of slice with highest coordinate smaller than given.

Parameters:
axisThe coordinate axis that the location parameters refers to.
locationThe location along the selected coordinate axis in the range from 0 to Size[axis].

Definition at line 356 of file cmtkUniformVolume.h.

virtual Types::Coordinate cmtk::UniformVolume::GetDelta ( const int  axis ) const [inline, virtual]

Get delta (pixel size) in one dimension.

Definition at line 180 of file cmtkUniformVolume.h.

UniformVolume * cmtk::UniformVolume::GetDownsampledAndAveraged ( const int  downsample,
const bool  approxIsotropic = false 
) const [virtual]

Downsampling constructor function.

Parameters:
downsampleDownsampling factor.
approxIsotropicIf this is set (default: off), then the downsample factors per dimension are adjusted so that the resulting output volume is as close to isotropic as possible without interpolation.

Definition at line 159 of file cmtkUniformVolume.cxx.

UniformVolume * cmtk::UniformVolume::GetDownsampledAndAveraged ( const int(&)  downsample[3] ) const [virtual]

Downsampling constructor function.

Parameters:
downsampleArray of per-dimension downsampling factors.

Reimplemented from cmtk::DataGrid.

Definition at line 177 of file cmtkUniformVolume.cxx.

References m_IndexToPhysicalMatrix, cmtk::MetaInformationObject::m_MetaInformation, SetHighResCropRegion(), and cmtk::Volume::SetOffset().

const cmtk::UniformVolume::CoordinateVectorType cmtk::UniformVolume::GetGradientAt ( const int  i,
const int  j,
const int  k 
) [virtual]

Get date gradient vector at pixel using central differences.

This function cannot be called for pixels on the volume boundaries, i.e., we require that 0 < i,j,k < [Dims[0]-1,Dims[1]-1,Dims[2]-1].

Warning:
No parameter range checking is currently performed!

Definition at line 35 of file cmtkUniformVolume_Differential.cxx.

virtual const Self::CoordinateVectorType cmtk::UniformVolume::GetGridLocation ( const int  x,
const int  y,
const int  z 
) const [inline, virtual]
virtual const Self::CoordinateVectorType cmtk::UniformVolume::GetGridLocation ( const size_t  idx ) const [inline, virtual]

Get a grid coordinate by continuous pixel index.

This function directly calculates the grid location from the volume's grid deltas.

Parameters:
idxThe index of the intended grid element. Valid range is from 0 to (Dims[0]*Dims[1]*Dims[2])-1.
Returns:
The location of the given grid element as a Self::CoordinateVectorType.

Definition at line 439 of file cmtkUniformVolume.h.

const UniformVolume::RegionType cmtk::UniformVolume::GetGridRange ( const Self::CoordinateVectorType fromVOI,
const Self::CoordinateVectorType toVOI 
) const

Get 3D grid region from continuous lower and upper corner.

Definition at line 282 of file cmtkUniformVolume.cxx.

void cmtk::UniformVolume::GetHessianAt ( Matrix3x3< Types::DataItem > &  H,
const int  i,
const int  j,
const int  k 
) [virtual]

Get data Hessian matrix at pixel using central differences.

This function cannot be called for pixels within a two-pixel distance from the volume boundary, i.e., we require that 1 < i,j,k < [Dims[0]-2,Dims[1]-2,Dims[2]-2].

Warning:
No parameter range checking is currently performed!

Definition at line 46 of file cmtkUniformVolume_Differential.cxx.

AffineXform::MatrixType cmtk::UniformVolume::GetImageToPhysicalMatrix (  ) const [virtual]

Get matrix that maps form image coordinates to physical space.

The returned matrix is computed by removing pixel size from the one stored in m_IndexToPhysicalMatrix.

Definition at line 109 of file cmtkUniformVolume_Space.cxx.

Referenced by cmtk::MakeInitialAffineTransformation::AlignDirectionVectors(), cmtk::SplineWarpXformITKIO::Write(), and cmtk::VolumeFromFile::WriteMetaImage().

UniformVolume * cmtk::UniformVolume::GetInterleavedPaddedSubVolume ( const int  axis,
const int  factor,
const int  idx 
) const

Get interleaved sub-volume along given axis and with given interleave offset, padded with empty image planes.

Parameters:
axisCoordinate axis along which the image is interleaved.
factorInterleave factor, i.e., the number of interleaved sub-volumes.
idxIndex of interleaved sub-volume to extract.

Definition at line 259 of file cmtkUniformVolume.cxx.

References cmtk::DataGrid::CreateDataArray(), m_IndexToPhysicalMatrix, cmtk::MetaInformationObject::m_MetaInformation, cmtk::Volume::SetOffset(), and cmtk::DataGrid::SetOrthoSlice().

UniformVolume * cmtk::UniformVolume::GetInterleavedSubVolume ( const int  axis,
const int  factor,
const int  idx 
) const

Get interleaved sub-volume along given axis and with given interleave offset.

Parameters:
axisCoordinate axis along which the image is interleaved.
factorInterleave factor, i.e., the number of interleaved sub-volumes.
idxIndex of interleaved sub-volume to extract.

Definition at line 213 of file cmtkUniformVolume.cxx.

References m_IndexToPhysicalMatrix, cmtk::MetaInformationObject::m_MetaInformation, cmtk::Volume::SetOffset(), and cmtk::DataGrid::SetOrthoSlice().

Referenced by cmtk::VolumeInjectionReconstruction::VolumeInjectionReconstruction().

virtual Types::Coordinate cmtk::UniformVolume::GetMaxDelta (  ) const [inline, virtual]

Get maximum grid spacing for all dimensions.

For each dimension, the maximum delta is retrieved by a call to the derived class's corresponding method.

Definition at line 198 of file cmtkUniformVolume.h.

virtual Types::Coordinate cmtk::UniformVolume::GetMinDelta (  ) const [inline, virtual]

Get minimum grid spacing for all dimensions.

For each dimension, the minimum delta is retrieved by a call to the derived class's corresponding method.

Definition at line 189 of file cmtkUniformVolume.h.

Referenced by cmtk::PlaneSource::GetMaxResolution(), cmtk::QtTriplanarWindow::slotSwitchImageAx(), cmtk::QtTriplanarWindow::slotSwitchImageCo(), and cmtk::QtTriplanarWindow::slotSwitchImageSa().

ScalarImage * cmtk::UniformVolume::GetNearestOrthoSlice ( const int  axis,
const Types::Coordinate  location 
) const [virtual]

Return orthogonal slice by location.

This function looks up a given orthogonal slice location and returns the nearest slice from this volume.

Note:
The pixel size if taken from the size of the first grid element along each axis -- non-uniform spacings will lead to incorrect results.

Definition at line 358 of file cmtkUniformVolume.cxx.

std::string cmtk::UniformVolume::GetOrientationFromDirections (  ) const

Get anatomical orientation from space directions.

Definition at line 100 of file cmtkUniformVolume_Space.cxx.

References cmtk::META_SPACE.

ScalarImage * cmtk::UniformVolume::GetOrthoSlice ( const int  axis,
const unsigned int  plane 
) const [virtual]

Return orthogonal slice.

This function calls its equivalent in DataGrid and adds calibration info (i.e., correct pixel sizes) to the resulting image.

Note:
The pixel size if taken from the size of the first grid element along each axis -- non-uniform spacings will lead to incorrect results.

Reimplemented from cmtk::DataGrid.

Definition at line 306 of file cmtkUniformVolume.cxx.

References cmtk::AXIS_X, cmtk::AXIS_Y, cmtk::AXIS_Z, and cmtk::ScalarImage::SetImageOrigin().

Referenced by cmtk::QtTriplanarWindow::slotSwitchImageAx(), cmtk::QtTriplanarWindow::slotSwitchImageCo(), and cmtk::QtTriplanarWindow::slotSwitchImageSa().

ScalarImage * cmtk::UniformVolume::GetOrthoSliceInterp ( const int  axis,
const Types::Coordinate  location 
) const [virtual]

Return interpolated orthogonal slice.

This function calls its non-interpolating counterpart twice and performs a 1-D interpolation on the results to form the interpolated slice.

Note:
The pixel size if taken from the size of the first grid element along each axis -- non-uniform spacings will lead to incorrect results.

Definition at line 365 of file cmtkUniformVolume.cxx.

References cmtk::ScalarImage::GetImageOrigin(), and cmtk::ScalarImage::SetImageOrigin().

virtual Types::Coordinate cmtk::UniformVolume::GetPlaneCoord ( const int  axis,
const int  plane 
) const [inline, virtual]
void cmtk::UniformVolume::GetPrincipalAxes ( Matrix3x3< Types::Coordinate > &  directions,
Self::CoordinateVectorType centerOfMass 
) const

Get principal axes.

Returns:
This function returns two types of information: the principal directions (axes) of the image data, and the relative scales. The principal axes are returned as a 3x3 array, such that directions[0] is the 3D array of the major principal direction, i.e. the one with the largest norm. Then, directions[0][1] is the y-component of that vector, etc. Accordingly, directions[1] and directions[2] are the two remaining principal directions, with the norm of directions[1] larger than, or equal to, the norm of directions[2].

Definition at line 410 of file cmtkUniformVolume.cxx.

References cmtk::AXIS_X, cmtk::AXIS_Y, cmtk::AXIS_Z, cmtk::Matrix3x3< T >::Determinant(), and cmtk::EigenSystemSymmetricMatrix3x3< TFloat >::GetNthEigenvector().

Referenced by cmtk::MakeInitialAffineTransformation::AlignPrincipalAxes().

const UniformVolume::SmartPtr cmtk::UniformVolume::GetReoriented ( const char *  newOrientation = AnatomicalOrientation::ORIENTATION_STANDARD ) const
virtual int cmtk::UniformVolume::GetTruncCoordIndex ( const int  axis,
const Types::Coordinate  location 
) const [inline, virtual]

Get grid index corresponding to coordinate by truncation, not rounding.

Parameters:
axisThe coordinate dimension that the location parameters refers to.
locationThe location in the range from 0 to Size[axis].

Definition at line 389 of file cmtkUniformVolume.h.

virtual bool cmtk::UniformVolume::GetTruncGridPointIndex ( const Self::CoordinateVectorType  v,
int *const   xyz 
) const [inline, virtual]

Get grid index corresponding to coordinate by truncation, not rounding.

Returns:
True if given point is inside image, false if outside.
Parameters:
vLocation to find in the grid.
xyzTruncated grid point index (i.e., nearest grid point between location and grid coordinate origin.

Definition at line 398 of file cmtkUniformVolume.h.

bool cmtk::UniformVolume::GridMatches ( const Self other ) const [inline]

Test whether this grid matches another one, i.e., has the same pixel sizes.

Reimplemented from cmtk::DataGrid.

Definition at line 125 of file cmtkUniformVolume.h.

virtual const Self::CoordinateVectorType cmtk::UniformVolume::IndexToPhysical ( const Self::CoordinateVectorType idxV ) const [inline, virtual]

Get a grid location in physical coordinates.

Parameters:
idxVThe index of the intended grid element with respect to the three coordinate axes. Valid range is from 0 to Dims[...]-1. Fractional coordinates are permitted.
Returns:
The location in image coordinates of the given grid element as a Self::CoordinateVectorType.

Definition at line 426 of file cmtkUniformVolume.h.

Referenced by cmtk::QtTriplanarWindow::UpdateGridInfo().

void cmtk::UniformVolume::Mirror ( const int  axis = AXIS_X ) [virtual]

Mirror volume and associated data.

Parameters:
axisMirror with respect to this coordinate axis.

Definition at line 296 of file cmtkUniformVolume.cxx.

virtual void cmtk::UniformVolume::SetCropRegion ( const Self::RegionType region ) [inline, virtual]

Catch calls to inherited SetCropRegion() and reset high-res crop region.

Reimplemented from cmtk::DataGrid.

Definition at line 458 of file cmtkUniformVolume.h.

References NULL.


Friends And Related Function Documentation

friend class ResampleThreadInfo [friend]

Give thread parameter class access to local types.

Definition at line 548 of file cmtkUniformVolume.h.

friend class VolumeAxesHash [friend]

Make axes hash a friend.

Definition at line 543 of file cmtkUniformVolume.h.

friend class VolumeGridToGridLookup [friend]

Grid grid-to-grid lookup friend.

Definition at line 546 of file cmtkUniformVolume.h.

friend class WarpXform [friend]

Friend declaration of WarpXform class.

This allows direct access to Dims and Delta fields in RegisterVolumePoints member function of WarpXform.

Definition at line 540 of file cmtkUniformVolume.h.


Member Data Documentation

Optional high-resolution crop region.

If this is unset (i.e., a NULL pointer), then calls to GetHighResCropRegion() will simply convert the grid-based crop region.

Note:
The crop region includes the volume offset, m_Offset. Its upper limit can, therefore, be larger than m_Size, which does NOT include m_Offset.

Definition at line 534 of file cmtkUniformVolume.h.

Coordinate transformation from index to physical position.

This incorporates image axis directions and first pixel offset.

Note:
Strictly, this is not a transformation from the pixel index to physical coordinates, but from pixel index times pixel size to physical coordinates. This way, the transformation maps from physical space back into physical space.

Definition at line 137 of file cmtkUniformVolume.h.

Referenced by CloneGridVirtual(), GetDownsampledAndAveraged(), GetInterleavedPaddedSubVolume(), GetInterleavedSubVolume(), cmtk::UniformDistanceMap< TDistanceDataType >::UniformDistanceMap(), UniformVolume(), and cmtk::VolumeFromFile::WriteNifti().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines