ITK
4.9.0
Insight Segmentation and Registration Toolkit
|
#include <itkVectorGradientMagnitudeImageFilter.h>
Computes a scalar, gradient magnitude image from a multiple channel (pixels are vectors) input.
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.
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>.
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 UseImageSpacingOn. 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.
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.
[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
Definition at line 139 of file itkVectorGradientMagnitudeImageFilter.h.
Static Public Member Functions | |
static int | CubicSolver (double *, double *) |
static Pointer | New () |
Static Public Member Functions inherited from itk::Object | |
static bool | GetGlobalWarningDisplay () |
static void | GlobalWarningDisplayOff () |
static void | GlobalWarningDisplayOn () |
static Pointer | New () |
static void | SetGlobalWarningDisplay (bool flag) |
Static Public Member Functions inherited from itk::LightObject | |
static void | BreakOnError () |
static Pointer | New () |
Static Public Attributes | |
static const unsigned int | ImageDimension = TOutputImage::ImageDimension |
static const unsigned int | VectorDimension = InputPixelType::Dimension |
Static Public Attributes inherited from itk::ImageToImageFilter< TInputImage, TOutputImage > | |
static const unsigned int | InputImageDimension = TInputImage::ImageDimension |
static const unsigned int | OutputImageDimension = TOutputImage::ImageDimension |
Static Public Attributes inherited from itk::ImageSource< TOutputImage > | |
static const unsigned int | OutputImageDimension = TOutputImage::ImageDimension |
Protected Types | |
typedef InputImageType::Superclass | ImageBaseType |
Protected Types inherited from itk::ImageToImageFilter< TInputImage, TOutputImage > | |
typedef ImageToImageFilterDetail::ImageRegionCopier < itkGetStaticConstMacro(OutputImageDimension), itkGetStaticConstMacro(InputImageDimension) > | InputToOutputRegionCopierType |
typedef ImageToImageFilterDetail::ImageRegionCopier < itkGetStaticConstMacro(InputImageDimension), itkGetStaticConstMacro(OutputImageDimension) > | OutputToInputRegionCopierType |
Protected Attributes | |
WeightsType | m_ComponentWeights |
WeightsType | m_DerivativeWeights |
WeightsType | m_SqrtComponentWeights |
Protected Attributes inherited from itk::ProcessObject | |
TimeStamp | m_OutputInformationMTime |
bool | m_Updating |
Protected Attributes inherited from itk::LightObject | |
AtomicInt< int > | m_ReferenceCount |
Private Member Functions | |
void | operator= (const Self &) ITK_DELETE_FUNCTION |
VectorGradientMagnitudeImageFilter (const Self &) ITK_DELETE_FUNCTION | |
Private Attributes | |
ImageBaseType::ConstPointer | m_RealValuedInputImage |
ThreadIdType | m_RequestedNumberOfThreads |
bool | m_UseImageSpacing |
bool | m_UsePrincipleComponents |
Additional Inherited Members | |
Static Protected Member Functions inherited from itk::ImageSource< TOutputImage > | |
static const ImageRegionSplitterBase * | GetGlobalDefaultSplitter () |
static ITK_THREAD_RETURN_TYPE | ThreaderCallback (void *arg) |
typedef ConstNeighborhoodIterator< RealVectorImageType > itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::ConstNeighborhoodIteratorType |
Type of the iterator that will be used to move through the image. Also the type which will be passed to the evaluate function
Definition at line 183 of file itkVectorGradientMagnitudeImageFilter.h.
typedef SmartPointer< const Self > itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::ConstPointer |
Definition at line 147 of file itkVectorGradientMagnitudeImageFilter.h.
|
protected |
Definition at line 302 of file itkVectorGradientMagnitudeImageFilter.h.
typedef InputImageType::Pointer itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::InputImagePointer |
Definition at line 163 of file itkVectorGradientMagnitudeImageFilter.h.
typedef TInputImage itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::InputImageType |
Image typedef support
Definition at line 161 of file itkVectorGradientMagnitudeImageFilter.h.
typedef TInputImage::PixelType itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::InputPixelType |
Definition at line 158 of file itkVectorGradientMagnitudeImageFilter.h.
typedef OutputImageType::Pointer itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::OutputImagePointer |
Definition at line 164 of file itkVectorGradientMagnitudeImageFilter.h.
typedef Superclass::OutputImageRegionType itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::OutputImageRegionType |
Superclass typedefs.
Definition at line 187 of file itkVectorGradientMagnitudeImageFilter.h.
typedef TOutputImage itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::OutputImageType |
Definition at line 162 of file itkVectorGradientMagnitudeImageFilter.h.
typedef TOutputImage::PixelType itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::OutputPixelType |
Extract some information from the image types. Dimensionality of the two images is assumed to be the same.
Definition at line 153 of file itkVectorGradientMagnitudeImageFilter.h.
typedef SmartPointer< Self > itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::Pointer |
Definition at line 146 of file itkVectorGradientMagnitudeImageFilter.h.
typedef ConstNeighborhoodIteratorType::RadiusType itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::RadiusType |
Definition at line 184 of file itkVectorGradientMagnitudeImageFilter.h.
typedef TRealType itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::RealType |
Define the data type and the vector of data type used in calculations.
Definition at line 175 of file itkVectorGradientMagnitudeImageFilter.h.
typedef Image< RealVectorType, TInputImage::ImageDimension > itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::RealVectorImageType |
Definition at line 179 of file itkVectorGradientMagnitudeImageFilter.h.
typedef Vector< TRealType, InputPixelType::Dimension > itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::RealVectorType |
Definition at line 177 of file itkVectorGradientMagnitudeImageFilter.h.
typedef VectorGradientMagnitudeImageFilter itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::Self |
Standard class typedefs.
Definition at line 144 of file itkVectorGradientMagnitudeImageFilter.h.
typedef ImageToImageFilter< TInputImage, TOutputImage > itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::Superclass |
Definition at line 145 of file itkVectorGradientMagnitudeImageFilter.h.
typedef FixedArray< TRealType, VectorDimension > itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::WeightsType |
Definition at line 216 of file itkVectorGradientMagnitudeImageFilter.h.
|
protected |
|
inlineprotectedvirtual |
Definition at line 279 of file itkVectorGradientMagnitudeImageFilter.h.
|
private |
|
overrideprotectedvirtual |
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 >.
|
virtual |
Create an object from an instance, potentially deferring to a factory. This method allows you to create an instance of an object that is exactly the same type as the referring object. This is useful in cases where an object has been cast back to a base class.
Reimplemented from itk::Object.
|
static |
A specialized solver for finding the roots of a cubic polynomial. Necessary to multi-thread the 3D case
Referenced by itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::EvaluateAtNeighborhood3D().
|
inlineprotected |
Definition at line 442 of file itkVectorGradientMagnitudeImageFilter.h.
References itk::ConstNeighborhoodIterator< TImage, TBoundaryCondition >::GetNext(), itk::ConstNeighborhoodIterator< TImage, TBoundaryCondition >::GetPrevious(), itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::ImageDimension, itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::m_DerivativeWeights, itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::m_SqrtComponentWeights, and itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::VectorDimension.
|
inlineprotected |
Definition at line 327 of file itkVectorGradientMagnitudeImageFilter.h.
References itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::CubicSolver(), itk::ConstNeighborhoodIterator< TImage, TBoundaryCondition >::GetNext(), itk::ConstNeighborhoodIterator< TImage, TBoundaryCondition >::GetPrevious(), itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::ImageDimension, itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::m_DerivativeWeights, itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::m_SqrtComponentWeights, and itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::VectorDimension.
|
overridevirtual |
VectorGradientMagnitudeImageFilter needs a larger input requested region than the output requested region (larger by the kernel size to calculate derivatives). As such, VectorGradientMagnitudeImageFilter needs to provide an implementation for GenerateInputRequestedRegion() in order to inform the pipeline execution model.
Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.
|
virtual |
Set/Get the array of weightings for the different components of the vector. Default values are 1.0.
|
virtual |
Directly Set/Get the array of weights used in the gradient calculations. Note that calling UseImageSpacingOn will clobber these values.
|
virtual |
Run-time type information (and related methods)
Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.
|
protectedvirtual |
Get access to the input image casted as real pixel values
|
virtual |
|
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.
|
static |
Method for creation through the object factory.
|
inlineprotected |
Definition at line 307 of file itkVectorGradientMagnitudeImageFilter.h.
References itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::ImageDimension, itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::m_DerivativeWeights, itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::m_SqrtComponentWeights, itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::VectorDimension, and itk::NumericTraits< T >::ZeroValue().
|
private |
|
overrideprotectedvirtual |
Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.
Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.
|
virtual |
Set/Get the array of weightings for the different components of the vector. Default values are 1.0.
|
virtual |
Directly Set/Get the array of weights used in the gradient calculations. Note that calling UseImageSpacingOn will clobber these values.
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
Referenced by itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::SetUseImageSpacingOff(), and itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::SetUseImageSpacingOn().
|
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 ImageSpacingOn.
Definition at line 209 of file itkVectorGradientMagnitudeImageFilter.h.
References itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::SetUseImageSpacing().
|
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. Default is ImageSpacingOn.
Definition at line 203 of file itkVectorGradientMagnitudeImageFilter.h.
References itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::SetUseImageSpacing().
|
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.
Referenced by itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::SetUsePrincipleComponentsOff(), and itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::SetUsePrincipleComponentsOn().
|
inline |
Definition at line 259 of file itkVectorGradientMagnitudeImageFilter.h.
References itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::SetUsePrincipleComponents().
|
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 253 of file itkVectorGradientMagnitudeImageFilter.h.
References itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::SetUsePrincipleComponents().
|
overrideprotectedvirtual |
VectorGradientMagnitudeImageFilter can be implemented as a multithreaded filter. Therefore, this implementation provides a ThreadedGenerateData() routine which is called for each processing thread. The output image data is allocated automatically by the superclass prior to calling ThreadedGenerateData(). ThreadedGenerateData can only write to the portion of the output image specified by the parameter "outputRegionForThread"
Reimplemented from itk::ImageSource< TOutputImage >.
itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::typedef | ( | Concept::HasNumericTraits< typename InputPixelType::ValueType > | ) |
This class requires InputHasNumericTraitsCheck in the form of ( Concept::HasNumericTraits< typename InputPixelType::ValueType > )
itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::typedef | ( | Concept::HasNumericTraits< RealType > | ) |
This class requires RealTypeHasNumericTraitsCheck in the form of ( Concept::HasNumericTraits< RealType > )
|
static |
The dimensionality of the input and output images.
Definition at line 168 of file itkVectorGradientMagnitudeImageFilter.h.
Referenced by itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::EvaluateAtNeighborhood(), itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::EvaluateAtNeighborhood3D(), and itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::NonPCEvaluateAtNeighborhood().
|
protected |
These weights are used to scale vector component values when they are combined to produce a scalar. The square root
Definition at line 484 of file itkVectorGradientMagnitudeImageFilter.h.
|
protected |
The weights used to scale derivatives during processing
Definition at line 479 of file itkVectorGradientMagnitudeImageFilter.h.
Referenced by itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::EvaluateAtNeighborhood(), itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::EvaluateAtNeighborhood3D(), and itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::NonPCEvaluateAtNeighborhood().
|
private |
Definition at line 493 of file itkVectorGradientMagnitudeImageFilter.h.
|
private |
Definition at line 491 of file itkVectorGradientMagnitudeImageFilter.h.
|
protected |
Definition at line 485 of file itkVectorGradientMagnitudeImageFilter.h.
Referenced by itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::EvaluateAtNeighborhood(), itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::EvaluateAtNeighborhood3D(), and itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::NonPCEvaluateAtNeighborhood().
|
private |
Definition at line 488 of file itkVectorGradientMagnitudeImageFilter.h.
|
private |
Definition at line 489 of file itkVectorGradientMagnitudeImageFilter.h.
|
static |
Length of the vector pixel type of the input image.
Definition at line 172 of file itkVectorGradientMagnitudeImageFilter.h.
Referenced by itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::EvaluateAtNeighborhood(), itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::EvaluateAtNeighborhood3D(), and itk::VectorGradientMagnitudeImageFilter< TInputImage, TRealType, TOutputImage >::NonPCEvaluateAtNeighborhood().