Medical Imaging Interaction Toolkit  2016.11.0
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,
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 __MITK_TIME_FRAMES_REGISTRATION_HELPER_H_
18 #define __MITK_TIME_FRAMES_REGISTRATION_HELPER_H_
19 
20 
21 #include <mitkImage.h>
22 #include <mitkTimeGeometry.h>
23 #include <mitkImageMappingHelper.h>
24 
25 #include <mapRegistrationAlgorithmBase.h>
26 #include <mapRegistrationBase.h>
27 #include <mapEvents.h>
28 
30 
31 namespace mitk
32 {
33 
34  mapEventMacro(FrameRegistrationEvent, ::map::events::TaskBatchEvent, MITKMATCHPOINTREGISTRATION_EXPORT);
35  mapEventMacro(FrameMappingEvent, ::map::events::TaskBatchEvent, MITKMATCHPOINTREGISTRATION_EXPORT);
36 
48  {
49  public:
51 
52  itkNewMacro(Self);
53 
54  typedef ::map::algorithm::RegistrationAlgorithmBase RegistrationAlgorithmBaseType;
56  typedef ::map::core::RegistrationBase RegistrationType;
58 
59  typedef std::vector<mitk::TimeStepType> IgnoreListType;
60 
61  itkSetConstObjectMacro(4DImage, Image);
62  itkGetConstObjectMacro(4DImage, Image);
63 
64  itkSetConstObjectMacro(TargetMask, Image);
65  itkGetConstObjectMacro(TargetMask, Image);
66 
67  itkSetObjectMacro(Algorithm, RegistrationAlgorithmBaseType);
68  itkGetObjectMacro(Algorithm, RegistrationAlgorithmBaseType);
69 
70  itkSetMacro(AllowUndefPixels, bool);
71  itkGetConstMacro(AllowUndefPixels, bool);
72 
73  itkSetMacro(PaddingValue, double);
74  itkGetConstMacro(PaddingValue, double);
75 
76  itkSetMacro(AllowUnregPixels, bool);
77  itkGetConstMacro(AllowUnregPixels, bool);
78 
79  itkSetMacro(ErrorValue, double);
80  itkGetConstMacro(ErrorValue, double);
81 
82  itkSetMacro(InterpolatorType, mitk::ImageMappingInterpolator::Type);
83  itkGetConstMacro(InterpolatorType, mitk::ImageMappingInterpolator::Type);
84 
86  void ClearIgnoreList();
87  void SetIgnoreList(const IgnoreListType& il);
88  itkGetConstMacro(IgnoreList, IgnoreListType);
89 
90  virtual double GetProgress() const;
91 
100  void Generate();
101 
108  Image::Pointer GetRegisteredImage();
109 
110  protected:
111  TimeFramesRegistrationHelper() : m_Progress(0), m_AllowUndefPixels(true), m_PaddingValue(0),
112  m_AllowUnregPixels(true), m_ErrorValue(0), m_InterpolatorType(mitk::ImageMappingInterpolator::Linear)
113  {
114  m_4DImage = NULL;
115  m_TargetMask = NULL;
116  m_Registered4DImage = NULL;
117  };
118 
120 
121  RegistrationPointer DoFrameRegistration(const mitk::Image* movingFrame,
122  const mitk::Image* targetFrame, const mitk::Image* targetMask) const;
123 
124  mitk::Image::Pointer DoFrameMapping(const mitk::Image* movingFrame, const RegistrationType* reg,
125  const mitk::Image* targetFrame) const;
126 
127  bool HasOutdatedResult() const;
130  void CheckValidInputs() const;
131 
132  mitk::Image::Pointer GetFrameImage(const mitk::Image* image, mitk::TimePointType timePoint) const;
133 
134  RegistrationAlgorithmPointer m_Algorithm;
135 
136  private:
137  Image::ConstPointer m_4DImage;
138  Image::ConstPointer m_TargetMask;
139  Image::Pointer m_Registered4DImage;
140 
141  IgnoreListType m_IgnoreList;
142 
144  bool m_AllowUndefPixels;
146  double m_PaddingValue;
148  bool m_AllowUnregPixels;
150  double m_ErrorValue;
152  mitk::ImageMappingInterpolator::Type m_InterpolatorType;
153 
154  double m_Progress;
155  };
156 
157 }
158 
159 #endif // __MITK_PARAMETER_FIT_IMAGE_GENERATOR_H_
itk::SmartPointer< Self > Pointer
DataCollection - Class to facilitate loading/accessing structured data.
mapEventMacro(FrameRegistrationEvent,::map::events::TaskBatchEvent, MITKMATCHPOINTREGISTRATION_EXPORT)
#define MITKMATCHPOINTREGISTRATION_EXPORT
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:53
Image class for storing images.
Definition: mitkImage.h:76
section MAP_FRAME_Mapper_Settings Mapper settings For the mapping of corrected you have several settings but high interpolation errors for gray value images Right choice for label images or masks li Linear
mitk::ScalarType TimePointType
RegistrationAlgorithmBaseType::Pointer RegistrationAlgorithmPointer
::map::algorithm::RegistrationAlgorithmBase RegistrationAlgorithmBaseType
std::vector< mitk::TimeStepType > IgnoreListType