Volume Cartographer 2.27.0
VolumeMask.hpp
Go to the documentation of this file.
1#pragma once
2
5#include <cstddef>
6#include <vector>
7
8#include <Eigen/SparseCore>
9#include <opencv2/core.hpp>
10
12
13namespace volcart
14{
15
27{
28public:
30 enum class State { Unsegmented = 0, Segmented };
31
34
36 VolumeMask(std::size_t width, std::size_t height, std::size_t numSlices);
37
39 void setVoxelState(const cv::Vec3i& xyz, State state);
40
42 State getVoxelState(const cv::Vec3i& xyz);
43
51 const cv::Vec3i& origin, const cv::Vec3i& dims, State state);
52
59 Subvolume getSubvolumeState(const cv::Vec3i& origin, const cv::Vec3i& dims);
60
61private:
68 Eigen::SparseMatrix<int, Eigen::RowMajor> states_;
69
71 std::size_t sliceWidth_;
72
74 std::size_t sliceHeight_;
75};
76
77} // namespace volcart
Dynamically-allocated N-Dimensional Array.
Definition: NDArray.hpp:29
Per-voxel Segmentation State Mask for Volumes.
Definition: VolumeMask.hpp:27
std::size_t sliceWidth_
Definition: VolumeMask.hpp:71
void setSubvolumeState(const cv::Vec3i &origin, const cv::Vec3i &dims, State state)
Set the segmentation state for every voxel in a subvolume.
Eigen::SparseMatrix< int, Eigen::RowMajor > states_
Definition: VolumeMask.hpp:68
State
Segmentation States.
Definition: VolumeMask.hpp:30
State getVoxelState(const cv::Vec3i &xyz)
Get the segmentation state for a voxel.
Subvolume getSubvolumeState(const cv::Vec3i &origin, const cv::Vec3i &dims)
Get the segmentation state for every voxel in a subvolume.
VolumeMask(std::size_t width, std::size_t height, std::size_t numSlices)
Construct from Volume dimensions.
void setVoxelState(const cv::Vec3i &xyz, State state)
Set the segmentation state for a voxel.
std::size_t sliceHeight_
Definition: VolumeMask.hpp:74
Volume Cartographer library