ITK
5.2.0
Insight Toolkit
|
#include <itkCentralDifferenceImageFunction.h>
Classes | |
struct | OutputTypeSpecializationStructType |
Public Types | |
using | ConstPointer = SmartPointer< const Self > |
using | ContinuousIndexType = typename Superclass::ContinuousIndexType |
using | IndexType = typename Superclass::IndexType |
using | InputImageType = TInputImage |
using | InputPixelConvertType = DefaultConvertPixelTraits< InputPixelType > |
using | InputPixelType = typename InputImageType::PixelType |
using | InterpolatorPointer = typename InterpolatorType::Pointer |
using | InterpolatorType = InterpolateImageFunction< TInputImage, TCoordRep > |
using | OutputConvertType = DefaultConvertPixelTraits< OutputType > |
using | OutputType = typename Superclass::OutputType |
using | OutputValueType = typename OutputConvertType::ComponentType |
using | Pointer = SmartPointer< Self > |
using | PointType = typename Superclass::PointType |
using | ScalarDerivativeType = CovariantVector< OutputValueType, Self::ImageDimension > |
using | Self = CentralDifferenceImageFunction |
using | SpacingType = typename TInputImage::SpacingType |
using | Superclass = ImageFunction< TInputImage, TOutputType, TCoordRep > |
Public Types inherited from itk::ImageFunction< TInputImage, TOutputType, TCoordRep > | |
using | ConstPointer = SmartPointer< const Self > |
using | ContinuousIndexType = ContinuousIndex< TCoordRep, Self::ImageDimension > |
using | CoordRepType = TCoordRep |
using | IndexType = typename InputImageType::IndexType |
using | IndexValueType = typename InputImageType::IndexValueType |
using | InputImageConstPointer = typename InputImageType::ConstPointer |
using | InputImageType = TInputImage |
using | InputPixelType = typename InputImageType::PixelType |
using | OutputType = TOutputType |
using | Pointer = SmartPointer< Self > |
using | PointType = Point< TCoordRep, Self::ImageDimension > |
using | Self = ImageFunction |
using | Superclass = FunctionBase< Point< TCoordRep, Self::ImageDimension >, TOutputType > |
Public Types inherited from itk::FunctionBase< Point< TCoordRep, TInputImage::ImageDimension >, TOutputType > | |
using | ConstPointer = SmartPointer< const Self > |
using | InputType = Point< TCoordRep, TInputImage::ImageDimension > |
using | OutputType = TOutputType |
using | Pointer = SmartPointer< Self > |
using | Self = FunctionBase |
using | Superclass = Object |
Public Types inherited from itk::Object | |
using | ConstPointer = SmartPointer< const Self > |
using | Pointer = SmartPointer< Self > |
using | Self = Object |
using | Superclass = LightObject |
Public Types inherited from itk::LightObject | |
using | ConstPointer = SmartPointer< const Self > |
using | Pointer = SmartPointer< Self > |
using | Self = LightObject |
Public Member Functions | |
virtual ::itk::LightObject::Pointer | CreateAnother () const |
OutputType | Evaluate (const PointType &point) const override |
OutputType | EvaluateAtContinuousIndex (const ContinuousIndexType &cindex) const override |
OutputType | EvaluateAtIndex (const IndexType &index) const override |
virtual const InterpolatorType * | GetInterpolator () const |
virtual InterpolatorType * | GetModifiableInterpolator () |
virtual const char * | GetNameOfClass () const |
void | SetInputImage (const TInputImage *inputData) override |
virtual void | SetInterpolator (InterpolatorType *interpolator) |
Public Member Functions inherited from itk::ImageFunction< TInputImage, TOutputType, TCoordRep > | |
TOutputType | Evaluate (const PointType &point) const override=0 |
virtual TOutputType | EvaluateAtContinuousIndex (const ContinuousIndexType &index) const=0 |
virtual TOutputType | EvaluateAtIndex (const IndexType &index) const=0 |
const InputImageType * | GetInputImage () const |
virtual bool | IsInsideBuffer (const IndexType &index) const |
virtual bool | IsInsideBuffer (const ContinuousIndexType &index) const |
virtual bool | IsInsideBuffer (const PointType &point) const |
void | ConvertPointToNearestIndex (const PointType &point, IndexType &index) const |
void | ConvertPointToContinuousIndex (const PointType &point, ContinuousIndexType &cindex) const |
void | ConvertContinuousIndexToNearestIndex (const ContinuousIndexType &cindex, IndexType &index) const |
virtual const IndexType & | GetStartIndex () const |
virtual const IndexType & | GetEndIndex () const |
virtual const ContinuousIndexType & | GetStartContinuousIndex () const |
virtual const ContinuousIndexType & | GetEndContinuousIndex () const |
Public Member Functions inherited from itk::Object | |
unsigned long | AddObserver (const EventObject &event, Command *) |
unsigned long | AddObserver (const EventObject &event, Command *) const |
unsigned long | AddObserver (const EventObject &event, std::function< void(const EventObject &)> function) const |
virtual void | DebugOff () const |
virtual void | DebugOn () const |
Command * | GetCommand (unsigned long tag) |
bool | GetDebug () const |
MetaDataDictionary & | GetMetaDataDictionary () |
const MetaDataDictionary & | GetMetaDataDictionary () const |
virtual ModifiedTimeType | GetMTime () const |
virtual const TimeStamp & | GetTimeStamp () const |
bool | HasObserver (const EventObject &event) const |
void | InvokeEvent (const EventObject &) |
void | InvokeEvent (const EventObject &) const |
virtual void | Modified () const |
void | Register () const override |
void | RemoveAllObservers () |
void | RemoveObserver (unsigned long tag) |
void | SetDebug (bool debugFlag) const |
void | SetReferenceCount (int) override |
void | UnRegister () const noexcept override |
void | SetMetaDataDictionary (const MetaDataDictionary &rhs) |
void | SetMetaDataDictionary (MetaDataDictionary &&rrhs) |
virtual void | SetObjectName (std::string _arg) |
virtual const std::string & | GetObjectName () const |
Public Member Functions inherited from itk::LightObject | |
Pointer | Clone () const |
virtual void | Delete () |
virtual int | GetReferenceCount () const |
void | Print (std::ostream &os, Indent indent=0) const |
Static Public Member Functions | |
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 val) |
Static Public Member Functions inherited from itk::LightObject | |
static void | BreakOnError () |
static Pointer | New () |
Additional Inherited Members | |
Protected Member Functions inherited from itk::ImageFunction< TInputImage, TOutputType, TCoordRep > | |
ImageFunction () | |
~ImageFunction () override=default | |
void | PrintSelf (std::ostream &os, Indent indent) const override |
Protected Member Functions inherited from itk::FunctionBase< Point< TCoordRep, TInputImage::ImageDimension >, TOutputType > | |
FunctionBase ()=default | |
~FunctionBase () override=default | |
Protected Member Functions inherited from itk::Object | |
Object () | |
~Object () override | |
bool | PrintObservers (std::ostream &os, Indent indent) const |
virtual void | SetTimeStamp (const TimeStamp &timeStamp) |
Protected Member Functions inherited from itk::LightObject | |
virtual LightObject::Pointer | InternalClone () const |
LightObject () | |
virtual void | PrintHeader (std::ostream &os, Indent indent) const |
virtual void | PrintTrailer (std::ostream &os, Indent indent) const |
virtual | ~LightObject () |
Protected Attributes inherited from itk::ImageFunction< TInputImage, TOutputType, TCoordRep > | |
InputImageConstPointer | m_Image |
IndexType | m_StartIndex |
IndexType | m_EndIndex |
ContinuousIndexType | m_StartContinuousIndex |
ContinuousIndexType | m_EndContinuousIndex |
Protected Attributes inherited from itk::LightObject | |
std::atomic< int > | m_ReferenceCount |
Calculate the derivative by central differencing.
This class is templated over the input image type, the coordinate representation type (e.g. float or double), and the output derivative type.
This class supports both scalar and vector pixel types for the input image, including VectorImage types.
For vector-pixel image types, the TOutputType template parameter must be set to a vector of appropriate size, to accommodate a result for each pixel component in each dimension. The output is packed by pixel component, i.e.
[C0D0, C0D1, ..., C0DN, C1D0, ...]
where C = pixel component, and D = image dimension.
The output type can be, for example:
\code CovariantVector<double, numberOfPixelComponents * ImageDimension> \endcode
or
Possible improvements:
1) speed performance: The template-specialization of the Evaluate*() methods (needed to support vector-pixel types) incur a performance penalty for the scalar-pixel case, when compared with previous scalar-only versions of the code. On MacOS (2.4GHz Core 2 Duo, gcc 4.2) the penalty is 0.5-2%, depending on the method. To recover this loss, the specialization of the methods would have to be done such that a nested subroutine need not be called, ie the specialization is performed on the Evaluate* methods directly. At the moment is seems this can't be done without requiring a template parameter on the methods.
2) the use of Neighborhood operators may improve efficiency.
Definition at line 76 of file itkCentralDifferenceImageFunction.h.
using itk::CentralDifferenceImageFunction< TInputImage, TCoordRep, TOutputType >::ConstPointer = SmartPointer<const Self> |
Definition at line 88 of file itkCentralDifferenceImageFunction.h.
using itk::CentralDifferenceImageFunction< TInputImage, TCoordRep, TOutputType >::ContinuousIndexType = typename Superclass::ContinuousIndexType |
ContinuousIndex type alias support
Definition at line 121 of file itkCentralDifferenceImageFunction.h.
using itk::CentralDifferenceImageFunction< TInputImage, TCoordRep, TOutputType >::IndexType = typename Superclass::IndexType |
Index type alias support
Definition at line 118 of file itkCentralDifferenceImageFunction.h.
using itk::CentralDifferenceImageFunction< TInputImage, TCoordRep, TOutputType >::InputImageType = TInputImage |
InputImageType type alias support
Definition at line 97 of file itkCentralDifferenceImageFunction.h.
using itk::CentralDifferenceImageFunction< TInputImage, TCoordRep, TOutputType >::InputPixelConvertType = DefaultConvertPixelTraits<InputPixelType> |
InputPixelConvert type alias support
Definition at line 103 of file itkCentralDifferenceImageFunction.h.
using itk::CentralDifferenceImageFunction< TInputImage, TCoordRep, TOutputType >::InputPixelType = typename InputImageType::PixelType |
InputPixelType type alias support
Definition at line 100 of file itkCentralDifferenceImageFunction.h.
using itk::CentralDifferenceImageFunction< TInputImage, TCoordRep, TOutputType >::InterpolatorPointer = typename InterpolatorType::Pointer |
Definition at line 131 of file itkCentralDifferenceImageFunction.h.
using itk::CentralDifferenceImageFunction< TInputImage, TCoordRep, TOutputType >::InterpolatorType = InterpolateImageFunction<TInputImage, TCoordRep> |
Interpolator type alias support
Definition at line 130 of file itkCentralDifferenceImageFunction.h.
using itk::CentralDifferenceImageFunction< TInputImage, TCoordRep, TOutputType >::OutputConvertType = DefaultConvertPixelTraits<OutputType> |
Output convert type alias support
Definition at line 109 of file itkCentralDifferenceImageFunction.h.
using itk::CentralDifferenceImageFunction< TInputImage, TCoordRep, TOutputType >::OutputType = typename Superclass::OutputType |
OutputType typdef support.
Definition at line 106 of file itkCentralDifferenceImageFunction.h.
using itk::CentralDifferenceImageFunction< TInputImage, TCoordRep, TOutputType >::OutputValueType = typename OutputConvertType::ComponentType |
Output value type alias support
Definition at line 112 of file itkCentralDifferenceImageFunction.h.
using itk::CentralDifferenceImageFunction< TInputImage, TCoordRep, TOutputType >::Pointer = SmartPointer<Self> |
Definition at line 87 of file itkCentralDifferenceImageFunction.h.
using itk::CentralDifferenceImageFunction< TInputImage, TCoordRep, TOutputType >::PointType = typename Superclass::PointType |
Point type alias support
Definition at line 124 of file itkCentralDifferenceImageFunction.h.
using itk::CentralDifferenceImageFunction< TInputImage, TCoordRep, TOutputType >::ScalarDerivativeType = CovariantVector<OutputValueType, Self::ImageDimension> |
Scalar derivative type alias support
Definition at line 115 of file itkCentralDifferenceImageFunction.h.
using itk::CentralDifferenceImageFunction< TInputImage, TCoordRep, TOutputType >::Self = CentralDifferenceImageFunction |
Standard class type aliases.
Definition at line 85 of file itkCentralDifferenceImageFunction.h.
using itk::CentralDifferenceImageFunction< TInputImage, TCoordRep, TOutputType >::SpacingType = typename TInputImage::SpacingType |
Spacing type alias support
Definition at line 127 of file itkCentralDifferenceImageFunction.h.
using itk::CentralDifferenceImageFunction< TInputImage, TCoordRep, TOutputType >::Superclass = ImageFunction<TInputImage, TOutputType, TCoordRep> |
Definition at line 86 of file itkCentralDifferenceImageFunction.h.
|
protected |
The UseImageDirection flag determines whether image derivatives are computed with respect to the image grid or with respect to the physical space. When this flag is ON the derivatives are computed with respect to the coordinate system of physical space. The difference is whether we take into account the image Direction or not. For EvaluateAtIndex
and EvaluateAtContinuousIndex
, the flag ON will take into account the image direction and will result in an extra matrix multiplication compared to the amount of computation performed when the flag is OFF. For Evaluate
, the opposite is true: the flag OFF will ignore the image direction and will result in an extra matrix multiplication compared to the amount of computation performed when the flag is ON. The default value of this flag is On.
|
overrideprotecteddefault |
The UseImageDirection flag determines whether image derivatives are computed with respect to the image grid or with respect to the physical space. When this flag is ON the derivatives are computed with respect to the coordinate system of physical space. The difference is whether we take into account the image Direction or not. For EvaluateAtIndex
and EvaluateAtContinuousIndex
, the flag ON will take into account the image direction and will result in an extra matrix multiplication compared to the amount of computation performed when the flag is OFF. For Evaluate
, the opposite is true: the flag OFF will ignore the image direction and will result in an extra matrix multiplication compared to the amount of computation performed when the flag is ON. The default value of this flag is On.
|
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.
|
override |
Evalulate the image derivative by central differencing at non-integer point.
No bounds checking is done. The point is assumed to lie within the image buffer. If not, 0 is returned for the derivative without any error return, because of bounds-checking performed on the neighboring points.
If point
lies on a boundary in a given dimension, 0 is returned for that dimension. Note that points are centered on the voxel.
ImageFunction::IsInsideBuffer() can be used to check bounds before calling the method.
|
override |
Evalulate the image derivative by central differencing at non-integer index.
No bounds checking is done. The point is assumed to lie within the image buffer.
If cindex
lies on a boundary in a given dimension, 0 is returned for that dimension.
ImageFunction::IsInsideBuffer() can be used to check bounds before calling the method.
|
inlineprivate |
The UseImageDirection flag determines whether image derivatives are computed with respect to the image grid or with respect to the physical space. When this flag is ON the derivatives are computed with respect to the coordinate system of physical space. The difference is whether we take into account the image Direction or not. For EvaluateAtIndex
and EvaluateAtContinuousIndex
, the flag ON will take into account the image direction and will result in an extra matrix multiplication compared to the amount of computation performed when the flag is OFF. For Evaluate
, the opposite is true: the flag OFF will ignore the image direction and will result in an extra matrix multiplication compared to the amount of computation performed when the flag is ON. The default value of this flag is On.
|
inlineprivate |
Specialized versions of EvaluteAtContinuousIndex() method to handle scalar or vector pixel types.
|
override |
Evalulate the image derivative by central differencing at specified index.
No bounds checking is done. The point is assumed to lie within the image buffer.
If index
lies on a boundary in a given dimension, 0 is returned for that dimension.
ImageFunction::IsInsideBuffer() can be used to check bounds before calling the method.
|
inlineprivate |
The UseImageDirection flag determines whether image derivatives are computed with respect to the image grid or with respect to the physical space. When this flag is ON the derivatives are computed with respect to the coordinate system of physical space. The difference is whether we take into account the image Direction or not. For EvaluateAtIndex
and EvaluateAtContinuousIndex
, the flag ON will take into account the image direction and will result in an extra matrix multiplication compared to the amount of computation performed when the flag is OFF. For Evaluate
, the opposite is true: the flag OFF will ignore the image direction and will result in an extra matrix multiplication compared to the amount of computation performed when the flag is ON. The default value of this flag is On.
|
inlineprivate |
Specialized versions of EvaluteAtIndex() method to handle scalar or vector pixel types.
|
private |
The UseImageDirection flag determines whether image derivatives are computed with respect to the image grid or with respect to the physical space. When this flag is ON the derivatives are computed with respect to the coordinate system of physical space. The difference is whether we take into account the image Direction or not. For EvaluateAtIndex
and EvaluateAtContinuousIndex
, the flag ON will take into account the image direction and will result in an extra matrix multiplication compared to the amount of computation performed when the flag is OFF. For Evaluate
, the opposite is true: the flag OFF will ignore the image direction and will result in an extra matrix multiplication compared to the amount of computation performed when the flag is ON. The default value of this flag is On.
|
private |
Specialized versions of Evalute() method to handle scalar or vector pixel types.
|
virtual |
|
virtual |
Get the interpolator.
|
virtual |
Run-time type information (and related methods).
Reimplemented from itk::ImageFunction< TInputImage, TOutputType, TCoordRep >.
|
virtual |
The UseImageDirection flag determines whether image derivatives are computed with respect to the image grid or with respect to the physical space. When this flag is ON the derivatives are computed with respect to the coordinate system of physical space. The difference is whether we take into account the image Direction or not. For EvaluateAtIndex
and EvaluateAtContinuousIndex
, the flag ON will take into account the image direction and will result in an extra matrix multiplication compared to the amount of computation performed when the flag is OFF. For Evaluate
, the opposite is true: the flag OFF will ignore the image direction and will result in an extra matrix multiplication compared to the amount of computation performed when the flag is ON. The default value of this flag is On.
|
static |
Method for creation through the object factory.
|
overrideprotectedvirtual |
The UseImageDirection flag determines whether image derivatives are computed with respect to the image grid or with respect to the physical space. When this flag is ON the derivatives are computed with respect to the coordinate system of physical space. The difference is whether we take into account the image Direction or not. For EvaluateAtIndex
and EvaluateAtContinuousIndex
, the flag ON will take into account the image direction and will result in an extra matrix multiplication compared to the amount of computation performed when the flag is OFF. For Evaluate
, the opposite is true: the flag OFF will ignore the image direction and will result in an extra matrix multiplication compared to the amount of computation performed when the flag is ON. The default value of this flag is On.
Reimplemented from itk::Object.
|
overridevirtual |
Set the input image. This must be set by the user.
Reimplemented from itk::ImageFunction< TInputImage, TOutputType, TCoordRep >.
|
virtual |
Set interpolator. The interpolator is used in the methods Evaluate
and EvaluateAtContinuousIndex
.
|
virtual |
The UseImageDirection flag determines whether image derivatives are computed with respect to the image grid or with respect to the physical space. When this flag is ON the derivatives are computed with respect to the coordinate system of physical space. The difference is whether we take into account the image Direction or not. For EvaluateAtIndex
and EvaluateAtContinuousIndex
, the flag ON will take into account the image direction and will result in an extra matrix multiplication compared to the amount of computation performed when the flag is OFF. For Evaluate
, the opposite is true: the flag OFF will ignore the image direction and will result in an extra matrix multiplication compared to the amount of computation performed when the flag is ON. The default value of this flag is On.
|
virtual |
The UseImageDirection flag determines whether image derivatives are computed with respect to the image grid or with respect to the physical space. When this flag is ON the derivatives are computed with respect to the coordinate system of physical space. The difference is whether we take into account the image Direction or not. For EvaluateAtIndex
and EvaluateAtContinuousIndex
, the flag ON will take into account the image direction and will result in an extra matrix multiplication compared to the amount of computation performed when the flag is OFF. For Evaluate
, the opposite is true: the flag OFF will ignore the image direction and will result in an extra matrix multiplication compared to the amount of computation performed when the flag is ON. The default value of this flag is On.
|
virtual |
The UseImageDirection flag determines whether image derivatives are computed with respect to the image grid or with respect to the physical space. When this flag is ON the derivatives are computed with respect to the coordinate system of physical space. The difference is whether we take into account the image Direction or not. For EvaluateAtIndex
and EvaluateAtContinuousIndex
, the flag ON will take into account the image direction and will result in an extra matrix multiplication compared to the amount of computation performed when the flag is OFF. For Evaluate
, the opposite is true: the flag OFF will ignore the image direction and will result in an extra matrix multiplication compared to the amount of computation performed when the flag is ON. The default value of this flag is On.
|
staticconstexpr |
Dimension underlying input image.
Definition at line 82 of file itkCentralDifferenceImageFunction.h.
|
private |
The UseImageDirection flag determines whether image derivatives are computed with respect to the image grid or with respect to the physical space. When this flag is ON the derivatives are computed with respect to the coordinate system of physical space. The difference is whether we take into account the image Direction or not. For EvaluateAtIndex
and EvaluateAtContinuousIndex
, the flag ON will take into account the image direction and will result in an extra matrix multiplication compared to the amount of computation performed when the flag is OFF. For Evaluate
, the opposite is true: the flag OFF will ignore the image direction and will result in an extra matrix multiplication compared to the amount of computation performed when the flag is ON. The default value of this flag is On.
Definition at line 264 of file itkCentralDifferenceImageFunction.h.
|
private |
The UseImageDirection flag determines whether image derivatives are computed with respect to the image grid or with respect to the physical space. When this flag is ON the derivatives are computed with respect to the coordinate system of physical space. The difference is whether we take into account the image Direction or not. For EvaluateAtIndex
and EvaluateAtContinuousIndex
, the flag ON will take into account the image direction and will result in an extra matrix multiplication compared to the amount of computation performed when the flag is OFF. For Evaluate
, the opposite is true: the flag OFF will ignore the image direction and will result in an extra matrix multiplication compared to the amount of computation performed when the flag is ON. The default value of this flag is On.
Definition at line 261 of file itkCentralDifferenceImageFunction.h.