Volume Cartographer 2.27.0
Reslice.hpp
Go to the documentation of this file.
1#pragma once
2
5#include <opencv2/core.hpp>
6
7namespace volcart
8{
9
20{
21public:
31 cv::Mat data,
32 const cv::Vec3d& origin,
33 const cv::Vec3d& xvec,
34 const cv::Vec3d& yvec)
35 : sliceData_{std::move(data)}, origin_{origin}, xvec_{xvec}, yvec_{yvec}
36 {
37 }
42 template <typename T>
43 cv::Vec3d sliceToVoxelCoord(const cv::Point_<T>& resliceCoord) const
44 {
45 return origin_ + (resliceCoord.x * xvec_ + resliceCoord.y * yvec_);
46 }
47
49 const cv::Mat& sliceData() const { return sliceData_; }
58 cv::Mat draw() const;
61private:
63 cv::Mat sliceData_;
65 cv::Vec3d origin_;
67 cv::Vec3d xvec_;
69 cv::Vec3d yvec_;
70};
71} // namespace volcart
An image generated by intersecting a plane with a Volume.
Definition: Reslice.hpp:20
cv::Mat sliceData_
Definition: Reslice.hpp:63
cv::Vec3d xvec_
Definition: Reslice.hpp:67
const cv::Mat & sliceData() const
Get the Reslice image.
Definition: Reslice.hpp:49
cv::Vec3d yvec_
Definition: Reslice.hpp:69
Reslice(cv::Mat data, const cv::Vec3d &origin, const cv::Vec3d &xvec, const cv::Vec3d &yvec)
Construct with image data and plane generation parameters.
Definition: Reslice.hpp:30
cv::Mat draw() const
Get the Reslice image with an indicator for the middle pixel.
cv::Vec3d origin_
Definition: Reslice.hpp:65
cv::Vec3d sliceToVoxelCoord(const cv::Point_< T > &resliceCoord) const
Convert a Reslice coordinate to a Volume coordinate.
Definition: Reslice.hpp:43
Volume Cartographer library