FAST  3.2.0
Framework for Heterogeneous Medical Image Computing and Visualization
BlockMatching.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <FAST/ProcessObject.hpp>
4 #include <deque>
5 
6 namespace fast {
7 
8 class Image;
9 
14 class FAST_EXPORT BlockMatching : public ProcessObject {
16  public:
17  enum class MatchingMetric {
18  NORMALIZED_CROSS_CORRELATION,
19  SUM_OF_SQUARED_DIFFERENCES,
20  SUM_OF_ABSOLUTE_DIFFERENCES,
21  };
22 
28  static MatchingMetric stringToMetric(std::string name) {
29  std::map<std::string, MatchingMetric> map = {
30  {"NCC", MatchingMetric::NORMALIZED_CROSS_CORRELATION},
31  {"SAD", MatchingMetric::SUM_OF_ABSOLUTE_DIFFERENCES},
32  {"SSD", MatchingMetric::SUM_OF_SQUARED_DIFFERENCES},
33  };
34  return map.at(name);
35  }
36 
41  void setMatchingMetric(MatchingMetric type);
46  void setBlockSize(int size);
51  void setSearchSize(int size);
56  void setIntensityThreshold(float value);
61  void setTimeLag(int timeLag);
66  void setForwardBackwardTracking(bool forwardBackward);
72  void setRegionOfInterest(Vector2i offset, Vector2i size);
73  void loadAttributes() override;
74  private:
75  BlockMatching();
76  void execute() override;
77 
78  MatchingMetric m_type = MatchingMetric::SUM_OF_ABSOLUTE_DIFFERENCES;
79  int m_blockSizeHalf = 5;
80  int m_searchSizeHalf = 5;
81  float m_intensityThreshold = std::numeric_limits<float>::min();
82  int m_timeLag = 1;
83  bool m_forwardBackward = false;
84  Vector2i m_offsetROI = Vector2i::Zero();
85  Vector2i m_sizeROI = Vector2i::Zero();
86  std::deque<std::shared_ptr<Image>> m_frameBuffer;
87 
88 };
89 
90 }
fast::BlockMatching
Definition: BlockMatching.hpp:14
fast
Definition: AffineTransformation.hpp:7
FAST_OBJECT
#define FAST_OBJECT(className)
Definition: Object.hpp:9
fast::min
T min(T a, T b)
Definition: Utility.hpp:41
fast::BlockMatching::MatchingMetric
MatchingMetric
Definition: BlockMatching.hpp:17
ProcessObject.hpp
fast::BlockMatching::stringToMetric
static MatchingMetric stringToMetric(std::string name)
Definition: BlockMatching.hpp:28
fast::ProcessObject
Definition: ProcessObject.hpp:22