template<class TMovingImage, class TFixedImage, class TFemObjectType>
class itk::fem::FEMRegistrationFilter< TMovingImage, TFixedImage, TFemObjectType >
FEM Image registration filter. The image registration problem is modelled here with the finite element method. Image registration is, in general, an ill-posed problem. Thus, we use an optimization scheme where the optimization criterion is given by a regularized variational energy. The variational energy arises from modeling the image as a physical body on which external forces act. The body is allowed to deform so as to minimize the applied force. The resistance of the physical body to deformation, determined by the physics associated with the body, serves to regularize the solution. The forces applied to the body are, generally, highly non-linear and so the body is allowed to deform slowly and incrementally. The direction it deforms follows the gradient of the potential energy (the force) we define. The potential energies we may choose from are given by the itk image-to-image metrics. The choices and the associated direction of descent are : Mean Squares (minimize), Normalized Cross-Correlation (maximize), and Mutual Information (maximize). Note that we have to set the direction (SetDescentDirection) when we choose a metric.
The forces driving the problem may also be given by user-supplied landmarks. The corners of the image, in this example, are always pinned. This example is designed for 2D or 3D images. A rectilinear mesh is generated automatically given the correct element type (Quadrilateral or Hexahedral). Our specific Solver for this example uses trapezoidal time stepping. This is a method for solving a second-order PDE in time. The solution is penalized by the zeroth (mass matrix) and first derivatives (stiffness matrix) of the shape functions. There is an option to perform a line search on the energy after each iteration. Optimal parameter settings require experimentation. The following approach tends to work well : Choose the relative size of density to elasticity (e.g. Rho / E ~= 1.) such that the image deforms locally and slowly. This also affects the stability of the solution. Choose the time step to control the size of the deformation at each step. Choose enough iterations to allow the solution to converge (this may be automated).
To use this filter the user will at a minimum set the Fixed and Moving images. If the user does not specify a mesh using the SetInputFEMObject() then a mesh will be created automatically of the approriate type (2d=quads and 3d=hex). The user has significant control over the registration process including setting number of resolution levels, material properties, and the metric used to define correspondence between images.
- Note
- This code works for only 2 or 3 dimensions b/c we do not have > 3D elements.
-
TODO : Keep the full field around (if using re-gridding). Introduce compensation for kinematic non-linearity in time (if using Eulerian frame).
Definition at line 118 of file itkFEMRegistrationFilter.h.
|
typedef SmartPointer< const Self > | ConstPointer |
|
typedef double | CoordRepType |
|
typedef
VectorLinearInterpolateImageFunction
< FieldType, CoordRepType > | DefaultInterpolatorType |
|
typedef
itk::VectorExpandImageFilter
< FieldType, FieldType > | ExpanderType |
|
typedef
ExpanderType::ExpandFactorsType | ExpandFactorsType |
|
typedef TFemObjectType | FEMObjectType |
|
typedef
itk::ImageRegionIteratorWithIndex
< FieldType > | FieldIterator |
|
typedef FieldType::Pointer | FieldPointer |
|
typedef itk::Image< VectorType,
itkGetStaticConstMacro(ImageDimension)> | FieldType |
|
typedef TFixedImage | FixedImageType |
|
typedef double | Float |
|
typedef
itk::ImageRegionIteratorWithIndex
< FloatImageType > | FloatImageIterator |
|
typedef Image< float,
itkGetStaticConstMacro(ImageDimension)> | FloatImageType |
|
typedef
itk::ImageRegionIteratorWithIndex
< FixedImageType > | ImageIterator |
|
typedef
FiniteDifferenceFunctionLoad
< MovingImageType,
FixedImageType > | ImageMetricLoadType |
|
typedef FixedImageType::SizeType | ImageSizeType |
|
typedef
itk::fem::ImageToRectilinearFEMObjectFilter
< TMovingImage > | ImageToMeshType |
|
typedef
itk::VectorIndexSelectionCastImageFilter
< FieldType, FloatImageType > | IndexSelectCasterType |
|
typedef
InterpolationGridType::PointType | InterpolationGridPointType |
|
typedef
InterpolationGridType::SizeType | InterpolationGridSizeType |
|
typedef itk::Image
< Element::ConstPointer,
ImageDimension > | InterpolationGridType |
|
typedef InterpolatorType::Pointer | InterpolatorPointer |
|
typedef
VectorInterpolateImageFunction
< FieldType, CoordRepType > | InterpolatorType |
|
typedef std::vector< typename
LoadLandmark::Pointer > | LandmarkArrayType |
|
typedef LinearSystemWrapperItpack | LinearSystemSolverType |
|
typedef Load::ArrayType | LoadArray |
|
typedef MaterialLinearElasticity | MaterialType |
|
typedef
PDEDeformableRegistrationFunction
< FixedImageType,
MovingImageType, FieldType > | MetricBaseType |
|
typedef MetricBaseType::Pointer | MetricBaseTypePointer |
|
typedef TMovingImage | MovingImageType |
|
typedef FixedImageType::PixelType | PixelType |
|
typedef SmartPointer< Self > | Pointer |
|
typedef FixedImageType::PointType | PointType |
|
typedef FEMRegistrationFilter | Self |
|
enum | Sign {
positive = 1,
negative = -1
} |
|
typedef SolverCrankNicolson
< ImageDimension > | SolverType |
|
typedef FixedArray< double,
ImageDimension > | StandardDeviationsType |
|
typedef ImageToImageFilter
< TMovingImage, TFixedImage > | Superclass |
|
typedef itk::Vector< float,
itkGetStaticConstMacro(ImageDimension)> | VectorType |
|
typedef itk::WarpImageFilter
< MovingImageType,
FixedImageType, FieldType > | WarperType |
|
typedef SmartPointer< const Self > | ConstPointer |
|
typedef
InputImageType::ConstPointer | InputImageConstPointer |
|
typedef InputImageType::PixelType | InputImagePixelType |
|
typedef InputImageType::Pointer | InputImagePointer |
|
typedef InputImageType::RegionType | InputImageRegionType |
|
typedef TMovingImage | InputImageType |
|
typedef
Superclass::OutputImagePixelType | OutputImagePixelType |
|
typedef
Superclass::OutputImageRegionType | OutputImageRegionType |
|
typedef SmartPointer< Self > | Pointer |
|
typedef ImageToImageFilter | Self |
|
typedef ImageSource< TFixedImage > | Superclass |
|
typedef SmartPointer< const Self > | ConstPointer |
|
typedef
Superclass::DataObjectIdentifierType | DataObjectIdentifierType |
|
typedef DataObject::Pointer | DataObjectPointer |
|
typedef
Superclass::DataObjectPointerArraySizeType | DataObjectPointerArraySizeType |
|
typedef OutputImageType::PixelType | OutputImagePixelType |
|
typedef OutputImageType::Pointer | OutputImagePointer |
|
typedef OutputImageType::RegionType | OutputImageRegionType |
|
typedef TFixedImage | OutputImageType |
|
typedef SmartPointer< Self > | Pointer |
|
typedef ImageSource | Self |
|
typedef ProcessObject | Superclass |
|
typedef SmartPointer< const Self > | ConstPointer |
|
typedef
DataObject::DataObjectIdentifierType | DataObjectIdentifierType |
|
typedef DataObject::Pointer | DataObjectPointer |
|
typedef std::vector
< DataObjectPointer > | DataObjectPointerArray |
|
typedef
DataObjectPointerArray::size_type | DataObjectPointerArraySizeType |
|
typedef std::vector
< DataObjectIdentifierType > | NameArray |
|
typedef SmartPointer< Self > | Pointer |
|
typedef ProcessObject | Self |
|
typedef Object | Superclass |
|
typedef SmartPointer< const Self > | ConstPointer |
|
typedef SmartPointer< Self > | Pointer |
|
typedef Object | Self |
|
typedef LightObject | Superclass |
|
typedef SmartPointer< const Self > | ConstPointer |
|
typedef SmartPointer< Self > | Pointer |
|
typedef LightObject | Self |
|
|
void | AddLandmark (PointType source, PointType target) |
|
void | ChooseMetric (unsigned int whichmetric) |
|
void | ClearLandmarks () |
|
void | ComputeJacobian () |
|
virtual ::itk::LightObject::Pointer | CreateAnother (void) const |
|
void | DeleteLandmark (unsigned int i) |
|
void | EnforceDiffeomorphism (float thresh, SolverType *S, bool onlywriteimages) |
|
FieldType * | GetDisplacementField () |
|
Float | GetElasticity (unsigned int which=0) |
|
FixedImageType * | GetFixedImage () |
|
ImageSizeType | GetImageSize () |
|
FEMObjectType * | GetInputFEMObject (unsigned int level=0) |
|
virtual InterpolatorType * | GetInterpolator () |
|
FloatImageType * | GetJacobianImage () |
|
void | GetLandmark (unsigned int i, PointType &source, PointType &target) |
|
MetricBaseTypePointer | GetMetric () |
|
unsigned int | GetMetricType () |
|
MovingImageType * | GetMovingImage () |
|
virtual const char * | GetNameOfClass () const |
|
MovingImageType * | GetOriginalMovingImage () |
|
virtual const
StandardDeviationsType & | GetStandardDeviations () |
|
FixedImageType * | GetWarpedImage () |
|
unsigned int | GetWidthOfMetricRegion (unsigned int which=0) |
|
void | InsertLandmark (unsigned int i, PointType source, PointType target) |
|
void | IterativeSolve (SolverType *S) |
|
void | MultiResSolve () |
|
void | PrintVectorField (unsigned int modnum=1000) |
|
void | RunRegistration (void) |
|
void | SetDescentDirectionMaximize () |
|
void | SetDescentDirectionMinimize () |
|
void | SetElasticity (Float i, unsigned int which=0) |
|
void | SetElement (Element::Pointer e) |
|
void | SetFixedImage (FixedImageType *T) |
|
void | SetGamma (Float r, unsigned int which=0) |
|
void | SetInputFEMObject (FEMObjectType *F, unsigned int level=0) |
|
virtual void | SetInterpolator (InterpolatorType *_arg) |
|
void | SetMaterial (MaterialType::Pointer m) |
|
void | SetMaximumIterations (unsigned int i, unsigned int which) |
|
void | SetMetric (MetricBaseTypePointer MP) |
|
void | SetMovingImage (MovingImageType *R) |
|
void | SetNumberOfIntegrationPoints (unsigned int i, unsigned int which=0) |
|
void | SetRho (Float r, unsigned int which=0) |
|
void | SetUseLandmarksOn () |
|
void | SetUseNormalizedGradientOn () |
|
void | SetWidthOfMetricRegion (unsigned int i, unsigned int which=0) |
|
void | WarpImage (const MovingImageType *R) |
|
|
void | SetDisplacementField (FieldType *F) |
|
|
void | SetMeshPixelsPerElementAtEachResolution (unsigned int i, unsigned int which=0) |
|
|
virtual void | SetTimeStep (Float _arg) |
|
virtual Float | GetTimeStep () |
|
|
virtual void | SetAlpha (Float _arg) |
|
virtual Float | GetAlpha () |
|
|
virtual void | SetUseLandmarks (bool _arg) |
|
virtual bool | GetUseLandmarks () |
|
void | SetUseLandmarksOff () |
|
|
virtual void | SetUseMassMatrix (bool _arg) |
|
virtual bool | GetUseMassMatrix () |
|
|
virtual void | SetEnergyReductionFactor (Float _arg) |
|
virtual Float | GetEnergyReductionFactor () |
|
|
virtual void | SetDoLineSearchOnImageEnergy (unsigned int _arg) |
|
virtual unsigned int | GetDoLineSearchOnImageEnergy () |
|
|
virtual void | SetUseNormalizedGradient (bool _arg) |
|
virtual bool | GetUseNormalizedGradient () |
|
void | SetUseNormalizedGradientOff () |
|
|
virtual void | SetEmployRegridding (unsigned int _arg) |
|
virtual unsigned int | GetEmployRegridding () |
|
|
virtual void | SetLineSearchMaximumIterations (unsigned int _arg) |
|
virtual unsigned int | GetLineSearchMaximumIterations () |
|
|
void | SetMaxLevel (unsigned int level) |
|
virtual unsigned int | GetMaxLevel () |
|
|
virtual void | SetCreateMeshFromImage (bool _arg) |
|
void | SetCreateMeshFromImageOn () |
|
void | SetCreateMeshFromImageOff () |
|
virtual bool | GetCreateMeshFromImage () |
|
|
virtual void | SetStandardDeviations (StandardDeviationsType _arg) |
|
virtual void | SetStandardDeviations (double value) |
|
|
virtual void | SetMaximumKernelWidth (unsigned int _arg) |
|
virtual unsigned int | GetMaximumKernelWidth () const |
|
|
virtual void | SetMaximumError (double _arg) |
|
virtual double | GetMaximumError () const |
|
virtual double | GetCoordinateTolerance () |
|
const InputImageType * | GetInput (void) const |
|
const InputImageType * | GetInput (unsigned int idx) const |
|
virtual void | PopBackInput () |
|
virtual void | PopFrontInput () |
|
virtual void | PushBackInput (const InputImageType *image) |
|
virtual void | PushFrontInput (const InputImageType *image) |
|
virtual void | SetCoordinateTolerance (double _arg) |
|
virtual void | SetInput (const InputImageType *image) |
|
virtual void | SetInput (unsigned int, const TMovingImage *image) |
|
virtual void | SetDirectionTolerance (double _arg) |
|
virtual double | GetDirectionTolerance () |
|
OutputImageType * | GetOutput (unsigned int idx) |
|
virtual void | GraftNthOutput (unsigned int idx, DataObject *output) |
|
virtual void | GraftOutput (DataObject *output) |
|
virtual void | GraftOutput (const DataObjectIdentifierType &key, DataObject *output) |
|
OutputImageType * | GetOutput (void) |
|
const OutputImageType * | GetOutput (void) const |
|
virtual
ProcessObject::DataObjectPointer | MakeOutput (ProcessObject::DataObjectPointerArraySizeType idx) |
|
virtual void | AbortGenerateDataOff () |
|
virtual void | AbortGenerateDataOn () |
|
virtual void | EnlargeOutputRequestedRegion (DataObject *) |
|
virtual const bool & | GetAbortGenerateData () |
|
NameArray | GetInputNames () const |
|
MultiThreader * | GetMultiThreader () const |
|
DataObjectPointerArraySizeType | GetNumberOfIndexedInputs () const |
|
DataObjectPointerArraySizeType | GetNumberOfInputs () const |
|
DataObjectPointerArraySizeType | GetNumberOfOutputs () const |
|
virtual
DataObjectPointerArraySizeType | GetNumberOfValidRequiredInputs () const |
|
NameArray | GetOutputNames () const |
|
virtual const float & | GetProgress () |
|
NameArray | GetRequiredInputNames () const |
|
bool | HasInput (const DataObjectIdentifierType &key) const |
|
bool | HasOutput (const DataObjectIdentifierType &key) const |
|
virtual DataObjectPointer | MakeOutput (const DataObjectIdentifierType &) |
|
virtual void | PrepareOutputs () |
|
virtual void | PropagateRequestedRegion (DataObject *output) |
|
virtual void | ResetPipeline () |
|
virtual void | SetAbortGenerateData (bool _arg) |
|
virtual void | SetProgress (float _arg) |
|
virtual void | Update () |
|
virtual void | UpdateLargestPossibleRegion () |
|
virtual void | UpdateOutputData (DataObject *output) |
|
virtual void | UpdateOutputInformation () |
|
void | UpdateProgress (float amount) |
|
DataObjectPointerArray | GetInputs () |
|
DataObjectPointerArray | GetOutputs () |
|
DataObjectPointerArray | GetIndexedInputs () |
|
DataObjectPointerArray | GetIndexedOutputs () |
|
DataObjectPointerArraySizeType | GetNumberOfIndexedOutputs () const |
|
virtual void | SetReleaseDataFlag (bool flag) |
|
virtual bool | GetReleaseDataFlag () const |
|
void | ReleaseDataFlagOn () |
|
void | ReleaseDataFlagOff () |
|
virtual void | SetReleaseDataBeforeUpdateFlag (bool _arg) |
|
virtual const bool & | GetReleaseDataBeforeUpdateFlag () |
|
virtual void | ReleaseDataBeforeUpdateFlagOn () |
|
virtual void | ReleaseDataBeforeUpdateFlagOff () |
|
virtual void | SetNumberOfThreads (ThreadIdType _arg) |
|
virtual const ThreadIdType & | GetNumberOfThreads () |
|
unsigned long | AddObserver (const EventObject &event, Command *) |
|
unsigned long | AddObserver (const EventObject &event, Command *) const |
|
virtual void | DebugOff () const |
|
virtual void | DebugOn () const |
|
Command * | GetCommand (unsigned long tag) |
|
bool | GetDebug () const |
|
MetaDataDictionary & | GetMetaDataDictionary (void) |
|
const MetaDataDictionary & | GetMetaDataDictionary (void) 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 |
|
virtual void | Register () const |
|
void | RemoveAllObservers () |
|
void | RemoveObserver (unsigned long tag) |
|
void | SetDebug (bool debugFlag) const |
|
void | SetMetaDataDictionary (const MetaDataDictionary &rhs) |
|
virtual void | SetReferenceCount (int) |
|
virtual void | UnRegister () const |
|
virtual void | Delete () |
|
virtual int | GetReferenceCount () const |
|
| itkCloneMacro (Self) |
|
void | Print (std::ostream &os, Indent indent=0) const |
|
|
void | ApplyImageLoads (MovingImageType *i1, FixedImageType *i2) |
|
void | ApplyLoads (ImageSizeType Isz, double *spacing=NULL) |
|
void | CreateLinearSystemSolver () |
|
void | CreateMesh (unsigned int ElementsPerSide, SolverType *solver) |
|
Float | EvaluateEnergy () |
|
Float | EvaluateResidual (SolverType *mySolver, Float t) |
|
FieldPointer | ExpandVectorField (ExpandFactorsType *expandFactors, FieldType *f) |
|
| FEMRegistrationFilter () |
|
void | FindBracketingTriplet (SolverType *mySolver, Float *a, Float *b, Float *c) |
|
FloatImageType * | GetMetricImage (FieldType *F) |
|
Float | GoldenSection (SolverType *mySolver, Float tol=0.01, unsigned int MaxIters=25) |
|
void | InterpolateVectorField (SolverType *S) |
|
void | PrintSelf (std::ostream &os, Indent indent) const |
|
void | SampleVectorFieldAtNodes (SolverType *S) |
|
void | SmoothDisplacementField () |
|
| ~FEMRegistrationFilter () |
|
|
virtual const ImageMetricLoadType * | GetLoad () |
|
virtual void | SetLoad (ImageMetricLoadType *_arg) |
|
virtual void | CallCopyInputRegionToOutputRegion (OutputImageRegionType &destRegion, const InputImageRegionType &srcRegion) |
|
virtual void | CallCopyOutputRegionToInputRegion (InputImageRegionType &destRegion, const OutputImageRegionType &srcRegion) |
|
virtual void | GenerateInputRequestedRegion () |
|
virtual void | VerifyInputInformation () |
|
void | PushBackInput (const DataObject *input) |
|
void | PushFrontInput (const DataObject *input) |
|
| ImageToImageFilter () |
|
| ~ImageToImageFilter () |
|
virtual void | AfterThreadedGenerateData () |
|
virtual void | AllocateOutputs () |
|
virtual void | BeforeThreadedGenerateData () |
|
virtual void | GenerateData () |
|
| ImageSource () |
|
virtual unsigned int | SplitRequestedRegion (unsigned int i, unsigned int num, OutputImageRegionType &splitRegion) |
|
virtual void | ThreadedGenerateData (const OutputImageRegionType &outputRegionForThread, ThreadIdType threadId) |
|
virtual | ~ImageSource () |
|
virtual void | AddInput (DataObject *input) |
|
virtual void | AddOutput (DataObject *output) |
|
bool | AddRequiredInputName (const DataObjectIdentifierType &) |
|
virtual void | CacheInputReleaseDataFlags () |
|
virtual void | GenerateOutputInformation () |
|
virtual void | GenerateOutputRequestedRegion (DataObject *output) |
|
virtual const
DataObjectPointerArraySizeType & | GetNumberOfRequiredOutputs () |
|
bool | IsIndexedInputName (const DataObjectIdentifierType &) const |
|
bool | IsIndexedOutputName (const DataObjectIdentifierType &) const |
|
bool | IsRequiredInputName (const DataObjectIdentifierType &) const |
|
| itkLegacyMacro (virtual void RemoveInput(DataObject *input)) |
|
| itkLegacyMacro (virtual void RemoveOutput(DataObject *output)) |
|
| itkLegacyMacro (void SetNumberOfInputs(DataObjectPointerArraySizeType num)) |
|
| itkLegacyMacro (void SetNumberOfOutputs(DataObjectPointerArraySizeType num)) |
|
DataObjectPointerArraySizeType | MakeIndexFromInputName (const DataObjectIdentifierType &name) const |
|
DataObjectPointerArraySizeType | MakeIndexFromOutputName (const DataObjectIdentifierType &name) const |
|
DataObjectIdentifierType | MakeNameFromInputIndex (DataObjectPointerArraySizeType idx) const |
|
DataObjectIdentifierType | MakeNameFromOutputIndex (DataObjectPointerArraySizeType idx) const |
|
| ProcessObject () |
|
virtual void | PropagateResetPipeline () |
|
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 num, DataObject *input) |
|
virtual void | SetNthOutput (DataObjectPointerArraySizeType num, DataObject *output) |
|
void | SetNumberOfIndexedInputs (DataObjectPointerArraySizeType num) |
|
void | SetNumberOfIndexedOutputs (DataObjectPointerArraySizeType num) |
|
virtual void | SetNumberOfRequiredOutputs (DataObjectPointerArraySizeType _arg) |
|
virtual void | SetOutput (const DataObjectIdentifierType &key, DataObject *output) |
|
virtual void | SetPrimaryInput (DataObject *input) |
|
virtual void | SetPrimaryOutput (DataObject *output) |
|
void | SetRequiredInputNames (const NameArray &) |
|
virtual void | VerifyPreconditions () |
|
| ~ProcessObject () |
|
DataObject * | GetInput (const DataObjectIdentifierType &key) |
|
const DataObject * | GetInput (const DataObjectIdentifierType &key) const |
|
DataObject * | GetInput (DataObjectPointerArraySizeType) |
|
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 idx) |
|
const DataObject * | GetOutput (DataObjectPointerArraySizeType idx) const |
|
DataObject * | GetPrimaryOutput () |
|
const DataObject * | GetPrimaryOutput () const |
|
virtual void | SetNumberOfRequiredInputs (DataObjectPointerArraySizeType) |
|
virtual const
DataObjectPointerArraySizeType & | GetNumberOfRequiredInputs () |
|
| Object () |
|
bool | PrintObservers (std::ostream &os, Indent indent) const |
|
virtual void | SetTimeStamp (const TimeStamp &time) |
|
virtual | ~Object () |
|
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 () |
|