#include <RegisteredImage.h>
Public Types | |
enum | Channel |
Enumeration of registered image channel indices. | |
typedef GenericImage< double > | DisplacementImageType |
Type of cached displacement fields. | |
typedef GenericImage< VoxelType > | InputGradientType |
Type of untransformed gradient image. | |
typedef GenericImage< VoxelType > | InputHessianType |
Type of untransformed Hessian image. | |
typedef GenericImage< VoxelType > | InputImageType |
Type of untransformed input image. | |
Public Types inherited from mirtk::GenericImage< double > | |
typedef voxel_info< ScalarType >::RealType | RealScalarType |
Floating point type corresponding to scalar type of voxel type. | |
typedef voxel_info< VoxelType >::RealType | RealType |
typedef voxel_info< VoxelType >::ScalarType | ScalarType |
Scalar type corresponding to voxel type. | |
typedef double | VoxelType |
Voxel type. | |
Public Types inherited from mirtk::BaseImage | |
enum | OrientationCode { , L2R = 1, R2L = 2, P2A = 3, A2P = 4, I2S = 5, S2I = 6 } |
Orientation codes (same as defined in nifti1_io.h, e.g., NIFTI_L2R) More... | |
typedef double | VoxelType |
Public Member Functions | |
enum InterpolationMode | GetInterpolationMode () const |
void | Initialize (const ImageAttributes &, int=0) |
mirtkComponentMacro (DisplacementImageType, FixedDisplacement) | |
Pre-computed fixed displacements. | |
mirtkComponentMacro (DisplacementImageType, Displacement) | |
Pre-computed displacements. | |
mirtkPublicAggregateMacro (InputImageType, InputImage) | |
Untransformed input image. | |
mirtkPublicAggregateMacro (const class Transformation, Transformation) | |
Current transformation estimate. | |
mirtkPublicAggregateMacro (WorldCoordsImage, WorldCoordinates) | |
Pre-computed image to world coordinates. | |
mirtkPublicAggregateMacro (DisplacementImageType, ExternalDisplacement) | |
Externally pre-computed displacements to use. | |
mirtkPublicAttributeMacro (enum InterpolationMode, InterpolationMode) | |
Interpolation mode. | |
mirtkPublicAttributeMacro (enum ExtrapolationMode, ExtrapolationMode) | |
Extrapolation mode. | |
mirtkPublicAttributeMacro (bool, CacheWorldCoordinates) | |
Whether to use pre-computed world coordinates. | |
mirtkPublicAttributeMacro (bool, CacheFixedDisplacement) | |
Whether to use pre-computed fixed displacements. | |
mirtkPublicAttributeMacro (bool, CacheDisplacement) | |
Whether to use pre-computed displacements. | |
mirtkPublicAttributeMacro (bool, SelfUpdate) | |
Whether self-update is enabled. | |
mirtkPublicAttributeMacro (double, MinIntensity) | |
Minimum foreground intensity of warped image or NaN. | |
mirtkPublicAttributeMacro (double, MaxIntensity) | |
Maximum foreground intensity of warped image or NaN. | |
mirtkPublicAttributeMacro (double, GradientSigma) | |
mirtkPublicAttributeMacro (double, HessianSigma) | |
mirtkPublicAttributeMacro (bool, PrecomputeDerivatives) | |
mirtkPublicAttributeMacro (int, MaxGradientPercentile) | |
mirtkPublicAttributeMacro (double, MaxGradientMagnitude) | |
When positive and not inf, linearly rescale gradient vectors to this maximum magnitude. | |
mirtkPublicComponentMacro (InputGradientType, InputGradient) | |
Untransformed input gradient image. | |
mirtkPublicComponentMacro (InputHessianType, InputHessian) | |
Untransformed input Hessian image. | |
mirtkPublicComponentMacro (WorldCoordsImage, ImageToWorld) | |
Pre-computed image to world coordinates. | |
mirtkReadOnlyAttributeMacro (double, MinInputIntensity) | |
Minimum foreground intensity of input image. | |
mirtkReadOnlyAttributeMacro (double, MaxInputIntensity) | |
Maximum foreground intensity of input image. | |
int | NumberOfChannels () const |
Number of registered channels. | |
int | NumberOfVoxels () const |
Number of voxels per registered channel. | |
int | Offset (int) const |
Offset of channel c with respect to the start of the image data. | |
RegisteredImage & | operator= (const RegisteredImage &) |
Assignment operator. | |
void | Recompute (const blocked_range3d< int > ®ion) |
void | Recompute () |
RegisteredImage () | |
Constructor. | |
RegisteredImage (const RegisteredImage &) | |
Copy constructor. | |
void | Update (const blocked_range3d< int > ®ion, bool intensity=true, bool gradient=false, bool hessian=false, bool force=false) |
void | Update (const blocked_range3d< int > ®ion, const DisplacementImageType *disp, bool intensity=true, bool gradient=false, bool hessian=false) |
void | Update (bool intensity=true, bool gradient=false, bool hessian=false, bool force=false) |
~RegisteredImage () | |
Destructor. | |
Public Member Functions inherited from mirtk::GenericImage< double > | |
void | Clear () |
Clear an image. | |
virtual BaseImage * | Copy () const |
Create copy of this image. | |
void | CopyFrom (const VoxelType *) |
Copy image data from 1D array. | |
void | CopyFrom (const BaseImage &) |
Copy image data from other image of same size. | |
void | CopyFrom (const GenericImage &) |
Copy image data from other image of same size. | |
bool | CropPad (int margin=0) |
Crop/pad image background. | |
VoxelType * | Data (int=0) |
Get raw pointer to contiguous image data. | |
VoxelType * | Data (int, int, int=0, int=0) |
Get raw pointer to contiguous image data. | |
const VoxelType * | Data (int=0) const |
Get raw pointer to contiguous image data. | |
const VoxelType * | Data (int, int, int=0, int=0) const |
Get raw pointer to contiguous image data. | |
virtual void | FlipXT (bool modify_origin=false) |
Flip x and t axis, always also swaps voxel size. | |
virtual void | FlipXY (bool modify_origin=false) |
Flip x and y axis, always also swaps voxel size. | |
virtual void | FlipXZ (bool modify_origin=false) |
Flip x and z axis, always also swaps voxel size. | |
virtual void | FlipYT (bool modify_origin=false) |
Flip y and t axis, always also swaps voxel size. | |
virtual void | FlipYZ (bool modify_origin=false) |
Flip y and z axis, always also swaps voxel size. | |
virtual void | FlipZT (bool modify_origin=false) |
Flip z and t axis, always also swaps voxel size. | |
GenericImage () | |
Default constructor. | |
GenericImage (const char *) | |
Constructor from image file. | |
GenericImage (int, int, int=1, int=1, VoxelType *data=NULL) | |
Constructor for given image size. | |
GenericImage (int, int, int, int, int, VoxelType *data=NULL) | |
Constructor for given image size. | |
GenericImage (const ImageAttributes &, VoxelType *data=NULL) | |
Constructor for given image attributes. | |
GenericImage (const ImageAttributes &, int, VoxelType *data=NULL) | |
Constructor for given image attributes. | |
GenericImage (const BaseImage &) | |
Copy constructor for image. | |
GenericImage (const GenericImage &) | |
Copy constructor for image. | |
GenericImage (const GenericImage< TVoxel2 > &) | |
Copy constructor for image of different type. | |
VoxelType | Get (int) const |
Function for pixel get access. | |
VoxelType | Get (int, int, int=0, int=0) const |
Function for pixel get access. | |
virtual double | GetAsDouble (int) const |
Function for pixel get access as double. | |
virtual double | GetAsDouble (int, int, int=0, int=0) const |
Function for pixel get access as double. | |
virtual void | GetAsVector (Vector &, int) const |
Function for pixel get access as double. | |
virtual void | GetAsVector (Vector &, int, int, int=0, int=0) const |
Function for pixel get access as double. | |
virtual Vector | GetAsVector (int) const |
Function for pixel get access as double. | |
virtual Vector | GetAsVector (int, int, int=0, int=0) const |
Function for pixel get access as double. | |
RealType | GetAverage (int=1) const |
virtual void * | GetDataPointer (int=0) |
Get raw pointer to contiguous image data. | |
virtual const void * | GetDataPointer (int=0) const |
Get raw pointer to contiguous image data. | |
virtual void * | GetDataPointer (int, int, int=0, int=0) |
Get raw pointer to contiguous image data. | |
virtual const void * | GetDataPointer (int, int, int=0, int=0) const |
Get raw pointer to contiguous image data. | |
virtual int | GetDataType () const |
Get enumeration value corresponding to voxel type. | |
virtual double | GetDataTypeMax () const |
Maximum value a pixel can hold without overflowing. | |
virtual double | GetDataTypeMin () const |
Minimum value a pixel can hold without overflowing. | |
virtual int | GetDataTypeSize () const |
Get size of each voxel in bytes. | |
GenericImage | GetFrame (int, int=-1) const |
Get time instance (i.e., frame) or channel of image. | |
void | GetFrame (GenericImage &, int, int=-1) const |
Get time instance (i.e., frame) or channel of image. | |
virtual void | GetFrame (BaseImage *&, int, int=-1) const |
Get time instance (i.e., frame) or channel of image. | |
void | GetMaxPosition (Point &, int=1, int=0) const |
Get Max Intensity position around the point. | |
void | GetMinMax (VoxelType &, VoxelType &) const |
Minimum and maximum pixel values get accessor. | |
void | GetMinMax (VoxelType &, VoxelType &, VoxelType) const |
Minimum and maximum pixel values get accessor with padding. | |
void | GetMinMax (VoxelType *, VoxelType *) const |
void | GetMinMax (VoxelType *, VoxelType *, VoxelType) const |
void | GetMinMaxPad (VoxelType *, VoxelType *, VoxelType) const |
VoxelType * | GetPointerToVoxels (int=0, int=0, int=0, int=0) |
const VoxelType * | GetPointerToVoxels (int=0, int=0, int=0, int=0) const |
GenericImage | GetRegion (int, int) const |
Get image consisting of specified 2D slice. | |
void | GetRegion (GenericImage &, int, int) const |
Get image consisting of specified 2D slice. | |
virtual void | GetRegion (BaseImage *&, int, int) const |
Get image consisting of specified 2D slice. | |
GenericImage | GetRegion (int, int, int, int, int, int) const |
Get image consisting of specified 3D subregion. | |
void | GetRegion (GenericImage &, int, int, int, int, int, int) const |
Get image consisting of specified 3D subregion. | |
virtual void | GetRegion (BaseImage *&, int, int, int, int, int, int) const |
Get image consisting of specified 3D subregion. | |
GenericImage | GetRegion (int, int, int, int, int, int, int, int) const |
Get image consisting of specified 4D subregion. | |
void | GetRegion (GenericImage &, int, int, int, int, int, int, int, int) const |
Get image consisting of specified 4D subregion. | |
virtual void | GetRegion (BaseImage *&, int, int, int, int, int, int, int, int) const |
Get image consisting of specified 4D subregion. | |
RealType | GetSD (int=1) const |
Standard Deviation of the pixels. | |
void | GravityCenter (Point &, int=1, int=0) const |
Get Gravity center position of a given window. | |
virtual void | Initialize () |
Initialize a previously allocated image. | |
virtual void | Initialize (const ImageAttributes &, int, VoxelType *data) |
Initialize an image. | |
void | Initialize (const ImageAttributes &, int) |
Initialize an image. | |
void | Initialize (const ImageAttributes &, VoxelType *data=NULL) |
Initialize an image. | |
void | Initialize (int, int, int, int, int, VoxelType *data=NULL) |
Initialize an image. | |
void | Initialize (int, int, int=1, int=1, VoxelType *data=NULL) |
Initialize an image. | |
RealType | Mean (bool fg=true) const |
int | N () const |
Number of vector components per voxel. | |
operator bool () const | |
Cast to bool, checks if this image has been initialized and ready for use. | |
BinaryImage | operator!= (VoxelType) const |
Get binary mask for voxels which are not equal the scalar. | |
VoxelType & | operator() (int) |
Function for pixel access from via operators. | |
const VoxelType & | operator() (int) const |
Function for pixel access from via operators. | |
VoxelType & | operator() (int, int, int=0, int=0) |
Function for pixel access from via operators. | |
const VoxelType & | operator() (int, int, int=0, int=0) const |
Function for pixel access from via operators. | |
GenericImage | operator* (const GenericImage &) const |
Multiply images voxel-wise. | |
GenericImage | operator* (double) const |
Multiply image by scalar. | |
GenericImage & | operator*= (const GenericImage &) |
Multipy voxels. | |
GenericImage & | operator*= (double) |
Multiply by scalar. | |
GenericImage | operator+ (const GenericImage &) const |
Add images. | |
GenericImage | operator+ (double) const |
Add scalar to image. | |
GenericImage & | operator+= (const GenericImage &) |
Add image. | |
GenericImage & | operator+= (double) |
Add scalar. | |
GenericImage | operator- (const GenericImage &) const |
Subtract images. | |
GenericImage | operator- (double) const |
Subtract scalar from image. | |
GenericImage & | operator-= (const GenericImage &) |
Subtract image. | |
GenericImage & | operator-= (double) |
Subtract scalar. | |
GenericImage | operator/ (const GenericImage &) const |
Divide images voxel-wise. | |
GenericImage | operator/ (double) const |
Divide image by scalar. | |
GenericImage & | operator/= (const GenericImage &) |
Divide voxels. | |
GenericImage & | operator/= (double) |
Divide by scalar. | |
GenericImage | operator< (VoxelType) const |
Clamp image given lower threshold. | |
GenericImage & | operator<= (VoxelType) |
Clamp image given lower threshold. | |
GenericImage & | operator= (VoxelType) |
Assign constant value to each voxel. | |
GenericImage< VoxelType > & | operator= (const BaseImage &) |
Assignment operator with implicit cast to double and then VoxelType. | |
GenericImage< VoxelType > & | operator= (const GenericImage &) |
Assignment operator. | |
GenericImage< VoxelType > & | operator= (const GenericImage< TVoxel2 > &) |
Assignment operator with implicit cast. | |
bool | operator== (const GenericImage< TVoxel2 > &) const |
GenericImage | operator> (VoxelType) const |
Clamp image given upper threshold. | |
GenericImage & | operator>= (VoxelType) |
Clamp image given upper threshold. | |
void | Put (int, VoxelType) |
Function for pixel put access. | |
void | Put (int, int, VoxelType) |
Function for pixel put access. | |
void | Put (int, int, int, VoxelType) |
Function for pixel put access. | |
void | Put (int, int, int, int, VoxelType) |
Function for pixel put access. | |
virtual void | PutAsDouble (int, double) |
Function for pixel put access. | |
virtual void | PutAsDouble (int, int, double) |
Function for pixel put access. | |
virtual void | PutAsDouble (int, int, int, double) |
Function for pixel put access. | |
virtual void | PutAsDouble (int, int, int, int, double) |
Function for pixel put access. | |
virtual void | PutAsVector (int, const Vector &) |
Function for pixel put access. | |
virtual void | PutAsVector (int, int, const Vector &) |
Function for pixel put access. | |
virtual void | PutAsVector (int, int, int, const Vector &) |
Function for pixel put access. | |
virtual void | PutAsVector (int, int, int, int, const Vector &) |
Function for pixel put access. | |
virtual void | PutBackgroundValueAsDouble (double, bool) |
Put background value. | |
void | PutMinMax (VoxelType, VoxelType) |
Linearly rescale intensities. | |
virtual void | Read (const char *) |
Read image from file. | |
virtual void | ReflectT (bool modify_axes=false) |
Reflect image along t. | |
virtual void | ReflectX (bool modify_axes=false) |
Reflect image along x. | |
virtual void | ReflectY (bool modify_axes=false) |
Reflect image along y. | |
virtual void | ReflectZ (bool modify_axes=false) |
Reflect image along z. | |
virtual void | SwapXT (bool modify_axes=true) |
Swap x and t axis. | |
virtual void | SwapXY (bool modify_axes=true) |
Swap x and y axis. | |
virtual void | SwapXZ (bool modify_axes=true) |
Swap x and z axis. | |
virtual void | SwapYT (bool modify_axes=true) |
Swap y and t axis. | |
virtual void | SwapYZ (bool modify_axes=true) |
Swap y and z axis. | |
virtual void | SwapZT (bool modify_axes=true) |
Swap z and t axis. | |
virtual void | Write (const char *) const |
Write image to file. | |
~GenericImage () | |
Destructor. | |
Public Member Functions inherited from mirtk::BaseImage | |
const ImageAttributes & | Attributes () const |
Gets the image attributes. | |
void | BoundingBox (int &, int &, int &, int &) const |
Get 2D bounding box of image foreground. | |
void | BoundingBox (int &, int &, int &, int &, int &, int &) const |
Get 3D bounding box of image foreground. | |
void | BoundingBox (int &, int &, int &, int &, int &, int &, int &, int &) const |
Get 3D+t bounding box of image foreground. | |
int | CenterOfForeground (Point ¢er) const |
int | CenterOfForeground (Point ¢er, double padding) const |
void | ClearBackgroundValue () |
Clear background value. | |
void | ClearMask (bool=false) |
Clear mask upon n-th call after n preceeding InitializeMask calls. | |
ImageAttributes | ForegroundDomain (int i1, int j1, int k1, int i2, int j2, int k2, bool orthogonal=true) const |
ImageAttributes | ForegroundDomain (bool orthogonal=true) const |
ImageAttributes | ForegroundDomain (double padding, bool orthogonal=true) const |
VoxelType | Get (int) const |
Get pixel value at voxel with given index. | |
VoxelType | Get (int, int, int=0, int=0) const |
Get pixel value at voxel with given lattice coordinates. | |
const Matrix & | GetAffineMatrix () const |
double | GetBackgroundValueAsDouble () const |
Get background value. | |
const ImageAttributes & | GetImageAttributes () const |
const Matrix & | GetImageToWorldMatrix () const |
Return transformation matrix for image to world coordinates. | |
BinaryImage * | GetMask (bool=false) |
Get foreground mask (optionally, take over ownership) | |
const BinaryImage * | GetMask () const |
Get foreground mask. | |
virtual void | GetMinMaxAsDouble (double &, double &) const |
Minimum and maximum pixel values get accessor. | |
void | GetMinMaxAsDouble (double *, double *) const |
Minimum and maximum pixel values get accessor. | |
int | GetNumberOfVoxels () const |
void | GetOrientation (double *, double *, double *=NULL) const |
Get image x- and y-axis and z-axis. | |
Point | GetOrigin () const |
Image origin get access. | |
void | GetOrigin (double &, double &, double &) const |
Image origin get access. | |
void | GetOrigin (double &, double &, double &, double &) const |
Image origin get access. | |
void | GetPixelSize (double &, double &) const |
Voxel dimensions get access. | |
void | GetPixelSize (double &, double &, double &) const |
Voxel dimensions get access. | |
void | GetPixelSize (double &, double &, double &, double &) const |
Voxel dimensions get access. | |
void | GetPixelSize (double *, double *, double *) const |
Voxel dimensions get access. | |
void | GetPixelSize (double *, double *, double *, double *) const |
Voxel dimensions get access. | |
void * | GetScalarPointer (int=0, int=0, int=0, int=0) |
const void * | GetScalarPointer (int=0, int=0, int=0, int=0) const |
int | GetScalarType () const |
double | GetScalarTypeMax () const |
double | GetScalarTypeMin () const |
int | GetScalarTypeSize () const |
int | GetT () const |
Returns the number of voxels in the t-direction. | |
double | GetTOrigin () const |
Get temporal origin. | |
double | GetTSize () const |
Returns the size of a voxel in the t-direction. | |
const Matrix & | GetWorldToImageMatrix () const |
Return transformation matrix for world to image coordinates. | |
int | GetX () const |
Returns the number of voxels in the x-direction. | |
double | GetXSize () const |
Returns the size of a voxel in the x-direction. | |
int | GetY () const |
Returns the number of voxels in the y-direction. | |
double | GetYSize () const |
Returns the size of a voxel in the y-direction. | |
int | GetZ () const |
Returns the number of voxels in the z-direction. | |
double | GetZSize () const |
Returns the size of a voxel in the z-direction. | |
bool | HasBackground () const |
Whether any voxel is within background. | |
bool | HasBackgroundValue () const |
Whether a background value has been set. | |
bool | HasMask () const |
bool | HasSpatialAttributesOf (const BaseImage *) const |
Checks if this image shares the same spatial attributes with another image. | |
double | ImageToTime (double) const |
Image to time coordinate conversion. | |
void | ImageToWorld (double &, double &) const |
Image to world coordinate conversion with two doubles. | |
void | ImageToWorld (double &, double &, double &) const |
Image to world coordinate conversion with three doubles. | |
void | ImageToWorld (Point &) const |
Image to world coordinate conversion with a given point. | |
void | ImageToWorld (Vector3 &) const |
Convert vector w.r.t. image axes to vector w.r.t. world axes. | |
void | ImageToWorld (WorldCoordsImage &i2w, bool _3D=true) const |
void | ImageToWorld (double *i2w, bool _3D=true) const |
void | ImageToWorld (PointSet &) const |
Adds world coordinates of each voxel to given point set. | |
void | IndexToVoxel (int, int &, int &) const |
Function to convert index to pixel coordinates. | |
void | IndexToVoxel (int, int &, int &, int &) const |
Function to convert index to pixel coordinates. | |
void | IndexToVoxel (int, int &, int &, int &, int &) const |
Function to convert index to pixel coordinates. | |
void | IndexToWorld (int, double &, double &) const |
Get world coordinates (in mm) of pixl. | |
void | IndexToWorld (int, double &, double &, double &) const |
Get world coordinates (in mm) of pixel. | |
void | IndexToWorld (int, Point &) const |
Get world coordinates (in mm) of pixel. | |
Point | IndexToWorld (int) const |
Get world coordinates (in mm) of pixel. | |
void | InitializeMask (int t=-1, bool=false) |
Initialize mask if not done yet or none is set. | |
bool | IsBackground (int) const |
Whether voxel is within background without index-out-of-bounds check. | |
bool | IsBackground (int, int, int=0, int=0) const |
Whether voxel is within background without index-out-of-bounds check. | |
bool | IsBoundary (int) const |
Whether voxel index is at boundary of finite image domain. | |
bool | IsBoundary (int, int) const |
Whether voxel indices are at boundary of finite 2D image domain. | |
bool | IsBoundary (int, int, int) const |
Whether voxel indices are at boundary of finite 3D image domain. | |
bool | IsBoundary (int, int, int, int) const |
Whether voxel indices are at boundary of finite 4D image domain. | |
bool | IsBoundingBoxInsideForeground (int, int, int, int) const |
Whether all voxels within a 2D bounding region are inside foreground region. | |
bool | IsBoundingBoxInsideForeground (int, int, int, int, int, int) const |
Whether all voxels within a 3D bounding region are inside foreground region. | |
bool | IsBoundingBoxInsideForeground (int, int, int, int, int, int, int, int) const |
Whether all voxels within a 4D bounding region are inside foreground region. | |
bool | IsEmpty () const |
Whether image is uninitialized. | |
bool | IsForeground (int) const |
Whether voxel is within foreground without index-out-of-bounds check. | |
bool | IsForeground (int, int, int=0, int=0) const |
Whether voxel is within foreground without index-out-of-bounds check. | |
bool | IsInFOV (double, double, double) |
Returns true if point is within the field of view of image. | |
bool | IsInside (int) const |
Whether voxel index is within finite image domain. | |
bool | IsInside (int, int) const |
Whether voxel indices are within finite 2D image domain. | |
bool | IsInside (int, int, int) const |
Whether voxel indices are within finite 3D image domain. | |
bool | IsInside (int, int, int, int) const |
Whether voxel indices are within finite 4D image domain. | |
bool | IsInsideForeground (int) const |
Whether voxel is index is within finite image domain and part of foreground region. | |
bool | IsInsideForeground (int, int, int=0, int=0) const |
Whether voxel indices are within finite image domain and part of foreground region. | |
bool | IsNextToBackground (int) const |
Whether at least one neighboring voxel is outside the finite foreground region. | |
bool | IsNextToBackground (int, int, int=0, int=0) const |
Whether at least one neighboring voxel is outside the finite foreground region. | |
bool | IsNextToForeground (int) const |
Whether at least one neighboring voxel is inside the finite foreground region. | |
bool | IsNextToForeground (int, int, int=0, int=0) const |
Whether at least one neighboring voxel is inside the finite foreground region. | |
bool | IsOutside (int) const |
Whether voxel is index is outside finite image domain. | |
bool | IsOutside (int, int) const |
Whether voxel indices are outside finite 4D image domain. | |
bool | IsOutside (int, int, int) const |
Whether voxel indices are outside finite 4D image domain. | |
bool | IsOutside (int, int, int, int) const |
Whether voxel indices are outside finite 4D image domain. | |
bool | IsOutsideForeground (int) const |
Whether voxel is index is outside finite image domain or part of background region. | |
bool | IsOutsideForeground (int, int, int=0, int=0) const |
Whether voxel indices are outside finite image domain or part of background region. | |
int | NumberOfSpatialVoxels () const |
Returns the total number of spatial voxels. | |
int | NumberOfVoxels () const |
Returns the total number of voxels. | |
BaseImage & | operator= (const BaseImage &) |
Assignment operator. | |
void | Orientation (OrientationCode &, OrientationCode &, OrientationCode &) const |
Get orientation of axis relative to patient. | |
bool | OwnsMask () const |
virtual void | Print (Indent=0) const |
Print image information. | |
void | PutAffineMatrix (const Matrix &, bool=false) |
void | PutBackgroundValueAsDouble (double) |
Put background value. | |
void | PutMask (BinaryImage *, bool=false) |
Set foreground mask. | |
virtual void | PutMinMaxAsDouble (double, double) |
Minimum and maximum pixel values put accessor. | |
void | PutOrientation (double *, double *, double *=NULL) |
Put image x- and y-axis and z-axis. | |
void | PutOrigin (const Point &) |
Image origin put access. | |
void | PutOrigin (double, double, double) |
Image origin put access. | |
void | PutOrigin (double, double, double, double) |
Image origin put access. | |
void | PutPixelSize (double, double, double) |
Voxel dimensions put access. | |
void | PutPixelSize (double, double, double, double) |
Voxel dimensions put access. | |
void | PutTOrigin (double) |
Put temporal origin. | |
void | PutTSize (double) |
Set temporal voxel size, i.e., to zero for vector field and non-zero for temporal sequence. | |
void | ResetAffineMatrix () |
void | ResetBackgroundValueAsDouble (double) |
int | T () const |
Returns the number of voxels in the t-direction. | |
double | TimeToImage (double) const |
Time to image coordinate conversion. | |
double | TSize () const |
Returns the size of a voxel in the t-direction. | |
int | VoxelToIndex (int, int, int=0, int=0) const |
Function to convert pixel to index. | |
void | WorldToImage (double &, double &) const |
World to image coordinate conversion with two doubles. | |
void | WorldToImage (double &, double &, double &) const |
World to image coordinate conversion with three doubles. | |
void | WorldToImage (Point &) const |
World to image coordinate conversion with a given point. | |
void | WorldToImage (Vector3 &) const |
Convert vector w.r.t. world axes to vector w.r.t. image axes. | |
int | X () const |
Returns the number of voxels in the x-direction. | |
double | XSize () const |
Returns the size of a voxel in the x-direction. | |
int | Y () const |
Returns the number of voxels in the y-direction. | |
double | YSize () const |
Returns the size of a voxel in the y-direction. | |
int | Z () const |
Returns the number of voxels in the z-direction. | |
double | ZSize () const |
Returns the size of a voxel in the z-direction. | |
virtual | ~BaseImage () |
Destructor. | |
Public Member Functions inherited from mirtk::Object | |
virtual const char * | NameOfClass () const =0 |
Get name of class, which this object is an instance of. | |
virtual ParameterList | Parameter () const |
Get parameter name/value pairs. | |
bool | Parameter (const ParameterList &) |
Set parameters from name/value pairs. | |
virtual bool | Set (const char *name, const char *value) |
virtual | ~Object () |
Destructor. | |
Protected Member Functions | |
void | ComputeInputGradient (double sigma) |
void | ComputeInputHessian (double sigma) |
Protected Member Functions inherited from mirtk::GenericImage< double > | |
void | AllocateImage (VoxelType *=NULL) |
Allocate image memory. | |
Protected Member Functions inherited from mirtk::BaseImage | |
BaseImage () | |
Default constructor. | |
BaseImage (const ImageAttributes &, int=-1) | |
Constructor. | |
BaseImage (const BaseImage &) | |
Copy constructor. | |
void | PutAttributes (const ImageAttributes &) |
Puts attributes of image. | |
void | UpdateMatrix () |
Update coordinate transformation. | |
Protected Member Functions inherited from mirtk::Object | |
template<typename... Args> | |
void | Throw (ErrorType err, const char *func, Args... args) const |
Protected Attributes | |
int | _NumberOfActiveLevels |
Number of active levels. | |
int | _NumberOfPassiveLevels |
Number of passive levels (fixed transformation) | |
int | _Offset [13] |
Offsets of the different registered image channels. | |
Protected Attributes inherited from mirtk::GenericImage< double > | |
VoxelType * | _data |
Pointer to image data. | |
bool | _dataOwner |
Whether image data memory itself is owned by this instance. | |
VoxelType **** | _matrix |
Protected Attributes inherited from mirtk::BaseImage | |
ImageAttributes | _attr |
Image attributes. | |
double | _bg |
Background value - may also be NaN for floating point images. | |
bool | _bgSet |
Whether a background value was set. | |
BinaryImage * | _mask |
Foreground mask. | |
int | _maskOwner |
Matrix | _matI2W |
Transformation matrix from image coordinates to (transformed) world coordinates. | |
Matrix | _matW2I |
Transformation matrix from (transformed) world coordinates to image coordinates. | |
int | _NumberOfVoxels |
Total number of voxels. | |
Additional Inherited Members | |
Static Public Member Functions inherited from mirtk::BaseImage | |
static BaseImage * | New (const char *) |
Read file and construct image. | |
static BaseImage * | New (const BaseImage *) |
Construct image copy of same type. | |
static BaseImage * | New (int) |
Construct image with given voxel type. | |
Static Public Member Functions inherited from mirtk::Object | |
static const char * | NameOfType () |
Get name of this class type. | |
Static Protected Member Functions inherited from mirtk::Object | |
template<typename... Args> | |
static void | ThrowStatic (ErrorType err, const char *cls, const char *func, Args... args) |
Registered image such as fixed target image or transformed source image
An instance of this (multi-channel) image class stores the intensities of a registered image after alignment using the current transformation estimate. If no (changing) transformation is set, the image is considered to be fixed and is thus only updated once during the initialization. If a transformation is set, however, upon every update of the input transformation, the new moving image intensities are computed by applying the current transformation and interpolating the input image intensities. For the computation of the similarity measure gradient, the warped image derivatives are stored along with the intensities in the consecutive image channels of the registered image instance (i.e., t dimension). In case of a gradient field similarity measure, these derivatives include not only the 1st order, but also 2nd order derivatives needed for the similarity measure gradient computation. An image similarity specifies which channels are required for its evaluation by calling the Initialize function with a suitable number of channels (i.e., 1, 4, or 10) and request their udpate using the appropriate parameters of the Update function.
The assignment of the transformed intensities and derivatives to the fourth dimension (i.e. channels) of the registered image is as follows:
Definition at line 70 of file RegisteredImage.h.
|
protected |
(Pre-)compute gradient of input image
[in] | sigma | Standard deviation of Gaussian smoothing filter in voxels. |
|
protected |
(Pre-)compute Hessian of input image
[in] | sigma | Standard deviation of Gaussian smoothing filter in voxels. |
enum InterpolationMode mirtk::RegisteredImage::GetInterpolationMode | ( | ) | const |
Get interpolation mode
When _InterpolationMode is Interpolation_Default, this function returns the respective default interpolation mode with or without padding.
|
virtual |
Initialize image
This function is called by the image similarity to set the attributes of the registered image, i.e., the attributes of the discrete image domain on which similarity is to be evaluated. It initializes the image to zero. The Update function must be called to initialize the output image intensities and derivatives before similarity can be evaluated.
Implements mirtk::BaseImage.
mirtk::RegisteredImage::mirtkPublicAttributeMacro | ( | double | , |
GradientSigma | |||
) |
Standard deviation of Gaussian smoothing kernel applied before 1st order derivative computations in voxel units
mirtk::RegisteredImage::mirtkPublicAttributeMacro | ( | double | , |
HessianSigma | |||
) |
Standard deviation of Gaussian smoothing kernel applied before 2nd order derivative computations in voxel units
mirtk::RegisteredImage::mirtkPublicAttributeMacro | ( | bool | , |
PrecomputeDerivatives | |||
) |
Whether to precompute image derivatives true: Compute derivatives of input image and transform these false: Use derivative of interpolation kernel to evaluate image derivative
mirtk::RegisteredImage::mirtkPublicAttributeMacro | ( | int | , |
MaxGradientPercentile | |||
) |
Maximum gradient magnitude as percentile of all gradient magnitudes
void mirtk::RegisteredImage::Recompute | ( | const blocked_range3d< int > & | region | ) |
Force update of all output channels
This convenience function always recomputes all output channels within the specified image region. To do so, it calls the Update function with force
set to true
. It is commonly used after Initialize in an application where the input image and transformation are not being modified or when the SelfUpdate of the image has been disabled to explicitly recompute the image content after the input was modified.
void mirtk::RegisteredImage::Recompute | ( | ) |
Force update of all output channels
This convenience function always recomputes all output channels. To do so, it calls the Update function with force
set to true
. It is commonly used after Initialize in an application where the input image and transformation are not being modified or when the SelfUpdate of the image has been disabled to explicitly recompute the image content after the input was modified.
void mirtk::RegisteredImage::Update | ( | const blocked_range3d< int > & | region, |
bool | intensity = true , |
||
bool | gradient = false , |
||
bool | hessian = false , |
||
bool | force = false |
||
) |
Update image intensity and transformed derivatives
This function updates the requested output image channels only within the specified image region. If the image is not transformed or only warped by a fixed transformation, this function does nothing. Set force
to true
to initialize this image even if it does not change over the course of the registration or use the corresponding Recompute function.
[in] | region | Image region to update. |
[in] | intensity | Request update of scalar intensities. |
[in] | gradient | Request update of 1st order derivatives. |
[in] | hessian | Request update of 2nd order derivatives. |
[in] | force | Force update in any case. |
void mirtk::RegisteredImage::Update | ( | const blocked_range3d< int > & | region, |
const DisplacementImageType * | disp, | ||
bool | intensity = true , |
||
bool | gradient = false , |
||
bool | hessian = false |
||
) |
Update image intensity and transformed derivatives using custom displacements
[in] | region | Image region to update. |
[in] | disp | Custom displacement field to use. |
[in] | intensity | Request update of scalar intensities. |
[in] | gradient | Request update of 1st order derivatives. |
[in] | hessian | Request update of 2nd order derivatives. |
void mirtk::RegisteredImage::Update | ( | bool | intensity = true , |
bool | gradient = false , |
||
bool | hessian = false , |
||
bool | force = false |
||
) |
Update image intensity and transformed derivatives
This function only updates the specified image channels if the self-update of this image is enabled and only if a (changing) transformation is set. If the image is not transformed or only warped by a fixed transformation, this function does nothing. Use force=true
to initialize this image even if does not change over the course of the registration.
[in] | intensity | Request update of scalar intensities. |
[in] | gradient | Request update of 1st order derivatives. |
[in] | hessian | Request update of 2nd order derivatives. |
[in] | force | Force update in any case. |