Medical Imaging Interaction Toolkit  2024.06.00
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 mitkTimeFramesRegistrationHelper_h
14 #define mitkTimeFramesRegistrationHelper_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 
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::TimeFramesRegistrationHelper
Definition: mitkTimeFramesRegistrationHelper.h:43
mitk::TimeFramesRegistrationHelper::IgnoreListType
std::vector< mitk::TimeStepType > IgnoreListType
Definition: mitkTimeFramesRegistrationHelper.h:55
mitkImage.h
mitk::ImageMappingHelper::RegistrationType
::map::core::RegistrationBase RegistrationType
Definition: mitkImageMappingHelper.h:43
mitkImageMappingHelper.h
mitk::Image
Image class for storing images.
Definition: mitkImage.h:69
itk::SmartPointer< Self >
mitkTimeGeometry.h
MitkMatchPointRegistrationExports.h
mitkClassMacroItkParent
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:45
mitk::mapEventMacro
mapEventMacro(FrameRegistrationEvent, ::map::events::TaskBatchEvent, MITKMATCHPOINTREGISTRATION_EXPORT)
mitk::TimeFramesRegistrationHelper::RegistrationPointer
RegistrationType::Pointer RegistrationPointer
Definition: mitkTimeFramesRegistrationHelper.h:53
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::TimeFramesRegistrationHelper::m_Algorithm
RegistrationAlgorithmPointer m_Algorithm
Definition: mitkTimeFramesRegistrationHelper.h:135
mitk::TimeFramesRegistrationHelper::RegistrationType
::map::core::RegistrationBase RegistrationType
Definition: mitkTimeFramesRegistrationHelper.h:52
mitk::TimeFramesRegistrationHelper::~TimeFramesRegistrationHelper
~TimeFramesRegistrationHelper() override
Definition: mitkTimeFramesRegistrationHelper.h:120
mitk::ImageMappingInterpolator::Type
Type
Definition: mitkImageMappingHelper.h:30
mitk::TimeFramesRegistrationHelper::RegistrationAlgorithmBaseType
::map::algorithm::RegistrationAlgorithmBase RegistrationAlgorithmBaseType
Definition: mitkTimeFramesRegistrationHelper.h:48
mitk::TimePointType
mitk::ScalarType TimePointType
Definition: mitkTimeGeometry.h:26
MITKMATCHPOINTREGISTRATION_EXPORT
#define MITKMATCHPOINTREGISTRATION_EXPORT
Definition: MitkMatchPointRegistrationExports.h:15
mitk::ImageMappingInterpolator
Definition: mitkImageMappingHelper.h:28
mitk::TimeFramesRegistrationHelper::TimeFramesRegistrationHelper
TimeFramesRegistrationHelper()
Definition: mitkTimeFramesRegistrationHelper.h:107
mitk::TimeFramesRegistrationHelper::RegistrationAlgorithmPointer
RegistrationAlgorithmBaseType::Pointer RegistrationAlgorithmPointer
Definition: mitkTimeFramesRegistrationHelper.h:51
mitk::InterpolateImageFunction::Linear
@ Linear
Definition: mitkIntensityProfile.h:40