Class for filtering volume images. More...
#include <cmtkFilterVolume.h>
Public Types | |
typedef Types::DataItem | CoupeBlock [COUPE_BLOCK_SIZE] |
Static Public Member Functions | |
static TypedArray::SmartPtr | GaussianFilter (const UniformVolume *volume, const Units::GaussianSigma &width, const Types::Coordinate radius=1.0, const TypedArray *maskData=NULL) |
Apply Gaussian filter. | |
static TypedArray::SmartPtr | CoupeFilter (const UniformVolume *volume, const int windowRadius, const float beta=0.5) |
Apply Coupe denoising filter. | |
static TypedArray::SmartPtr | RohlfingFilter (const UniformVolume *volume, const TypedArray *subjectData, const TypedArray *maskData, const Units::GaussianSigma &iFilterSigma, const Units::GaussianSigma &filterWidth, const Types::Coordinate filterRadius) |
Apply Torsten Rohlfing's single-image intensity-consistent Gaussian filter. | |
static TypedArray::SmartPtr | StudholmeFilter (const UniformVolume *volume, const TypedArray *subjectData, const TypedArray *averageData, const TypedArray *maskData, std::list< TypedArray::SmartPtr > imgList, const Types::DataItem binWidth, const Units::GaussianSigma &filterWidth, const Types::Coordinate filterRadius) |
Apply Colin Studholme's Gaussian filter with registration-based weights. | |
static TypedArray::SmartPtr | StudholmeFilter (const UniformVolume *volume, std::list< TypedArray::SmartPtr > subjectData, const TypedArray *averageData, const TypedArray *maskData, std::list< TypedArray::SmartPtr > imgList, const Types::DataItem binWidth, const Units::GaussianSigma &filterWidth, const Types::Coordinate filterRadius) |
Apply Colin Studholme's Gaussian filter using multiple time points. | |
Static Private Member Functions | |
static Types::DataItem | Mean (CoupeBlock items) |
Return the mean value of a vector of Types::DataItems. | |
static Types::DataItem | Variance (CoupeBlock items, const Types::DataItem mean) |
Return the variance of a vector of Types::DataItems. | |
static void | GetCoupeBlock (CoupeBlock block, const TypedArray *data, const int *dims, const int x, const int y, const int z) |
Fill a CoupeBlock with the block centered around a given voxel. | |
static double | ComputeCoupeWeight (const Types::DataItem smoothingParam, CoupeBlock centerBlock, CoupeBlock outerBlock) |
Compute the NL-weighting factor between two blocks. | |
static void | BlockAddInPlace (CoupeBlock v1, CoupeBlock v2) |
Add two blocks, in-place on the first block. | |
static void | BlockSubtract (CoupeBlock diff, CoupeBlock v1, CoupeBlock v2) |
Subtract two blocks. | |
static void | BlockConstMult (CoupeBlock prod, CoupeBlock items, const Types::DataItem mult) |
Return the product of the input vector multiplied by a constant float. | |
static double | BlockSquaredDistance (CoupeBlock centerBlock, CoupeBlock outerBlock) |
Return the squared Euclidean distance between two blocks. | |
static void | ComputeNLWithinWindow (CoupeBlock NL, const TypedArray *blockLocations, const TypedArray *data, const int *dims, const Types::DataItem smoothingParam, const int x, const int y, const int z, const int windowRadius, const float beta, const TypedArray *localMeansMap, const TypedArray *localVariancesMap, CoupeBlock centerBlock) |
Process a window for NL-means accumulation. |
Class for filtering volume images.
Definition at line 53 of file cmtkFilterVolume.h.
typedef Types::DataItem cmtk::FilterVolume::CoupeBlock[COUPE_BLOCK_SIZE] |
Definition at line 57 of file cmtkFilterVolume.h.
void cmtk::FilterVolume::BlockAddInPlace | ( | CoupeBlock | v1, |
CoupeBlock | v2 | ||
) | [static, private] |
Add two blocks, in-place on the first block.
v1 | First vector addend, becomes the sum |
v2 | Second vector addend |
Definition at line 61 of file cmtkFilterVolume_Coupe.cxx.
References COUPE_BLOCK_SIZE.
void cmtk::FilterVolume::BlockConstMult | ( | CoupeBlock | prod, |
CoupeBlock | items, | ||
const Types::DataItem | mult | ||
) | [static, private] |
Return the product of the input vector multiplied by a constant float.
prod | An block to store the product |
items | An block containing the items to be multiplied |
mult | The constant to multiply by |
Definition at line 78 of file cmtkFilterVolume_Coupe.cxx.
References COUPE_BLOCK_SIZE.
double cmtk::FilterVolume::BlockSquaredDistance | ( | CoupeBlock | centerBlock, |
CoupeBlock | outerBlock | ||
) | [static, private] |
Return the squared Euclidean distance between two blocks.
Definition at line 86 of file cmtkFilterVolume_Coupe.cxx.
References COUPE_BLOCK_SIZE.
void cmtk::FilterVolume::BlockSubtract | ( | CoupeBlock | diff, |
CoupeBlock | v1, | ||
CoupeBlock | v2 | ||
) | [static, private] |
Subtract two blocks.
diff | Block to contain the difference between v1 and v2 |
v1 | First block subtrahend |
v2 | Second block subtrahend |
Definition at line 70 of file cmtkFilterVolume_Coupe.cxx.
References COUPE_BLOCK_SIZE.
double cmtk::FilterVolume::ComputeCoupeWeight | ( | const Types::DataItem | smoothingParam, |
CoupeBlock | centerBlock, | ||
CoupeBlock | outerBlock | ||
) | [static, private] |
Compute the NL-weighting factor between two blocks.
smoothingParam | Smoothing parameter for the weighting function |
centerBlock | The block to be restored using NL-means |
outerBlock | A block to contribute to the restoration of centerBlock |
Definition at line 122 of file cmtkFilterVolume_Coupe.cxx.
void cmtk::FilterVolume::ComputeNLWithinWindow | ( | CoupeBlock | NL, |
const TypedArray * | blockLocations, | ||
const TypedArray * | data, | ||
const int * | dims, | ||
const Types::DataItem | smoothingParam, | ||
const int | x, | ||
const int | y, | ||
const int | z, | ||
const int | windowRadius, | ||
const float | beta, | ||
const TypedArray * | localMeansMap, | ||
const TypedArray * | localVariancesMap, | ||
CoupeBlock | centerBlock | ||
) | [static, private] |
Process a window for NL-means accumulation.
NL | Block in which to put the NL computation |
blockLocations | UNDOCUMENTED |
data | Data array from input 3D image. |
dims | Dimensions of the input 3D image. |
smoothingParam | Smoothing parameter for the weighting function |
x | X-coordinate of volume center. |
y | Y-coordinate of volume center. |
z | Z-coordinate of volume center. |
windowRadius | Distance from center voxel to outer edge of window |
beta | Smoothing adjustment parameter |
localMeansMap | Mean intensity values at each block |
localVariancesMap | Variance of the intensities of the center block |
centerBlock | The block to be restored using NL-means |
Definition at line 138 of file cmtkFilterVolume_Coupe.cxx.
References cmtk::AXIS_X, cmtk::AXIS_Y, cmtk::AXIS_Z, COUPE_BLOCK_RADIUS, COUPE_BLOCK_SIZE, and cmtk::TypedArray::Get().
TypedArray::SmartPtr cmtk::FilterVolume::CoupeFilter | ( | const UniformVolume * | volume, |
const int | windowRadius, | ||
const float | beta = 0.5 |
||
) | [static] |
Apply Coupe denoising filter.
volume | Input 3D image. |
beta | Smoothing adjustment parameter |
windowRadius | Distance from center voxel to outer edge of window |
Definition at line 311 of file cmtkFilterVolume_Coupe.cxx.
References cmtk::AXIS_X, cmtk::AXIS_Y, cmtk::AXIS_Z, COUPE_BLOCK_RADIUS, COUPE_BLOCK_SIZE, cmtk::TypedArray::Get(), cmtk::TypedArray::GetDataSize(), cmtk::DataGrid::GetDims(), cmtk::TypedArray::GetType(), NULL, cmtk::TYPE_DOUBLE, and cmtk::TYPE_INT.
void cmtk::FilterVolume::GetCoupeBlock | ( | CoupeBlock | block, |
const TypedArray * | data, | ||
const int * | dims, | ||
const int | x, | ||
const int | y, | ||
const int | z | ||
) | [static, private] |
Fill a CoupeBlock with the block centered around a given voxel.
Note that this routine will only include existing voxels. So asking for a block near the edge of a volume will produce a truncated block.
block | To store the newly-fetched block |
data | Data array from input 3D image. |
dims | Dimensions of the input 3D image. |
x | X-coordinate of block center. |
y | Y-coordinate of block center. |
z | Z-coordinate of block center. |
Definition at line 99 of file cmtkFilterVolume_Coupe.cxx.
References cmtk::AXIS_X, cmtk::AXIS_Y, COUPE_BLOCK_RADIUS, and cmtk::TypedArray::Get().
Types::DataItem cmtk::FilterVolume::Mean | ( | CoupeBlock | items ) | [static, private] |
Return the mean value of a vector of Types::DataItems.
items | Block of Types::DataItems. |
Definition at line 41 of file cmtkFilterVolume_Coupe.cxx.
References COUPE_BLOCK_SIZE.
Types::DataItem cmtk::FilterVolume::Variance | ( | CoupeBlock | items, |
const Types::DataItem | mean | ||
) | [static, private] |
Return the variance of a vector of Types::DataItems.
items | Block of Types::DataItems. |
mean | The (pre-computed) mean value of the items vector. |
Definition at line 51 of file cmtkFilterVolume_Coupe.cxx.
References COUPE_BLOCK_SIZE.