Volume Cartographer 2.27.0
IntensityMap.hpp
Go to the documentation of this file.
1#pragma once
2
5#include <cstdint>
6#include <deque>
7#include <iostream>
8#include <utility>
9
10#include <opencv2/core.hpp>
11
13
15{
26{
27public:
36 cv::Mat r,
37 int stepSize,
38 int peakDistanceWeight,
39 bool shouldIncludeMiddle);
45 cv::Mat draw();
46
51 std::deque<std::pair<int, double>> sortedMaxima();
52
54 void setChosenMaximaIndex(int index) { chosenMaximaIndex_ = index; }
55
57 int chosenMaximaIndex() const { return chosenMaximaIndex_; }
58
61
63 int peakRadius() const { return peakRadius_; }
64
65private:
66 friend std::ostream& operator<<(std::ostream& s, const IntensityMap& m)
67 {
68 return s << m.intensities_;
69 }
70
73
76
78 cv::Mat_<double> intensities_;
79
81 cv::Mat_<std::uint8_t> resliceData_;
82
85
88
90 cv::Mat drawTarget_;
91
94
97
100
103
105 const int peakRadius_ = 5;
106};
107} // namespace volcart::segmentation
A class representing the intensity map generated from a row of a matrix, normalized to the range [0,...
int chosenMaximaIndex() const
Return the currently selected maxima index.
std::deque< std::pair< int, double > > sortedMaxima()
Return the row's maxima, sorted by intensity and weighted by distance from the center of the row.
void setChosenMaximaIndex(int index)
Select a maxima from the map by index.
cv::Mat_< std::uint8_t > resliceData_
void incrementMaximaIndex()
Increase the maxima index by 1.
IntensityMap(cv::Mat r, int stepSize, int peakDistanceWeight, bool shouldIncludeMiddle)
cv::Mat draw()
Generate a rastered intensity map for debug.
int peakRadius() const
Return the peak radius.
Segmentation algorithms and utilities library