Public Types | Static Public Member Functions | Static Private Member Functions

cmtk::FilterVolume Class Reference
[cmtkBase Library]

Class for filtering volume images. More...

#include <cmtkFilterVolume.h>

List of all members.

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.

Detailed Description

Class for filtering volume images.

Definition at line 53 of file cmtkFilterVolume.h.


Member Typedef Documentation

Definition at line 57 of file cmtkFilterVolume.h.


Member Function Documentation

void cmtk::FilterVolume::BlockAddInPlace ( CoupeBlock  v1,
CoupeBlock  v2 
) [static, private]

Add two blocks, in-place on the first block.

Parameters:
v1First vector addend, becomes the sum
v2Second 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.

Parameters:
prodAn block to store the product
itemsAn block containing the items to be multiplied
multThe 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.

Parameters:
diffBlock to contain the difference between v1 and v2
v1First block subtrahend
v2Second 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.

Parameters:
smoothingParamSmoothing parameter for the weighting function
centerBlockThe block to be restored using NL-means
outerBlockA 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.

Parameters:
NLBlock in which to put the NL computation
blockLocationsUNDOCUMENTED
dataData array from input 3D image.
dimsDimensions of the input 3D image.
smoothingParamSmoothing parameter for the weighting function
xX-coordinate of volume center.
yY-coordinate of volume center.
zZ-coordinate of volume center.
windowRadiusDistance from center voxel to outer edge of window
betaSmoothing adjustment parameter
localMeansMapMean intensity values at each block
localVariancesMapVariance of the intensities of the center block
centerBlockThe 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.

Parameters:
volumeInput 3D image.
betaSmoothing adjustment parameter
windowRadiusDistance from center voxel to outer edge of window
Returns:
A newly allocated TypedArray object that can be used, for example, to replace the one held by the input image. The data type of the array is identical to the input array.

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.

Parameters:
blockTo store the newly-fetched block
dataData array from input 3D image.
dimsDimensions of the input 3D image.
xX-coordinate of block center.
yY-coordinate of block center.
zZ-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.

Parameters:
itemsBlock 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.

Parameters:
itemsBlock of Types::DataItems.
meanThe (pre-computed) mean value of the items vector.

Definition at line 51 of file cmtkFilterVolume_Coupe.cxx.

References COUPE_BLOCK_SIZE.


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