ITK
4.1.0
Insight Segmentation and Registration Toolkit
|
#include <itkDisplacementFieldJacobianDeterminantFilter.h>
Computes a scalar image from a vector image (e.g., deformation field) input, where each output scalar at each pixel is the Jacobian determinant of the vector field at that location. This calculation is correct in the case where the vector image is a "displacement" from the current location. The computation for the jacobian determinant is: det[ dT/dx ] = det[ I + du/dx ].
Note that the determinant of a zero vector field is also zero, whereas the Jacobian determinant of the corresponding identity warp transformation is 1.0. In order to compute the effective deformation Jacobian determinant 1.0 must be added to the diagonal elements of Jacobian prior to taking the derivative. i.e. det([ (1.0+dx/dx) dx/dy dx/dz ; dy/dx (1.0+dy/dy) dy/dz; dz/dx dz/dy (1.0+dz/dz) ])
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<TRealType, N>.
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.
Currently, dimensions up to and including 4 are supported. This limitation comes from the presence of vnl_det() functions for matrices of dimension up to 4x4.
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.
Definition at line 116 of file itkDisplacementFieldJacobianDeterminantFilter.h.
typedef ConstNeighborhoodIterator< RealVectorImageType > itk::DisplacementFieldJacobianDeterminantFilter< 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 160 of file itkDisplacementFieldJacobianDeterminantFilter.h.
typedef SmartPointer< const Self > itk::DisplacementFieldJacobianDeterminantFilter< TInputImage, TRealType, TOutputImage >::ConstPointer |
Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.
Definition at line 124 of file itkDisplacementFieldJacobianDeterminantFilter.h.
typedef InputImageType::Superclass itk::DisplacementFieldJacobianDeterminantFilter< TInputImage, TRealType, TOutputImage >::ImageBaseType [protected] |
Definition at line 230 of file itkDisplacementFieldJacobianDeterminantFilter.h.
typedef InputImageType::Pointer itk::DisplacementFieldJacobianDeterminantFilter< TInputImage, TRealType, TOutputImage >::InputImagePointer |
Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.
Definition at line 140 of file itkDisplacementFieldJacobianDeterminantFilter.h.
typedef TInputImage itk::DisplacementFieldJacobianDeterminantFilter< TInputImage, TRealType, TOutputImage >::InputImageType |
Image typedef support
Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.
Definition at line 138 of file itkDisplacementFieldJacobianDeterminantFilter.h.
typedef TInputImage::PixelType itk::DisplacementFieldJacobianDeterminantFilter< TInputImage, TRealType, TOutputImage >::InputPixelType |
Definition at line 135 of file itkDisplacementFieldJacobianDeterminantFilter.h.
typedef OutputImageType::Pointer itk::DisplacementFieldJacobianDeterminantFilter< TInputImage, TRealType, TOutputImage >::OutputImagePointer |
Reimplemented from itk::ImageSource< TOutputImage >.
Definition at line 141 of file itkDisplacementFieldJacobianDeterminantFilter.h.
typedef Superclass::OutputImageRegionType itk::DisplacementFieldJacobianDeterminantFilter< TInputImage, TRealType, TOutputImage >::OutputImageRegionType |
Superclass typedefs.
Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.
Definition at line 164 of file itkDisplacementFieldJacobianDeterminantFilter.h.
typedef TOutputImage itk::DisplacementFieldJacobianDeterminantFilter< TInputImage, TRealType, TOutputImage >::OutputImageType |
Some convenient typedefs.
Reimplemented from itk::ImageSource< TOutputImage >.
Definition at line 139 of file itkDisplacementFieldJacobianDeterminantFilter.h.
typedef TOutputImage::PixelType itk::DisplacementFieldJacobianDeterminantFilter< 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 130 of file itkDisplacementFieldJacobianDeterminantFilter.h.
typedef SmartPointer< Self > itk::DisplacementFieldJacobianDeterminantFilter< TInputImage, TRealType, TOutputImage >::Pointer |
Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.
Definition at line 123 of file itkDisplacementFieldJacobianDeterminantFilter.h.
typedef ConstNeighborhoodIteratorType::RadiusType itk::DisplacementFieldJacobianDeterminantFilter< TInputImage, TRealType, TOutputImage >::RadiusType |
Definition at line 161 of file itkDisplacementFieldJacobianDeterminantFilter.h.
typedef TRealType itk::DisplacementFieldJacobianDeterminantFilter< TInputImage, TRealType, TOutputImage >::RealType |
Define the data type and the vector of data type used in calculations.
Definition at line 152 of file itkDisplacementFieldJacobianDeterminantFilter.h.
typedef Image< RealVectorType, ::itk::GetImageDimension< TInputImage >::ImageDimension > itk::DisplacementFieldJacobianDeterminantFilter< TInputImage, TRealType, TOutputImage >::RealVectorImageType |
Definition at line 156 of file itkDisplacementFieldJacobianDeterminantFilter.h.
typedef Vector< TRealType, ::itk::GetVectorDimension< InputPixelType >::VectorDimension > itk::DisplacementFieldJacobianDeterminantFilter< TInputImage, TRealType, TOutputImage >::RealVectorType |
Definition at line 154 of file itkDisplacementFieldJacobianDeterminantFilter.h.
typedef DisplacementFieldJacobianDeterminantFilter itk::DisplacementFieldJacobianDeterminantFilter< TInputImage, TRealType, TOutputImage >::Self |
Standard class typedefs.
Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.
Definition at line 121 of file itkDisplacementFieldJacobianDeterminantFilter.h.
typedef ImageToImageFilter< TInputImage, TOutputImage > itk::DisplacementFieldJacobianDeterminantFilter< TInputImage, TRealType, TOutputImage >::Superclass |
Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.
Definition at line 122 of file itkDisplacementFieldJacobianDeterminantFilter.h.
typedef FixedArray< TRealType, ImageDimension > itk::DisplacementFieldJacobianDeterminantFilter< TInputImage, TRealType, TOutputImage >::WeightsType |
Definition at line 194 of file itkDisplacementFieldJacobianDeterminantFilter.h.
itk::DisplacementFieldJacobianDeterminantFilter< TInputImage, TRealType, TOutputImage >::DisplacementFieldJacobianDeterminantFilter | ( | ) | [protected] |
virtual itk::DisplacementFieldJacobianDeterminantFilter< TInputImage, TRealType, TOutputImage >::~DisplacementFieldJacobianDeterminantFilter | ( | ) | [inline, protected, virtual] |
Definition at line 206 of file itkDisplacementFieldJacobianDeterminantFilter.h.
itk::DisplacementFieldJacobianDeterminantFilter< TInputImage, TRealType, TOutputImage >::DisplacementFieldJacobianDeterminantFilter | ( | const Self & | ) | [private] |
void itk::DisplacementFieldJacobianDeterminantFilter< 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 >.
virtual::itk::LightObject::Pointer itk::DisplacementFieldJacobianDeterminantFilter< TInputImage, TRealType, TOutputImage >::CreateAnother | ( | void | ) | const [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.
virtual TRealType itk::DisplacementFieldJacobianDeterminantFilter< TInputImage, TRealType, TOutputImage >::EvaluateAtNeighborhood | ( | const ConstNeighborhoodIteratorType & | it | ) | const [protected, virtual] |
virtual void itk::DisplacementFieldJacobianDeterminantFilter< TInputImage, TRealType, TOutputImage >::GenerateInputRequestedRegion | ( | ) | throw ( InvalidRequestedRegionError ) [virtual] |
DisplacementFieldJacobianDeterminantFilter needs a larger input requested region than the output requested region (larger by the kernel size to calculate derivatives). As such, DisplacementFieldJacobianDeterminantFilter needs to provide an implementation for GenerateInputRequestedRegion() in order to inform the pipeline execution model.
Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.
virtual const WeightsType& itk::DisplacementFieldJacobianDeterminantFilter< TInputImage, TRealType, TOutputImage >::GetDerivativeWeights | ( | ) | [virtual] |
Directly Set/Get the array of weights used in the gradient calculations. Note that calling UseImageSpacingOn will clobber these values.
virtual const char* itk::DisplacementFieldJacobianDeterminantFilter< TInputImage, TRealType, TOutputImage >::GetNameOfClass | ( | ) | const [virtual] |
Run-time type information (and related methods)
Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.
virtual const RadiusType& itk::DisplacementFieldJacobianDeterminantFilter< TInputImage, TRealType, TOutputImage >::GetNeighborhoodRadius | ( | ) | [protected, virtual] |
Get/Set the neighborhood radius used for gradient computation
virtual const ImageBaseType* itk::DisplacementFieldJacobianDeterminantFilter< TInputImage, TRealType, TOutputImage >::GetRealValuedInputImage | ( | ) | [protected, virtual] |
Get access to the input image casted as real pixel values
virtual bool itk::DisplacementFieldJacobianDeterminantFilter< TInputImage, TRealType, TOutputImage >::GetUseImageSpacing | ( | ) | const [virtual] |
static Pointer itk::DisplacementFieldJacobianDeterminantFilter< TInputImage, TRealType, TOutputImage >::New | ( | ) | [static] |
Method for creation through the object factory.
Reimplemented from itk::Object.
void itk::DisplacementFieldJacobianDeterminantFilter< TInputImage, TRealType, TOutputImage >::operator= | ( | const Self & | ) | [private] |
PushBackInput(), PushFronInput() in the public section force the input to be the type expected by an ImageToImageFilter. However, these methods end of "hiding" the versions from the superclass (ProcessObject) whose arguments are DataObjects. Here, we re-expose the versions from ProcessObject to avoid warnings about hiding methods from the superclass.
Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.
void itk::DisplacementFieldJacobianDeterminantFilter< TInputImage, TRealType, TOutputImage >::PrintSelf | ( | std::ostream & | os, |
Indent | indent | ||
) | const [protected, virtual] |
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 >.
void itk::DisplacementFieldJacobianDeterminantFilter< TInputImage, TRealType, TOutputImage >::SetDerivativeWeights | ( | const WeightsType & | ) |
Directly Set/Get the array of weights used in the gradient calculations. Note that calling UseImageSpacingOn will clobber these values.
virtual void itk::DisplacementFieldJacobianDeterminantFilter< TInputImage, TRealType, TOutputImage >::SetNeighborhoodRadius | ( | RadiusType | _arg | ) | [protected, virtual] |
Get/Set the neighborhood radius used for gradient computation
void itk::DisplacementFieldJacobianDeterminantFilter< TInputImage, TRealType, TOutputImage >::SetUseImageSpacing | ( | bool | ) |
Set/Get whether or not the filter will use the spacing of the input image in its calculations
void itk::DisplacementFieldJacobianDeterminantFilter< TInputImage, TRealType, TOutputImage >::SetUseImageSpacingOff | ( | ) | [inline] |
Reset the derivative weights to ignore image spacing. Use this option if you want to calculate the Jacobian determinant in the image space. Default is ImageSpacingOn.
Definition at line 187 of file itkDisplacementFieldJacobianDeterminantFilter.h.
void itk::DisplacementFieldJacobianDeterminantFilter< 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 Jacobian determinant in the space in which the data was acquired. Default is ImageSpacingOn.
Definition at line 181 of file itkDisplacementFieldJacobianDeterminantFilter.h.
void itk::DisplacementFieldJacobianDeterminantFilter< TInputImage, TRealType, TOutputImage >::ThreadedGenerateData | ( | const OutputImageRegionType & | outputRegionForThread, |
ThreadIdType | threadId | ||
) | [protected, virtual] |
DisplacementFieldJacobianDeterminantFilter can be implemented as a multithreaded filter (we're only using vnl_det(), which is trivially thread safe). 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 >.
const unsigned int itk::DisplacementFieldJacobianDeterminantFilter< TInputImage, TRealType, TOutputImage >::ImageDimension = TOutputImage::ImageDimension [static] |
The dimensionality of the input and output images.
Definition at line 145 of file itkDisplacementFieldJacobianDeterminantFilter.h.
WeightsType itk::DisplacementFieldJacobianDeterminantFilter< TInputImage, TRealType, TOutputImage >::m_DerivativeWeights [protected] |
The weights used to scale partial derivatives during processing
Definition at line 243 of file itkDisplacementFieldJacobianDeterminantFilter.h.
WeightsType itk::DisplacementFieldJacobianDeterminantFilter< TInputImage, TRealType, TOutputImage >::m_HalfDerivativeWeights [protected] |
Pre-compute 0.5*m_DerivativeWeights since that is the only thing used in the computations.
Definition at line 247 of file itkDisplacementFieldJacobianDeterminantFilter.h.
RadiusType itk::DisplacementFieldJacobianDeterminantFilter< TInputImage, TRealType, TOutputImage >::m_NeighborhoodRadius [private] |
Definition at line 261 of file itkDisplacementFieldJacobianDeterminantFilter.h.
ImageBaseType::ConstPointer itk::DisplacementFieldJacobianDeterminantFilter< TInputImage, TRealType, TOutputImage >::m_RealValuedInputImage [private] |
Definition at line 253 of file itkDisplacementFieldJacobianDeterminantFilter.h.
ThreadIdType itk::DisplacementFieldJacobianDeterminantFilter< TInputImage, TRealType, TOutputImage >::m_RequestedNumberOfThreads [private] |
Definition at line 251 of file itkDisplacementFieldJacobianDeterminantFilter.h.
bool itk::DisplacementFieldJacobianDeterminantFilter< TInputImage, TRealType, TOutputImage >::m_UseImageSpacing [private] |
Definition at line 249 of file itkDisplacementFieldJacobianDeterminantFilter.h.
const unsigned int itk::DisplacementFieldJacobianDeterminantFilter< TInputImage, TRealType, TOutputImage >::VectorDimension = InputPixelType::Dimension [static] |
Length of the vector pixel type of the input image.
Definition at line 149 of file itkDisplacementFieldJacobianDeterminantFilter.h.