template<typename TInputImage, typename TOutputImage = TInputImage>
class itk::InvertDisplacementFieldImageFilter< TInputImage, TOutputImage >
Iteratively estimates the inverse of a displacement field by fixed-point composition.
- Overview (implementation)
- Given a forward displacement field \( \mathbf{u}(\mathbf{x}) \) (mapping points \( \mathbf{x} \mapsto \mathbf{x} + \mathbf{u}(\mathbf{x}) \)), the inverse field \( \mathbf{v}(\mathbf{y}) \) satisfies
\[ \mathbf{x} + \mathbf{u}(\mathbf{x}) = \mathbf{y}, \quad
\mathbf{y} + \mathbf{v}(\mathbf{y}) = \mathbf{x}.
\]
Eliminating \(\mathbf{x}\) yields the fixed-point condition
\[ \mathbf{v}(\mathbf{y}) \approx -\,\mathbf{u}\!\left(\mathbf{y} + \mathbf{v}(\mathbf{y})\right).
\]
This filter solves that condition by iterative composition starting from an initial inverse estimate (optionally supplied by the user). At each iteration, the forward field is interpolated at warped locations \( \mathbf{y} + \mathbf{v}^{(k)}(\mathbf{y}) \) and the inverse is updated to reduce both the mean and max residual norms until user-specified tolerances or an iteration cap is reached. The implementation supports multithreading and vector-image interpolation; linear vector interpolation is used by default.
- Algorithmic sketch
- For output lattice point \(\mathbf{y}\):
- Initialize \(\mathbf{v}^{(0)}(\mathbf{y})\) to the provided
InverseFieldInitialEstimate
(or zero if none).
- Iterate \(k = 0,1,\dots\) up to
MaximumNumberOfIterations
(default 20):
\[ \mathbf{r}^{(k)}(\mathbf{y}) = \mathbf{u}\!\left(\mathbf{y} + \mathbf{v}^{(k)}(\mathbf{y})\right)
+ \mathbf{v}^{(k)}(\mathbf{y}),
\]
\[ \mathbf{v}^{(k+1)}(\mathbf{y}) = \mathbf{v}^{(k)}(\mathbf{y}) - \mathbf{r}^{(k)}(\mathbf{y}).
\]
- Stop when \(\max_{\mathbf{y}}\|\mathbf{r}^{(k)}(\mathbf{y})\|\) and \(\mathrm{mean}_{\mathbf{y}}\|\mathbf{r}^{(k)}(\mathbf{y})\|\) fall below
MaxErrorToleranceThreshold
and MeanErrorToleranceThreshold
.
- Designed usage and assumptions
- Best used inside iterative registration where forward updates are small and diffeomorphic at each step; supplying the previous iteration’s inverse as the initial estimate greatly accelerates convergence and improves robustness.
- Not intended to recover a full inverse from identity in one step for large deformations; prefer multi-resolution schemes, incremental composition, or scaling-and-squaring to stay within the contraction regime of the fixed-point map.
- The forward field should be (approximately) invertible in the region of interest (positive Jacobian determinant). Non-invertible folds will stall or diverge.
- Boundary handling: when
EnforceBoundaryCondition=true
(default), the inverse is clamped to zero at the image boundary to avoid extrapolation artifacts.
- Complexity and performance
- Each iteration performs one interpolation and vector update per voxel: \(O(N \times I)\) work for \(N\) voxels and \(I\) iterations. The filter parallelizes across the output region and reuses an internal composed field to minimize memory traffic.
- Relationship to Symmetric Normalization (SyN)
- This filter is a core component of the Symmetric Normalization (SyN) registration algorithm: at each iteration SyN updates forward and inverse velocity/displacement estimates symmetrically and uses this routine to maintain an explicit inverse field, preserving inverse-consistency during optimization [24].
- Author
- Nick Tustison
-
Brian Avants
- References
- Christensen, G. E., & Johnson, H. J. (2001). Consistent image registration. IEEE Transactions on Medical Imaging, 20(7), 568–582.[24]
Definition at line 105 of file itkInvertDisplacementFieldImageFilter.h.
|
void | DynamicThreadedGenerateData (const RegionType &) override |
|
void | GenerateData () override |
|
| InvertDisplacementFieldImageFilter () |
|
void | PrintSelf (std::ostream &os, Indent indent) const override |
|
| ~InvertDisplacementFieldImageFilter () override=default |
|
virtual void | CallCopyInputRegionToOutputRegion (OutputImageRegionType &destRegion, const InputImageRegionType &srcRegion) |
|
virtual void | CallCopyInputRegionToOutputRegion (OutputImageRegionType &destRegion, const InputImageRegionType &srcRegion) |
|
virtual void | CallCopyOutputRegionToInputRegion (InputImageRegionType &destRegion, const OutputImageRegionType &srcRegion) |
|
virtual void | CallCopyOutputRegionToInputRegion (InputImageRegionType &destRegion, const OutputImageRegionType &srcRegion) |
|
void | GenerateInputRequestedRegion () override |
|
void | GenerateInputRequestedRegion () override |
|
| ImageToImageFilter () |
|
| ImageToImageFilter () |
|
void | VerifyInputInformation () const override |
|
void | VerifyInputInformation () const override |
|
| ~ImageToImageFilter () override=default |
|
| ~ImageToImageFilter () override=default |
|
virtual void | AfterThreadedGenerateData () |
|
virtual void | AllocateOutputs () |
|
virtual void | BeforeThreadedGenerateData () |
|
void | ClassicMultiThread (ThreadFunctionType callbackFunction) |
|
virtual const ImageRegionSplitterBase * | GetImageRegionSplitter () const |
|
| ImageSource () |
|
virtual unsigned int | SplitRequestedRegion (unsigned int i, unsigned int pieces, OutputImageRegionType &splitRegion) |
|
| ~ImageSource () override=default |
|
virtual void | ThreadedGenerateData (const OutputImageRegionType ®ion, ThreadIdType threadId) |
|
virtual void | DynamicThreadedGenerateData (const OutputImageRegionType &outputRegionForThread) |
|
virtual bool | GetDynamicMultiThreading () const |
|
virtual void | SetDynamicMultiThreading (bool _arg) |
|
virtual void | DynamicMultiThreadingOn () |
|
virtual void | DynamicMultiThreadingOff () |
|
virtual void | AddInput (DataObject *input) |
|
void | AddOptionalInputName (const DataObjectIdentifierType &) |
|
void | AddOptionalInputName (const DataObjectIdentifierType &, DataObjectPointerArraySizeType idx) |
|
virtual void | AddOutput (DataObject *output) |
|
bool | AddRequiredInputName (const DataObjectIdentifierType &) |
|
bool | AddRequiredInputName (const DataObjectIdentifierType &, DataObjectPointerArraySizeType idx) |
|
virtual void | CacheInputReleaseDataFlags () |
|
virtual void | GenerateOutputInformation () |
|
virtual void | GenerateOutputRequestedRegion (DataObject *output) |
|
DataObject * | GetInput (const DataObjectIdentifierType &key) |
|
const DataObject * | GetInput (const DataObjectIdentifierType &key) const |
|
virtual const DataObjectPointerArraySizeType & | GetNumberOfRequiredInputs () const |
|
virtual const DataObjectPointerArraySizeType & | GetNumberOfRequiredOutputs () const |
|
bool | IsIndexedInputName (const DataObjectIdentifierType &) const |
|
bool | IsIndexedOutputName (const DataObjectIdentifierType &) const |
|
bool | IsRequiredInputName (const DataObjectIdentifierType &) const |
|
DataObjectPointerArraySizeType | MakeIndexFromInputName (const DataObjectIdentifierType &name) const |
|
DataObjectPointerArraySizeType | MakeIndexFromOutputName (const DataObjectIdentifierType &name) const |
|
DataObjectIdentifierType | MakeNameFromInputIndex (DataObjectPointerArraySizeType idx) const |
|
DataObjectIdentifierType | MakeNameFromOutputIndex (DataObjectPointerArraySizeType idx) const |
|
void | PrintSelf (std::ostream &os, Indent indent) const override |
|
| ProcessObject () |
|
virtual void | PropagateResetPipeline () |
|
virtual void | PushBackInput (const DataObject *input) |
|
virtual void | PushFrontInput (const DataObject *input) |
|
virtual void | ReleaseInputs () |
|
virtual void | RemoveInput (const DataObjectIdentifierType &key) |
|
virtual void | RemoveInput (DataObjectPointerArraySizeType) |
|
virtual void | RemoveOutput (const DataObjectIdentifierType &key) |
|
virtual void | RemoveOutput (DataObjectPointerArraySizeType idx) |
|
bool | RemoveRequiredInputName (const DataObjectIdentifierType &) |
|
virtual void | RestoreInputReleaseDataFlags () |
|
virtual void | SetInput (const DataObjectIdentifierType &key, DataObject *input) |
|
virtual void | SetNthInput (DataObjectPointerArraySizeType idx, DataObject *input) |
|
virtual void | SetNthOutput (DataObjectPointerArraySizeType idx, DataObject *output) |
|
void | SetNumberOfIndexedInputs (DataObjectPointerArraySizeType num) |
|
void | SetNumberOfIndexedOutputs (DataObjectPointerArraySizeType num) |
|
virtual void | SetNumberOfRequiredInputs (DataObjectPointerArraySizeType) |
|
virtual void | SetNumberOfRequiredOutputs (DataObjectPointerArraySizeType _arg) |
|
virtual void | SetOutput (const DataObjectIdentifierType &name, DataObject *output) |
|
virtual void | SetPrimaryInput (DataObject *object) |
|
virtual void | SetPrimaryOutput (DataObject *object) |
|
void | SetRequiredInputNames (const NameArray &) |
|
virtual void | VerifyPreconditions () const |
|
| ~ProcessObject () override |
|
DataObject * | GetInput (DataObjectPointerArraySizeType idx) |
|
const DataObject * | GetInput (DataObjectPointerArraySizeType idx) const |
|
DataObject * | GetPrimaryInput () |
|
const DataObject * | GetPrimaryInput () const |
|
virtual void | SetPrimaryInputName (const DataObjectIdentifierType &key) |
|
virtual const char * | GetPrimaryInputName () const |
|
DataObject * | GetOutput (const DataObjectIdentifierType &key) |
|
const DataObject * | GetOutput (const DataObjectIdentifierType &key) const |
|
virtual void | SetPrimaryOutputName (const DataObjectIdentifierType &key) |
|
virtual const char * | GetPrimaryOutputName () const |
|
DataObject * | GetOutput (DataObjectPointerArraySizeType i) |
|
const DataObject * | GetOutput (DataObjectPointerArraySizeType i) const |
|
DataObject * | GetPrimaryOutput () |
|
const DataObject * | GetPrimaryOutput () const |
|
virtual bool | GetThreaderUpdateProgress () const |
|
virtual void | ThreaderUpdateProgressOn () |
|
virtual void | ThreaderUpdateProgressOff () |
|
virtual void | SetThreaderUpdateProgress (bool arg) |
|
| Object () |
|
bool | PrintObservers (std::ostream &os, Indent indent) const |
|
virtual void | SetTimeStamp (const TimeStamp &timeStamp) |
|
| ~Object () override |
|
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 () |
|