interpolate data values from images
More...
#include <vtkAbstractImageInterpolator.h>
|
virtual int | IsA (const char *type) |
|
vtkAbstractImageInterpolator * | NewInstance () const |
|
virtual void | PrintSelf (ostream &os, vtkIndent indent) |
|
virtual void | Initialize (vtkDataObject *data) |
|
virtual void | ReleaseData () |
|
void | DeepCopy (vtkAbstractImageInterpolator *obj) |
|
void | Update () |
|
double | Interpolate (double x, double y, double z, int component) |
|
bool | Interpolate (const double point[3], double *value) |
|
int | ComputeNumberOfComponents (int inputComponents) |
|
int | GetNumberOfComponents () |
|
virtual void | ComputeSupportSize (const double matrix[16], int support[3])=0 |
|
virtual bool | IsSeparable ()=0 |
|
virtual void | FreePrecomputedWeights (vtkInterpolationWeights *&weights) |
|
|
void | SetOutValue (double outValue) |
|
double | GetOutValue () |
|
|
void | SetTolerance (double tol) |
|
double | GetTolerance () |
|
|
void | SetComponentOffset (int offset) |
|
int | GetComponentOffset () |
|
|
void | SetComponentCount (int count) |
|
int | GetComponentCount () |
|
|
void | InterpolateIJK (const double point[3], double *value) |
|
void | InterpolateIJK (const float point[3], float *value) |
|
|
bool | CheckBoundsIJK (const double x[3]) |
|
bool | CheckBoundsIJK (const float x[3]) |
|
|
void | SetBorderMode (int mode) |
|
void | SetBorderModeToClamp () |
|
void | SetBorderModeToRepeat () |
|
void | SetBorderModeToMirror () |
|
int | GetBorderMode () |
|
const char * | GetBorderModeAsString () |
|
|
virtual void | PrecomputeWeightsForExtent (const double matrix[16], const int extent[6], int checkExtent[6], vtkInterpolationWeights *&weights) |
|
virtual void | PrecomputeWeightsForExtent (const float matrix[16], const int extent[6], int checkExtent[6], vtkInterpolationWeights *&weights) |
|
|
void | InterpolateRow (vtkInterpolationWeights *&weights, int xIdx, int yIdx, int zIdx, double *value, int n) |
|
void | InterpolateRow (vtkInterpolationWeights *&weights, int xIdx, int yIdx, int zIdx, float *value, int n) |
|
|
virtual double * | GetSpacing () |
|
virtual void | GetSpacing (double &, double &, double &) |
|
virtual void | GetSpacing (double[3]) |
|
|
virtual double * | GetOrigin () |
|
virtual void | GetOrigin (double &, double &, double &) |
|
virtual void | GetOrigin (double[3]) |
|
|
virtual int * | GetExtent () |
|
virtual void | GetExtent (int &, int &, int &, int &, int &, int &) |
|
virtual void | GetExtent (int[6]) |
|
|
virtual int * | GetWholeExtent () |
|
virtual void | GetWholeExtent (int &, int &, int &, int &, int &, int &) |
|
virtual void | GetWholeExtent (int[6]) |
|
|
virtual vtkObjectBase * | NewInstanceInternal () const |
|
| vtkAbstractImageInterpolator () |
|
| ~vtkAbstractImageInterpolator () |
|
virtual void | InternalUpdate ()=0 |
|
virtual void | InternalDeepCopy (vtkAbstractImageInterpolator *obj)=0 |
|
|
virtual void | GetInterpolationFunc (void(**doublefunc)(vtkInterpolationInfo *, const double[3], double *)) |
|
virtual void | GetInterpolationFunc (void(**floatfunc)(vtkInterpolationInfo *, const float[3], float *)) |
|
|
virtual void | GetRowInterpolationFunc (void(**doublefunc)(vtkInterpolationWeights *, int, int, int, double *, int)) |
|
virtual void | GetRowInterpolationFunc (void(**floatfunc)(vtkInterpolationWeights *, int, int, int, float *, int)) |
|
|
vtkDataArray * | Scalars |
|
double | StructuredBoundsDouble [6] |
|
float | StructuredBoundsFloat [6] |
|
int | WholeExtent [6] |
|
int | Extent [6] |
|
double | Spacing [3] |
|
double | Origin [3] |
|
double | OutValue |
|
double | Tolerance |
|
int | BorderMode |
|
int | ComponentOffset |
|
int | ComponentCount |
|
vtkInterpolationInfo * | InterpolationInfo |
|
void(* | InterpolationFuncDouble )(vtkInterpolationInfo *info, const double point[3], double *outPtr) |
|
void(* | InterpolationFuncFloat )(vtkInterpolationInfo *info, const float point[3], float *outPtr) |
|
void(* | RowInterpolationFuncDouble )(vtkInterpolationWeights *weights, int idX, int idY, int idZ, double *outPtr, int n) |
|
void(* | RowInterpolationFuncFloat )(vtkInterpolationWeights *weights, int idX, int idY, int idZ, float *outPtr, int n) |
|
interpolate data values from images
vtkAbstractImageInterpolator provides an abstract interface for interpolating image data. You specify the data set you want to interpolate values from, then call Interpolate(x,y,z) to interpolate the data.
- Thanks:
- Thanks to David Gobbi at the Seaman Family MR Centre and Dept. of Clinical Neurosciences, Foothills Medical Centre, Calgary, for providing this class.
- See Also
- vtkImageReslice vtkImageInterpolator vtkImageSincInterpolator
Definition at line 45 of file vtkAbstractImageInterpolator.h.
vtkAbstractImageInterpolator::vtkAbstractImageInterpolator |
( |
| ) |
|
|
protected |
vtkAbstractImageInterpolator::~vtkAbstractImageInterpolator |
( |
| ) |
|
|
protected |
static int vtkAbstractImageInterpolator::IsTypeOf |
( |
const char * |
type | ) |
|
|
static |
virtual int vtkAbstractImageInterpolator::IsA |
( |
const char * |
type | ) |
|
|
virtual |
virtual vtkObjectBase* vtkAbstractImageInterpolator::NewInstanceInternal |
( |
| ) |
const |
|
protectedvirtual |
virtual void vtkAbstractImageInterpolator::PrintSelf |
( |
ostream & |
os, |
|
|
vtkIndent |
indent |
|
) |
| |
|
virtual |
virtual void vtkAbstractImageInterpolator::Initialize |
( |
vtkDataObject * |
data | ) |
|
|
virtual |
Initialize the interpolator with the data that you wish to interpolate.
virtual void vtkAbstractImageInterpolator::ReleaseData |
( |
| ) |
|
|
virtual |
Release any data stored by the interpolator.
Copy the interpolator. It is possible to duplicate an interpolator by calling NewInstance() followed by DeepCopy().
void vtkAbstractImageInterpolator::Update |
( |
| ) |
|
Update the interpolator. If the interpolator has been modified by a Set method since Initialize() was called, you must call this method to update the interpolator before you can use it.
double vtkAbstractImageInterpolator::Interpolate |
( |
double |
x, |
|
|
double |
y, |
|
|
double |
z, |
|
|
int |
component |
|
) |
| |
Get the result of interpolating the specified component of the input data, which should be set to zero if there is only one component. If the point is not within the bounds of the data set, then OutValue will be returned. This method is primarily meant for use by the wrapper languages.
bool vtkAbstractImageInterpolator::Interpolate |
( |
const double |
point[3], |
|
|
double * |
value |
|
) |
| |
Sample the input data. This is an inline method that calls the function that performs the appropriate interpolation for the data type. If the point is not within the bounds of the data set, then the return value is false, and each component will be set to the OutValue.
void vtkAbstractImageInterpolator::SetOutValue |
( |
double |
outValue | ) |
|
The value to return when the point is out of bounds.
double vtkAbstractImageInterpolator::GetOutValue |
( |
| ) |
|
|
inline |
void vtkAbstractImageInterpolator::SetTolerance |
( |
double |
tol | ) |
|
The tolerance to apply when checking whether a point is out of bounds. This is a fractional distance relative to the voxel size, so a tolerance of 1 expands the bounds by one voxel.
double vtkAbstractImageInterpolator::GetTolerance |
( |
| ) |
|
|
inline |
The tolerance to apply when checking whether a point is out of bounds. This is a fractional distance relative to the voxel size, so a tolerance of 1 expands the bounds by one voxel.
Definition at line 92 of file vtkAbstractImageInterpolator.h.
void vtkAbstractImageInterpolator::SetComponentOffset |
( |
int |
offset | ) |
|
This method specifies which component of the input will be interpolated, or if ComponentCount is also set, it specifies the first component. When the interpolation is performed, it will be clamped to the number of available components.
int vtkAbstractImageInterpolator::GetComponentOffset |
( |
| ) |
|
|
inline |
This method specifies which component of the input will be interpolated, or if ComponentCount is also set, it specifies the first component. When the interpolation is performed, it will be clamped to the number of available components.
Definition at line 101 of file vtkAbstractImageInterpolator.h.
void vtkAbstractImageInterpolator::SetComponentCount |
( |
int |
count | ) |
|
This method specifies the number of components to extract. The default value is -1, which extracts all available components. When the interpolation is performed, this will be clamped to the number of available components.
int vtkAbstractImageInterpolator::GetComponentCount |
( |
| ) |
|
|
inline |
This method specifies the number of components to extract. The default value is -1, which extracts all available components. When the interpolation is performed, this will be clamped to the number of available components.
Definition at line 110 of file vtkAbstractImageInterpolator.h.
int vtkAbstractImageInterpolator::ComputeNumberOfComponents |
( |
int |
inputComponents | ) |
|
Compute the number of output components based on the ComponentOffset, ComponentCount, and the number of components in the input data.
int vtkAbstractImageInterpolator::GetNumberOfComponents |
( |
| ) |
|
Get the number of components that will be returned when Interpolate() is called. This is only valid after initialization. Before then, use ComputeNumberOfComponents instead.
void vtkAbstractImageInterpolator::InterpolateIJK |
( |
const double |
point[3], |
|
|
double * |
value |
|
) |
| |
|
inline |
A version of Interpolate that takes structured coords instead of data coords. Structured coords are the data coords after subtracting the Origin and dividing by the Spacing.
Definition at line 287 of file vtkAbstractImageInterpolator.h.
void vtkAbstractImageInterpolator::InterpolateIJK |
( |
const float |
point[3], |
|
|
float * |
value |
|
) |
| |
|
inline |
A version of Interpolate that takes structured coords instead of data coords. Structured coords are the data coords after subtracting the Origin and dividing by the Spacing.
Definition at line 293 of file vtkAbstractImageInterpolator.h.
bool vtkAbstractImageInterpolator::CheckBoundsIJK |
( |
const double |
x[3] | ) |
|
|
inline |
Check an x,y,z point to see if it is within the bounds for the structured coords of the image. This is meant to be called prior to InterpolateIJK. The bounds that are checked against are the input image extent plus the tolerance.
Definition at line 299 of file vtkAbstractImageInterpolator.h.
bool vtkAbstractImageInterpolator::CheckBoundsIJK |
( |
const float |
x[3] | ) |
|
|
inline |
Check an x,y,z point to see if it is within the bounds for the structured coords of the image. This is meant to be called prior to InterpolateIJK. The bounds that are checked against are the input image extent plus the tolerance.
Definition at line 307 of file vtkAbstractImageInterpolator.h.
void vtkAbstractImageInterpolator::SetBorderMode |
( |
int |
mode | ) |
|
The border mode (default: clamp). This controls how out-of-bounds lookups are handled, i.e. how data will be extrapolated beyond the bounds of the image. The default is to clamp the lookup point to the bounds. The other modes wrap around to the opposite boundary, or mirror the image at the boundary.
void vtkAbstractImageInterpolator::SetBorderModeToClamp |
( |
| ) |
|
|
inline |
The border mode (default: clamp). This controls how out-of-bounds lookups are handled, i.e. how data will be extrapolated beyond the bounds of the image. The default is to clamp the lookup point to the bounds. The other modes wrap around to the opposite boundary, or mirror the image at the boundary.
Definition at line 146 of file vtkAbstractImageInterpolator.h.
void vtkAbstractImageInterpolator::SetBorderModeToRepeat |
( |
| ) |
|
|
inline |
The border mode (default: clamp). This controls how out-of-bounds lookups are handled, i.e. how data will be extrapolated beyond the bounds of the image. The default is to clamp the lookup point to the bounds. The other modes wrap around to the opposite boundary, or mirror the image at the boundary.
Definition at line 148 of file vtkAbstractImageInterpolator.h.
void vtkAbstractImageInterpolator::SetBorderModeToMirror |
( |
| ) |
|
|
inline |
The border mode (default: clamp). This controls how out-of-bounds lookups are handled, i.e. how data will be extrapolated beyond the bounds of the image. The default is to clamp the lookup point to the bounds. The other modes wrap around to the opposite boundary, or mirror the image at the boundary.
Definition at line 150 of file vtkAbstractImageInterpolator.h.
int vtkAbstractImageInterpolator::GetBorderMode |
( |
| ) |
|
|
inline |
The border mode (default: clamp). This controls how out-of-bounds lookups are handled, i.e. how data will be extrapolated beyond the bounds of the image. The default is to clamp the lookup point to the bounds. The other modes wrap around to the opposite boundary, or mirror the image at the boundary.
Definition at line 152 of file vtkAbstractImageInterpolator.h.
const char* vtkAbstractImageInterpolator::GetBorderModeAsString |
( |
| ) |
|
The border mode (default: clamp). This controls how out-of-bounds lookups are handled, i.e. how data will be extrapolated beyond the bounds of the image. The default is to clamp the lookup point to the bounds. The other modes wrap around to the opposite boundary, or mirror the image at the boundary.
virtual void vtkAbstractImageInterpolator::ComputeSupportSize |
( |
const double |
matrix[16], |
|
|
int |
support[3] |
|
) |
| |
|
pure virtual |
Get the support size for use in computing update extents. If the data will be sampled on a regular grid, then pass a matrix describing the structured coordinate transformation between the output and the input. Otherwise, pass NULL as the matrix to retrieve the full kernel size.
Implemented in vtkImageSincInterpolator, vtkImageBSplineInterpolator, and vtkImageInterpolator.
virtual bool vtkAbstractImageInterpolator::IsSeparable |
( |
| ) |
|
|
pure virtual |
virtual void vtkAbstractImageInterpolator::PrecomputeWeightsForExtent |
( |
const double |
matrix[16], |
|
|
const int |
extent[6], |
|
|
int |
checkExtent[6], |
|
|
vtkInterpolationWeights *& |
weights |
|
) |
| |
|
virtual |
If the data is going to be sampled on a regular grid, then the interpolation weights can be precomputed. A matrix must be supplied that provides a transformation between the provided extent and the structured coordinates of the input. This matrix must perform only permutation, scale, and translation, i.e. each of the three columns must have only one non-zero value. A checkExtent is provided that can be used to check which indices in the extent map to out-of-bounds coordinates in the input data.
Reimplemented in vtkImageSincInterpolator, vtkImageBSplineInterpolator, and vtkImageInterpolator.
virtual void vtkAbstractImageInterpolator::PrecomputeWeightsForExtent |
( |
const float |
matrix[16], |
|
|
const int |
extent[6], |
|
|
int |
checkExtent[6], |
|
|
vtkInterpolationWeights *& |
weights |
|
) |
| |
|
virtual |
If the data is going to be sampled on a regular grid, then the interpolation weights can be precomputed. A matrix must be supplied that provides a transformation between the provided extent and the structured coordinates of the input. This matrix must perform only permutation, scale, and translation, i.e. each of the three columns must have only one non-zero value. A checkExtent is provided that can be used to check which indices in the extent map to out-of-bounds coordinates in the input data.
Reimplemented in vtkImageSincInterpolator, vtkImageBSplineInterpolator, and vtkImageInterpolator.
void vtkAbstractImageInterpolator::InterpolateRow |
( |
vtkInterpolationWeights *& |
weights, |
|
|
int |
xIdx, |
|
|
int |
yIdx, |
|
|
int |
zIdx, |
|
|
double * |
value, |
|
|
int |
n |
|
) |
| |
|
inline |
Get a row of samples, using the weights that were precomputed by PrecomputeWeightsForExtent. Note that each sample may have multiple components. It is possible to select which components will be returned by setting the ComponentOffset and ComponentCount.
Definition at line 315 of file vtkAbstractImageInterpolator.h.
void vtkAbstractImageInterpolator::InterpolateRow |
( |
vtkInterpolationWeights *& |
weights, |
|
|
int |
xIdx, |
|
|
int |
yIdx, |
|
|
int |
zIdx, |
|
|
float * |
value, |
|
|
int |
n |
|
) |
| |
|
inline |
Get a row of samples, using the weights that were precomputed by PrecomputeWeightsForExtent. Note that each sample may have multiple components. It is possible to select which components will be returned by setting the ComponentOffset and ComponentCount.
Definition at line 322 of file vtkAbstractImageInterpolator.h.
virtual double* vtkAbstractImageInterpolator::GetSpacing |
( |
| ) |
|
|
virtual |
Get the spacing of the data being interpolated.
virtual void vtkAbstractImageInterpolator::GetSpacing |
( |
double & |
, |
|
|
double & |
, |
|
|
double & |
|
|
) |
| |
|
virtual |
Get the spacing of the data being interpolated.
virtual void vtkAbstractImageInterpolator::GetSpacing |
( |
double |
[3] | ) |
|
|
virtual |
Get the spacing of the data being interpolated.
virtual double* vtkAbstractImageInterpolator::GetOrigin |
( |
| ) |
|
|
virtual |
Get the origin of the data being interpolated.
virtual void vtkAbstractImageInterpolator::GetOrigin |
( |
double & |
, |
|
|
double & |
, |
|
|
double & |
|
|
) |
| |
|
virtual |
Get the origin of the data being interpolated.
virtual void vtkAbstractImageInterpolator::GetOrigin |
( |
double |
[3] | ) |
|
|
virtual |
Get the origin of the data being interpolated.
virtual int* vtkAbstractImageInterpolator::GetExtent |
( |
| ) |
|
|
virtual |
Get the extent of the data being interpolated.
virtual void vtkAbstractImageInterpolator::GetExtent |
( |
int & |
, |
|
|
int & |
, |
|
|
int & |
, |
|
|
int & |
, |
|
|
int & |
, |
|
|
int & |
|
|
) |
| |
|
virtual |
Get the extent of the data being interpolated.
virtual void vtkAbstractImageInterpolator::GetExtent |
( |
int |
[6] | ) |
|
|
virtual |
Get the extent of the data being interpolated.
virtual int* vtkAbstractImageInterpolator::GetWholeExtent |
( |
| ) |
|
|
virtual |
Get the whole extent of the data being interpolated, including parts of the data that are not currently in memory.
virtual void vtkAbstractImageInterpolator::GetWholeExtent |
( |
int & |
, |
|
|
int & |
, |
|
|
int & |
, |
|
|
int & |
, |
|
|
int & |
, |
|
|
int & |
|
|
) |
| |
|
virtual |
Get the whole extent of the data being interpolated, including parts of the data that are not currently in memory.
virtual void vtkAbstractImageInterpolator::GetWholeExtent |
( |
int |
[6] | ) |
|
|
virtual |
Get the whole extent of the data being interpolated, including parts of the data that are not currently in memory.
virtual void vtkAbstractImageInterpolator::InternalUpdate |
( |
| ) |
|
|
protectedpure virtual |
virtual void vtkAbstractImageInterpolator::GetInterpolationFunc |
( |
void(**)(vtkInterpolationInfo *, const double[3], double *) |
doublefunc | ) |
|
|
protectedvirtual |
virtual void vtkAbstractImageInterpolator::GetInterpolationFunc |
( |
void(**)(vtkInterpolationInfo *, const float[3], float *) |
floatfunc | ) |
|
|
protectedvirtual |
virtual void vtkAbstractImageInterpolator::GetRowInterpolationFunc |
( |
void(**)(vtkInterpolationWeights *, int, int, int, double *, int) |
doublefunc | ) |
|
|
protectedvirtual |
virtual void vtkAbstractImageInterpolator::GetRowInterpolationFunc |
( |
void(**)(vtkInterpolationWeights *, int, int, int, float *, int) |
floatfunc | ) |
|
|
protectedvirtual |
vtkDataArray* vtkAbstractImageInterpolator::Scalars |
|
protected |
double vtkAbstractImageInterpolator::StructuredBoundsDouble[6] |
|
protected |
float vtkAbstractImageInterpolator::StructuredBoundsFloat[6] |
|
protected |
int vtkAbstractImageInterpolator::WholeExtent[6] |
|
protected |
int vtkAbstractImageInterpolator::Extent[6] |
|
protected |
double vtkAbstractImageInterpolator::Spacing[3] |
|
protected |
double vtkAbstractImageInterpolator::Origin[3] |
|
protected |
double vtkAbstractImageInterpolator::OutValue |
|
protected |
double vtkAbstractImageInterpolator::Tolerance |
|
protected |
int vtkAbstractImageInterpolator::BorderMode |
|
protected |
int vtkAbstractImageInterpolator::ComponentOffset |
|
protected |
int vtkAbstractImageInterpolator::ComponentCount |
|
protected |
void(* vtkAbstractImageInterpolator::InterpolationFuncDouble)(vtkInterpolationInfo *info, const double point[3], double *outPtr) |
|
protected |
void(* vtkAbstractImageInterpolator::InterpolationFuncFloat)(vtkInterpolationInfo *info, const float point[3], float *outPtr) |
|
protected |
void(* vtkAbstractImageInterpolator::RowInterpolationFuncDouble)(vtkInterpolationWeights *weights, int idX, int idY, int idZ, double *outPtr, int n) |
|
protected |
void(* vtkAbstractImageInterpolator::RowInterpolationFuncFloat)(vtkInterpolationWeights *weights, int idX, int idY, int idZ, float *outPtr, int n) |
|
protected |
The documentation for this class was generated from the following file: