Volume Cartographer 2.27.0
|
A 3rd-order tensor object. More...
#include <vc/core/math/Tensor3D.hpp>
Public Member Functions | |
template<typename DType > | |
std::ostream & | operator<< (std::ostream &s, const volcart::Tensor3D< DType > &tensor) |
Write a Tensor3D to an output stream. More... | |
Tensor3D ()=default | |
Default constructor. | |
Tensor3D (std::size_t x, std::size_t y, std::size_t z, bool zero=true) | |
Creates a Tensor3D, sets the dimensions and whether it's full of zeroes. More... | |
const DType & | operator() (std::size_t x, std::size_t y, std::size_t z) const |
Get the tensor value at x, y, z. More... | |
DType & | operator() (std::size_t x, std::size_t y, std::size_t z) |
Get the tensor value at x, y, z. More... | |
std::size_t | dx () |
Get the size of the X-axis. More... | |
std::size_t | dx () const |
Get the size of the X-axis. More... | |
std::size_t | dy () |
Get the size of the Y-axis. More... | |
std::size_t | dy () const |
Get the size of the Y-axis. More... | |
std::size_t | dz () |
Get the size of the Z-axis. More... | |
std::size_t | dz () const |
Get the size of the Z-axis. More... | |
const cv::Mat_< DType > & | xySlice (std::size_t z) const |
Get an XY cross section of the Tensor at z. More... | |
cv::Mat_< DType > & | xySlice (std::size_t z) |
Get an XY cross section of the Tensor at z. More... | |
cv::Mat_< DType > | xzSlice (std::size_t y) const |
Get an XZ cross section of the Tensor at y. More... | |
std::unique_ptr< DType[]> | buffer () const |
Get a copy of the Tensor as a raw array. More... | |
Private Attributes | |
std::vector< cv::Mat_< DType > > | tensor_ |
std::size_t | dx_ |
std::size_t | dy_ |
std::size_t | dz_ |
A 3rd-order tensor object.
Used by Volume to store gradients and structure tensors.
Definition at line 27 of file Tensor3D.hpp.
|
inline |
Creates a Tensor3D, sets the dimensions and whether it's full of zeroes.
x | The size of the X-axis |
y | The size of the Y-axis |
z | The size of the Z-axis |
zero | If true, initialize the Tensor with zeroes |
Definition at line 155 of file Tensor3D.hpp.
|
inline |
Get a copy of the Tensor as a raw array.
Definition at line 124 of file Tensor3D.hpp.
|
inline |
Get the size of the X-axis.
Definition at line 86 of file Tensor3D.hpp.
|
inline |
Get the size of the X-axis.
Definition at line 89 of file Tensor3D.hpp.
|
inline |
Get the size of the Y-axis.
Definition at line 92 of file Tensor3D.hpp.
|
inline |
Get the size of the Y-axis.
Definition at line 95 of file Tensor3D.hpp.
|
inline |
Get the size of the Z-axis.
Definition at line 98 of file Tensor3D.hpp.
|
inline |
Get the size of the Z-axis.
Definition at line 101 of file Tensor3D.hpp.
|
inline |
Get the tensor value at x, y, z.
Definition at line 75 of file Tensor3D.hpp.
|
inline |
Get the tensor value at x, y, z.
Definition at line 66 of file Tensor3D.hpp.
std::ostream & operator<< | ( | std::ostream & | s, |
const volcart::Tensor3D< DType > & | tensor | ||
) |
Write a Tensor3D to an output stream.
Definition at line 155 of file Tensor3D.hpp.
|
inline |
Get an XY cross section of the Tensor at z.
Definition at line 109 of file Tensor3D.hpp.
|
inline |
Get an XY cross section of the Tensor at z.
Definition at line 106 of file Tensor3D.hpp.
|
inline |
Get an XZ cross section of the Tensor at y.
Definition at line 112 of file Tensor3D.hpp.
|
private |
Size of the X-axis
Definition at line 142 of file Tensor3D.hpp.
|
private |
Size of the Y-axis
Definition at line 144 of file Tensor3D.hpp.
|
private |
Size of the Z-axis
Definition at line 146 of file Tensor3D.hpp.
|
private |
Tensor storage
Definition at line 140 of file Tensor3D.hpp.