Main Page
Groups
Namespace List
Class Hierarchy
Alphabetical List
Compound List
File
List
Namespace Members
Compound Members
File Members
Concepts
itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage > Class Template Reference
[Image Gradient Filters]
Computes a scalar, gradient magnitude image from a multiple channel (pixels are vectors) input.
More...
#include <itkVectorGradientMagnitudeImageFilter.h>
Inheritance diagram for itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >:
[legend]Collaboration diagram for itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >:
[legend]List of all members.
|
Public Types |
typedef VectorGradientMagnitudeImageFilter | Self |
typedef ImageToImageFilter<
TInputImage, TOutputImage > | Superclass |
typedef SmartPointer< Self > | Pointer |
typedef SmartPointer< const
Self > | ConstPointer |
typedef TOutputImage::PixelType | OutputPixelType |
typedef TInputImage::PixelType | InputPixelType |
typedef TInputImage | InputImageType |
typedef TOutputImage | OutputImageType |
typedef InputImageType::Pointer | InputImagePointer |
typedef OutputImageType::Pointer | OutputImagePointer |
typedef TRealType | RealType |
typedef Vector< TRealType,
::itk::GetVectorDimension<
InputPixelType >::VectorDimension > | RealVectorType |
typedef Image< RealVectorType,
::itk::GetImageDimension<
TInputImage >::ImageDimension > | RealVectorImageType |
typedef ConstNeighborhoodIterator<
RealVectorImageType > | ConstNeighborhoodIteratorType |
typedef Superclass::OutputImageRegionType | OutputImageRegionType |
Public Member Functions |
virtual const char * | GetClassName () const |
| itkStaticConstMacro (ImageDimension, unsigned int, TOutputImage::ImageDimension) |
| itkStaticConstMacro (VectorDimension, unsigned int, InputPixelType::Dimension) |
virtual void | GenerateInputRequestedRegion () throw (InvalidRequestedRegionError) |
void | SetUseImageSpacingOn () |
void | SetUseImageSpacingOff () |
|
void | SetUseImageSpacing (bool) |
virtual bool | GetUseImageSpacing () |
|
void | SetDerivativeWeights (TRealType data[]) |
virtual const TRealType * | GetDerivativeWeights () const |
|
virtual void | SetComponentWeights (TRealType data[]) |
virtual const TRealType * | GetComponentWeights () const |
|
virtual void | SetUsePrincipleComponents (bool _arg) |
virtual bool | GetUsePrincipleComponents () |
void | SetUsePrincipleComponentsOn () |
void | SetUsePrincipleComponentsOff () |
Static Public Member Functions |
Pointer | New () |
int | CubicSolver (double *, double *) |
Protected Member Functions |
| VectorGradientMagnitudeImageFilter () |
virtual | ~VectorGradientMagnitudeImageFilter () |
void | BeforeThreadedGenerateData () |
void | ThreadedGenerateData (const OutputImageRegionType &outputRegionForThread, int threadId) |
void | PrintSelf (std::ostream &os, Indent indent) const |
TRealType | NonPCEvaluateAtNeighborhood (const ConstNeighborhoodIteratorType &it) const |
TRealType | EvaluateAtNeighborhood3D (const ConstNeighborhoodIteratorType &it) const |
TRealType | EvaluateAtNeighborhood (const ConstNeighborhoodIteratorType &it) const |
Protected Attributes |
TRealType | m_DerivativeWeights [itk::GetImageDimension< TInputImage >::ImageDimension] |
TRealType | m_ComponentWeights [itk::GetVectorDimension< InputPixelType >::VectorDimension] |
TRealType | m_SqrtComponentWeights [itk::GetVectorDimension< InputPixelType >::VectorDimension] |
Detailed Description
template<typename TInputImage, typename TRealType = float, typename TOutputImage = Image< TRealType, ::itk::GetImageDimension<TInputImage>::ImageDimension >>
class itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >
Computes a scalar, gradient magnitude image from a multiple channel (pixels are vectors) input.
- Overview
- This filter has two calculation modes. The first (default) mode calculates gradient magnitude as the difference between the largest two eigenvalues in a principle component analysis of the partial derivatives [1]. The gradient is then based on the direction of maximal change, and is a characterization of how "elongated" the point-spread of the analysis is found to be.
The second, more heuristic, calculation mode finds gradient magnitude as the square-root of the sum of the * individual weighted vector component derivative sums squared. That is, * , where * is the channel of vector image of dimension . * Weighting terms are applied to each vector component.
The second mode is computationally much faster than the first and has the advantage that it is automatically multi-threaded (some vnl functions used in the first mode are not thread-safe). The first mode, however, tends to give intuitively better results with less (or no) parameter tuning.
- Template Parameters (Input and Output)
- This filter has one required template parameter which defines the input image type. The pixel type of the input image is assumed to be a vector (e.g., itk::Vector, itk::RGBPixel, itk::FixedArray). The scalar type of the vector components must be castable to floating point. Instantiating with an image of RGBPixel<unsigned short>, for example, is allowed, but the filter will convert it to an image of Vector<float,3> for processing.
The second template parameter, TRealType, can be optionally specified to define the scalar numerical type used in calculations. This is the component type of the output image, which will be of itk::Vector<TRealType, N>, where N is the number of channels in the multiple component input image. The default type of TRealType is float. For extra precision, you may safely change this parameter to double.
The third template parameter is the output image type. The third parameter will be automatically constructed from the first and second parameters, so it is not necessary (or advisable) to set this parameter explicitly. Given an M-channel input image with dimensionality N, and a numerical type specified as TRealType, the output image will be of type itk::Image<itk::Vector<TRealType, M>, N>.
- Filter Parameters
- The methods Set/GetUsePrincipleComponents and SetUsePrincipleComponentsOn/Off determine controls the calculation mode that is used.
The method SetUseImageSpacingOn will cause derivatives in the image to be scaled (inversely) with the pixel size of the input image, effectively taking derivatives in world coordinates (versus isotropic image space). SetUseImageSpacingOff turns this functionality off. Default is UseImageSpacingOff (all weights are 1.0). The parameter UseImageSpacing can be set directly with the method SetUseImageSpacing(bool).
Weights can be applied to the derivatives directly using the SetDerivativeWeights method. Note that if UseImageSpacing is set to TRUE (ON), then these weights will be overridden by weights derived from the image spacing when the filter is updated. The argument to this method is a C array of TRealValue type.
Weights can be applied to each vector component of the image when the component derivative values are summed during computation. Specify these weights using the SetComponentWeights method. The argument to this method is a C array of TRealValue type.
- Constraints
- The filter requires an image with at least two dimensions and a vector length of at least 2. The theory supports extension to scalar images, but the implementation of the itk vector classes do not
The template parameter TRealType must be floating point (float or double) or a user-defined "real" numerical type with arithmetic operations defined sufficient to compute derivatives.
- Performance
- This filter will automatically multithread if run with SetUsePrincipleComponents=Off or on 3D data in UsePrincipleComponents=On mode. Unfortunately the ND eigen solver used is not thread safe (a special 3D solver is), so it cannot multithread for data other than 3D in UsePrincipleComponents=On mode.
- References
[1] G. Sapiro and D. Ringach, "Anisotropic Diffusion of Multivalued Images with Application to Color Filtering," IEEE Transactions on Image Processing, Vol 5, No. 11 pp. 1582-1586, 1996
- See also:
- Image
Neighborhood
NeighborhoodOperator
NeighborhoodIterator
Definition at line 137 of file itkVectorGradientMagnitudeImageFilter.h.
Member Typedef Documentation
template<typename TInputImage, typename TRealType = float, typename TOutputImage = Image< TRealType, ::itk::GetImageDimension<TInputImage>::ImageDimension >> |
typedef TInputImage itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::InputImageType |
|
template<typename TInputImage, typename TRealType = float, typename TOutputImage = Image< TRealType, ::itk::GetImageDimension<TInputImage>::ImageDimension >> |
typedef TInputImage::PixelType itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::InputPixelType |
|
template<typename TInputImage, typename TRealType = float, typename TOutputImage = Image< TRealType, ::itk::GetImageDimension<TInputImage>::ImageDimension >> |
typedef TOutputImage itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::OutputImageType |
|
template<typename TInputImage, typename TRealType = float, typename TOutputImage = Image< TRealType, ::itk::GetImageDimension<TInputImage>::ImageDimension >> |
typedef TOutputImage::PixelType itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::OutputPixelType |
|
template<typename TInputImage, typename TRealType = float, typename TOutputImage = Image< TRealType, ::itk::GetImageDimension<TInputImage>::ImageDimension >> |
typedef TRealType itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::RealType |
|
Constructor & Destructor Documentation
Member Function Documentation
template<typename TInputImage, typename TRealType = float, typename TOutputImage = Image< TRealType, ::itk::GetImageDimension<TInputImage>::ImageDimension >> |
void itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::BeforeThreadedGenerateData |
( |
|
) |
[protected, virtual] |
|
|
Do any necessary casting/copying of the input data. Input pixel types whose value types are not real number types must be cast to real number types.
Reimplemented from itk::ImageSource< TOutputImage >.
|
template<typename TInputImage, typename TRealType = float, typename TOutputImage = Image< TRealType, ::itk::GetImageDimension<TInputImage>::ImageDimension >> |
int itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::CubicSolver |
( |
double * |
, |
|
|
double * |
|
|
) |
[static] |
|
|
A specialized solver for finding the roots of a cubic polynomial. Necessary to multi-thread the 3D case |
template<typename TInputImage, typename TRealType = float, typename TOutputImage = Image< TRealType, ::itk::GetImageDimension<TInputImage>::ImageDimension >> |
TRealType itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::EvaluateAtNeighborhood |
( |
const ConstNeighborhoodIteratorType & |
it |
) |
const [inline, protected] |
|
template<typename TInputImage, typename TRealType = float, typename TOutputImage = Image< TRealType, ::itk::GetImageDimension<TInputImage>::ImageDimension >> |
TRealType itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::EvaluateAtNeighborhood3D |
( |
const ConstNeighborhoodIteratorType & |
it |
) |
const [inline, protected] |
|
template<typename TInputImage, typename TRealType = float, typename TOutputImage = Image< TRealType, ::itk::GetImageDimension<TInputImage>::ImageDimension >> |
virtual void itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::GenerateInputRequestedRegion |
( |
|
) |
throw (InvalidRequestedRegionError) [virtual] |
|
template<typename TInputImage, typename TRealType = float, typename TOutputImage = Image< TRealType, ::itk::GetImageDimension<TInputImage>::ImageDimension >> |
virtual const char* itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::GetClassName |
( |
|
) |
const [virtual] |
|
template<typename TInputImage, typename TRealType = float, typename TOutputImage = Image< TRealType, ::itk::GetImageDimension<TInputImage>::ImageDimension >> |
virtual const TRealType* itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::GetComponentWeights |
( |
|
) |
const [virtual] |
|
|
Set/Get the array of weightings for the different components of the vector. Default values are 1.0. |
template<typename TInputImage, typename TRealType = float, typename TOutputImage = Image< TRealType, ::itk::GetImageDimension<TInputImage>::ImageDimension >> |
virtual const TRealType* itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::GetDerivativeWeights |
( |
|
) |
const [virtual] |
|
|
Directly Set/Get the array of weights used in the gradient calculations. Note that calling UseImageSpacingOn will clobber these values. |
template<typename TInputImage, typename TRealType = float, typename TOutputImage = Image< TRealType, ::itk::GetImageDimension<TInputImage>::ImageDimension >> |
virtual bool itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::GetUseImageSpacing |
( |
|
) |
[virtual] |
|
|
Set/Get whether or not the filter will use the spacing of the input image in its calculations |
template<typename TInputImage, typename TRealType = float, typename TOutputImage = Image< TRealType, ::itk::GetImageDimension<TInputImage>::ImageDimension >> |
virtual bool itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::GetUsePrincipleComponents |
( |
|
) |
[virtual] |
|
|
Set/Get principle components calculation mode. When this is set to TRUE/ON, the gradient calculation will involve a priniciple component analysis of the partial derivatives of the color components. When this value is set to FALSE/OFF, the calculation is done as a square root of weighted sum of the derivatives squared. Default is UsePrincipleComponents = true. |
template<typename TInputImage, typename TRealType = float, typename TOutputImage = Image< TRealType, ::itk::GetImageDimension<TInputImage>::ImageDimension >> |
itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::itkStaticConstMacro |
( |
VectorDimension |
, |
|
|
unsigned |
int, |
|
|
InputPixelType::Dimension |
|
|
) |
|
|
|
Length of the vector pixel type of the input image. |
template<typename TInputImage, typename TRealType = float, typename TOutputImage = Image< TRealType, ::itk::GetImageDimension<TInputImage>::ImageDimension >> |
itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::itkStaticConstMacro |
( |
ImageDimension |
, |
|
|
unsigned |
int, |
|
|
TOutputImage::ImageDimension |
|
|
) |
|
|
|
The dimensionality of the input and output images. |
template<typename TInputImage, typename TRealType = float, typename TOutputImage = Image< TRealType, ::itk::GetImageDimension<TInputImage>::ImageDimension >> |
Pointer itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::New |
( |
|
) |
[static] |
|
|
Method for creation through the object factory.
Reimplemented from itk::Object.
|
template<typename TInputImage, typename TRealType = float, typename TOutputImage = Image< TRealType, ::itk::GetImageDimension<TInputImage>::ImageDimension >> |
TRealType itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::NonPCEvaluateAtNeighborhood |
( |
const ConstNeighborhoodIteratorType & |
it |
) |
const [inline, protected] |
|
template<typename TInputImage, typename TRealType = float, typename TOutputImage = Image< TRealType, ::itk::GetImageDimension<TInputImage>::ImageDimension >> |
void itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::PrintSelf |
( |
std::ostream & |
os, |
|
|
Indent |
indent |
|
) |
const [protected, virtual] |
|
template<typename TInputImage, typename TRealType = float, typename TOutputImage = Image< TRealType, ::itk::GetImageDimension<TInputImage>::ImageDimension >> |
virtual void itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::SetComponentWeights |
( |
TRealType |
data[] |
) |
[virtual] |
|
|
Set/Get the array of weightings for the different components of the vector. Default values are 1.0. |
template<typename TInputImage, typename TRealType = float, typename TOutputImage = Image< TRealType, ::itk::GetImageDimension<TInputImage>::ImageDimension >> |
void itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::SetDerivativeWeights |
( |
TRealType |
data[] |
) |
|
|
|
Directly Set/Get the array of weights used in the gradient calculations. Note that calling UseImageSpacingOn will clobber these values. |
template<typename TInputImage, typename TRealType = float, typename TOutputImage = Image< TRealType, ::itk::GetImageDimension<TInputImage>::ImageDimension >> |
void itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::SetUseImageSpacing |
( |
bool |
|
) |
|
|
|
Set/Get whether or not the filter will use the spacing of the input image in its calculations |
template<typename TInputImage, typename TRealType = float, typename TOutputImage = Image< TRealType, ::itk::GetImageDimension<TInputImage>::ImageDimension >> |
void itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::SetUseImageSpacingOff |
( |
|
) |
[inline] |
|
|
Reset the derivative weights to ignore image spacing. Use this option if you want to calculate the gradient in the image space. Default is ImageSpacingOff. Definition at line 204 of file itkVectorGradientMagnitudeImageFilter.h. |
template<typename TInputImage, typename TRealType = float, typename TOutputImage = Image< TRealType, ::itk::GetImageDimension<TInputImage>::ImageDimension >> |
void itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::SetUseImageSpacingOn |
( |
|
) |
[inline] |
|
|
Set the derivative weights according to the spacing of the input image (1/spacing). Use this option if you want to calculate the gradient in the space in which the data was acquired. Definition at line 198 of file itkVectorGradientMagnitudeImageFilter.h. |
template<typename TInputImage, typename TRealType = float, typename TOutputImage = Image< TRealType, ::itk::GetImageDimension<TInputImage>::ImageDimension >> |
virtual void itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::SetUsePrincipleComponents |
( |
bool |
_arg |
) |
[virtual] |
|
|
Set/Get principle components calculation mode. When this is set to TRUE/ON, the gradient calculation will involve a priniciple component analysis of the partial derivatives of the color components. When this value is set to FALSE/OFF, the calculation is done as a square root of weighted sum of the derivatives squared. Default is UsePrincipleComponents = true. |
template<typename TInputImage, typename TRealType = float, typename TOutputImage = Image< TRealType, ::itk::GetImageDimension<TInputImage>::ImageDimension >> |
void itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::SetUsePrincipleComponentsOff |
( |
|
) |
[inline] |
|
|
Set/Get principle components calculation mode. When this is set to TRUE/ON, the gradient calculation will involve a priniciple component analysis of the partial derivatives of the color components. When this value is set to FALSE/OFF, the calculation is done as a square root of weighted sum of the derivatives squared. Default is UsePrincipleComponents = true. Definition at line 236 of file itkVectorGradientMagnitudeImageFilter.h. |
template<typename TInputImage, typename TRealType = float, typename TOutputImage = Image< TRealType, ::itk::GetImageDimension<TInputImage>::ImageDimension >> |
void itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::SetUsePrincipleComponentsOn |
( |
|
) |
[inline] |
|
|
Set/Get principle components calculation mode. When this is set to TRUE/ON, the gradient calculation will involve a priniciple component analysis of the partial derivatives of the color components. When this value is set to FALSE/OFF, the calculation is done as a square root of weighted sum of the derivatives squared. Default is UsePrincipleComponents = true. Definition at line 232 of file itkVectorGradientMagnitudeImageFilter.h. |
template<typename TInputImage, typename TRealType = float, typename TOutputImage = Image< TRealType, ::itk::GetImageDimension<TInputImage>::ImageDimension >> |
void itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::ThreadedGenerateData |
( |
const OutputImageRegionType & |
outputRegionForThread, |
|
|
int |
threadId |
|
) |
[protected, virtual] |
|
Member Data Documentation
The documentation for this class was generated from the following file:
Generated at Sun Apr 1 02:58:12 2007 for ITK by
1.3.8 written by Dimitri van Heesch,
© 1997-2000