Medical Imaging Interaction Toolkit  2018.4.99-3e3f1a6e
Medical Imaging Interaction Toolkit
mitkTimeFramesRegistrationHelper.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 (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef __MITK_TIME_FRAMES_REGISTRATION_HELPER_H_
14 #define __MITK_TIME_FRAMES_REGISTRATION_HELPER_H_
15 
16 
17 #include <mitkImage.h>
18 #include <mitkTimeGeometry.h>
19 #include <mitkImageMappingHelper.h>
20 
21 #include <mapRegistrationAlgorithmBase.h>
22 #include <mapRegistrationBase.h>
23 #include <mapEvents.h>
24 
26 
27 namespace mitk
28 {
29 
30  mapEventMacro(FrameRegistrationEvent, ::map::events::TaskBatchEvent, MITKMATCHPOINTREGISTRATION_EXPORT);
31  mapEventMacro(FrameMappingEvent, ::map::events::TaskBatchEvent, MITKMATCHPOINTREGISTRATION_EXPORT);
32 
44  {
45  public:
47 
48  itkNewMacro(Self);
49 
50  typedef ::map::algorithm::RegistrationAlgorithmBase RegistrationAlgorithmBaseType;
51  typedef RegistrationAlgorithmBaseType::Pointer RegistrationAlgorithmPointer;
52  typedef ::map::core::RegistrationBase RegistrationType;
53  typedef RegistrationType::Pointer RegistrationPointer;
54 
55  typedef std::vector<mitk::TimeStepType> IgnoreListType;
56 
57  itkSetConstObjectMacro(4DImage, Image);
58  itkGetConstObjectMacro(4DImage, Image);
59 
60  itkSetConstObjectMacro(TargetMask, Image);
61  itkGetConstObjectMacro(TargetMask, Image);
62 
63  itkSetObjectMacro(Algorithm, RegistrationAlgorithmBaseType);
64  itkGetObjectMacro(Algorithm, RegistrationAlgorithmBaseType);
65 
66  itkSetMacro(AllowUndefPixels, bool);
67  itkGetConstMacro(AllowUndefPixels, bool);
68 
69  itkSetMacro(PaddingValue, double);
70  itkGetConstMacro(PaddingValue, double);
71 
72  itkSetMacro(AllowUnregPixels, bool);
73  itkGetConstMacro(AllowUnregPixels, bool);
74 
75  itkSetMacro(ErrorValue, double);
76  itkGetConstMacro(ErrorValue, double);
77 
78  itkSetMacro(InterpolatorType, mitk::ImageMappingInterpolator::Type);
79  itkGetConstMacro(InterpolatorType, mitk::ImageMappingInterpolator::Type);
80 
82  void ClearIgnoreList();
83  void SetIgnoreList(const IgnoreListType& il);
84  itkGetConstMacro(IgnoreList, IgnoreListType);
85 
86  virtual double GetProgress() const;
87 
96  void Generate();
97 
104  Image::Pointer GetRegisteredImage();
105 
106  protected:
108  m_AllowUndefPixels(true),
109  m_PaddingValue(0),
110  m_AllowUnregPixels(true),
111  m_ErrorValue(0),
112  m_InterpolatorType(mitk::ImageMappingInterpolator::Linear),
113  m_Progress(0)
114  {
115  m_4DImage = nullptr;
116  m_TargetMask = nullptr;
117  m_Registered4DImage = nullptr;
118  };
119 
121 
122  RegistrationPointer DoFrameRegistration(const mitk::Image* movingFrame,
123  const mitk::Image* targetFrame, const mitk::Image* targetMask) const;
124 
125  mitk::Image::Pointer DoFrameMapping(const mitk::Image* movingFrame, const RegistrationType* reg,
126  const mitk::Image* targetFrame) const;
127 
128  bool HasOutdatedResult() const;
131  void CheckValidInputs() const;
132 
133  mitk::Image::Pointer GetFrameImage(const mitk::Image* image, mitk::TimePointType timePoint) const;
134 
135  RegistrationAlgorithmPointer m_Algorithm;
136 
137  private:
138  Image::ConstPointer m_4DImage;
139  Image::ConstPointer m_TargetMask;
140  Image::Pointer m_Registered4DImage;
141 
142  IgnoreListType m_IgnoreList;
143 
145  bool m_AllowUndefPixels;
147  double m_PaddingValue;
149  bool m_AllowUnregPixels;
151  double m_ErrorValue;
153  mitk::ImageMappingInterpolator::Type m_InterpolatorType;
154 
155  double m_Progress;
156  };
157 
158 }
159 
160 #endif // __MITK_PARAMETER_FIT_IMAGE_GENERATOR_H_
DataCollection - Class to facilitate loading/accessing structured data.
#define MITKMATCHPOINTREGISTRATION_EXPORT
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:49
Image class for storing images.
Definition: mitkImage.h:72
mitk::ScalarType TimePointType
mitk::Image::Pointer image
RegistrationAlgorithmBaseType::Pointer RegistrationAlgorithmPointer
::map::algorithm::RegistrationAlgorithmBase RegistrationAlgorithmBaseType
std::vector< mitk::TimeStepType > IgnoreListType
mapEventMacro(FrameRegistrationEvent, ::map::events::TaskBatchEvent, MITKMATCHPOINTREGISTRATION_EXPORT)