Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkPyramidalRegistrationMethod.h
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef MITKPYRAMIDALREGISTRATIONMETHOD_H
18 #define MITKPYRAMIDALREGISTRATIONMETHOD_H
19 
21 #include "itkImageRegistrationMethod.h"
22 #include "itkSingleValuedNonLinearOptimizer.h"
23 
24 #include "mitkCommon.h"
25 #include "mitkImageAccessByItk.h"
26 #include "mitkImageToImageFilter.h"
27 #include "mitkMetricParameters.h"
31 
32 #include "itkImageMaskSpatialObject.h"
34 
35 namespace mitk
36 {
47  {
48  public:
49  typedef itk::SingleValuedNonLinearOptimizer OptimizerType;
50  typedef itk::ImageMaskSpatialObject<3> MaskType;
51 
53 
54  itkFactorylessNewMacro(Self) itkCloneMacro(Self)
55 
56  static const int LINEARINTERPOLATOR = 0;
57  static const int NEARESTNEIGHBORINTERPOLATOR = 1;
58 
59  void SetObserver(RigidRegistrationObserver::Pointer observer);
60 
61  void SetInterpolator(int interpolator);
62 
63  virtual void GenerateData() override;
64 
65  virtual void SetReferenceImage(Image::Pointer fixedImage);
66 
67  virtual void SetFixedMask(Image::Pointer fixedMask);
68 
69  virtual void SetMovingMask(Image::Pointer movingMask);
70 
71  void SetOptimizerParameters(OptimizerParameters::Pointer optimizerParameters)
72  {
73  m_OptimizerParameters = optimizerParameters;
74  }
75 
76  OptimizerParameters::Pointer GetOptimizerParameters() { return m_OptimizerParameters; }
78  {
79  m_TransformParameters = transformParameters;
80  }
81 
82  TransformParameters::Pointer GetTransformParameters() { return m_TransformParameters; }
83  void SetMetricParameters(MetricParameters::Pointer metricParameters) { m_MetricParameters = metricParameters; }
84  MetricParameters::Pointer GetMetricParameters() { return m_MetricParameters; }
85  void SetPresets(std::vector<std::string> presets) { m_Presets = presets; }
86  itkSetMacro(FixedSchedule, itk::Array2D<unsigned int>);
87  itkSetMacro(MovingSchedule, itk::Array2D<unsigned int>);
88  itkSetMacro(MatchHistograms, bool);
89  itkGetMacro(Preset, mitk::RigidRegistrationPreset *);
90  itkSetMacro(BlurFixedImage, bool);
91  itkSetMacro(BlurMovingImage, bool);
92 
93  protected:
95  virtual ~PyramidalRegistrationMethod();
96 
98 
104 
105  void GenerateOutputInformation() override{};
106 
107  private:
108  OptimizerParameters::Pointer m_OptimizerParameters;
109  TransformParameters::Pointer m_TransformParameters;
110  MetricParameters::Pointer m_MetricParameters;
111 
112  std::vector<std::string> m_Presets;
114 
115  // Schedules
116  itk::Array2D<unsigned int> m_FixedSchedule;
117  itk::Array2D<unsigned int> m_MovingSchedule;
118 
119  bool m_UseMask;
120  bool m_MatchHistograms;
121  bool m_BlurFixedImage;
122  bool m_BlurMovingImage;
123  MaskType::Pointer m_BrainMask;
124 
125  mitk::TransformParameters::Pointer ParseTransformParameters(itk::Array<double> transformValues);
126  mitk::MetricParameters::Pointer ParseMetricParameters(itk::Array<double> metricValues);
127  mitk::OptimizerParameters::Pointer ParseOptimizerParameters(itk::Array<double> optimizerValues);
128  };
129 }
130 
131 #endif // MITKIMAGEREGISTRATIONMETHOD_H
Class to load and save parameter presets for rigid registration.
void SetMetricParameters(MetricParameters::Pointer metricParameters)
itk::SmartPointer< Self > Pointer
Observer to react on rigid registration optimizer events.
OptimizerParameters::Pointer GetOptimizerParameters()
Main class for the rigid registration pipeline.
RigidRegistrationObserver::Pointer m_Observer
#define MITKRIGIDREGISTRATION_EXPORT
Superclass of all classes generating some kind of mitk::BaseData.
DataCollection - Class to facilitate loading/accessing structured data.
itk::ImageMaskSpatialObject< 3 > MaskType
This class is used to hold all optimizer parameters needed for a rigid registration process...
itk::SingleValuedNonLinearOptimizer OptimizerType
void SetPresets(std::vector< std::string > presets)
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:44
Image class for storing images.
Definition: mitkImage.h:76
Superclass of all classes having one or more Images as input and generating Images as output...
TransformParameters::Pointer GetTransformParameters()
void SetTransformParameters(TransformParameters::Pointer transformParameters)