Volume Cartographer 2.27.0
ComputeVolumetricMask.hpp
Go to the documentation of this file.
1#pragma once
2
5#include <cstddef>
6#include <cstdint>
7#include <limits>
8
13
15{
16
26{
27public:
30
32 void setPointSet(const PointSet& ps);
33
35 void setVolume(const Volume::Pointer& v);
36
38 void setLowThreshold(std::uint16_t t);
39
41 void setHighThreshold(std::uint16_t t);
42
44 void setEnableClosing(bool b);
45
51
57 void setMeasureVertical(bool b);
58
63 void setMaxRadius(std::size_t radius);
64
67
70
72 std::size_t progressIterations() const override;
73
74private:
80 std::uint16_t low_{14135};
82 std::uint16_t high_{65535};
84 bool enableClosing_{true};
86 int kernel_{5};
88 bool measureVertically_{false};
90 std::size_t maxRadius_{std::numeric_limits<std::size_t>::max()};
93};
94
95} // namespace volcart::segmentation
std::shared_ptr< Volume > Pointer
Definition: Volume.hpp:42
std::shared_ptr< VolumetricMask > Pointer
Compute a VolumetricMask from a PointSet.
void setPointSet(const PointSet &ps)
Set the input PointSet.
void setLowThreshold(std::uint16_t t)
Set the low threshold for the bounded flood-fill operation.
std::size_t progressIterations() const override
Returns the maximum progress value.
void setMeasureVertical(bool b)
Set the direction in which the thickness of the page will be measured. If this value is false,...
void setMaxRadius(std::size_t radius)
Set the max radius that a single point can hav when measuring the width of the page.
VolumetricMask::Pointer compute()
Computes the segmentation.
VolumetricMask::Pointer getMask() const
Return the full, 3D mask.
void setEnableClosing(bool b)
If enabled, apply a morphological closing kernel to the mask.
void setClosingKernelSize(int s)
Set the kernel size used in the closing operation. Larger kernels close bigger gaps.
void setVolume(const Volume::Pointer &v)
Set the input Volume.
void setHighThreshold(std::uint16_t t)
Set the high threshold for the bounded flood-fill operation.
Segmentation algorithms and utilities library
Mixin type for classes which report their progress.
Definition: Mixins.hpp:13