Volume Cartographer 2.27.0
|
Miscellaneous utility functions. More...
Files | |
file | FloatComparison.hpp |
Methods for comparing floating point numbers. | |
file | Logging.hpp |
file | MemorySizeStringParser.hpp |
file | MeshMath.hpp |
Utility functions for calculations on meshes. | |
Classes | |
class | volcart::RangeIterable< T, > |
Provides an iterable range of numbers with optional step size. More... | |
class | volcart::Range2DIterable< T, > |
Provides an iterable range of 2D number pairs with optional step size. More... | |
class | volcart::EnumerateIterable< Iterable > |
class | volcart::Signal< Types > |
Basic signal class for implementing event callbacks. More... | |
Enumerations | |
enum class | volcart::ColorMap { volcart::ColorMap::Magma = 0 , volcart::ColorMap::Inferno , volcart::ColorMap::Plasma , volcart::ColorMap::Viridis , volcart::ColorMap::Phase , volcart::ColorMap::BWR } |
Built-in color maps. More... | |
Functions | |
cv::Mat | volcart::ApplyLUT (const cv::Mat &img, const cv::Mat &lut, float min, float max, bool invert=false) |
Apply a LUT to an image. More... | |
cv::Mat | volcart::ApplyLUT (const cv::Mat &img, const cv::Mat &lut, bool invert=false, const cv::Mat &mask=cv::Mat()) |
Apply a LUT to an image. More... | |
cv::Mat | volcart::GenerateLUTScaleBar (const cv::Mat &lut, bool invert=false, std::size_t height=36, std::size_t width=256) |
Generate a LUT scale bar image. More... | |
auto | volcart::Canny (cv::Mat src, const CannySettings &settings) -> cv::Mat |
Perform Canny edge segmentation on an image. | |
cv::Mat | volcart::GetColorMapLUT (ColorMap cm, std::size_t bins=256) |
Get a color map LUT for use with ApplyLUT. | |
cv::Mat | volcart::GetColorMapLUT (const std::string &name, std::size_t bins=256) |
Get a color map LUT for use with ApplyLUT. | |
std::string | volcart::FormatStrToRegexStr (const std::string &s) |
Converts a printf-style format string to a std::regex string. More... | |
auto | volcart::QuantizeImage (const cv::Mat &m, int depth=CV_16U, bool scaleMinMax=true) -> cv::Mat |
Convert image to specified depth using max scaling. More... | |
auto | volcart::ColorConvertImage (const cv::Mat &m, int channels=1) -> cv::Mat |
Convert image to specified number of channels. | |
template<typename T > | |
auto | volcart::range (T stop) |
template<typename T0 , typename T1 > | |
auto | volcart::range (T0 start, T1 stop) |
template<typename T0 , typename T1 , typename T2 > | |
auto | volcart::range (T0 start, T1 stop, T2 step) |
template<typename T0 , typename T1 > | |
auto | volcart::range2D (T0 vStop, T1 uStop) |
template<typename T0 , typename T1 , typename T2 , typename T3 > | |
auto | volcart::range2D (T0 vStart, T1 vStop, T2 uStart, T3 uStop) |
template<typename T0 , typename T1 , typename T2 , typename T3 , typename T4 > | |
auto | volcart::range2D (T0 vStart, T1 vStop, T2 uStart, T3 uStop, T4 step) |
template<class Iterable > | |
auto | volcart::enumerate (Iterable &&it) |
Wrap an Iterable into a new one whose iterators return an [index, value] pair. More... | |
template<typename... Args> | |
EnumerateIterable< std::vector< std::common_type_t< Args... > > > | volcart::enumerate (Args &&... args) |
Wrap an Iterable into a new one whose iterators return an [index, value] pair. More... | |
static std::size_t | volcart::LinearNeighborhoodSize (double radius, double interval, Direction dir) |
Return the size of a Linear Neighborhood calculated with the given parameters. More... | |
Miscellaneous utility functions.
|
strong |
Built-in color maps.
Enumerator | |
---|---|
Magma | ![]() |
Inferno | ![]() |
Plasma | ![]() |
Viridis | ![]() |
Phase | ![]() |
BWR | ![]() |
Definition at line 17 of file ColorMaps.hpp.
cv::Mat volcart::ApplyLUT | ( | const cv::Mat & | img, |
const cv::Mat & | lut, | ||
bool | invert = false , |
||
const cv::Mat & | mask = cv::Mat() |
||
) |
Apply a LUT to an image.
Maps the pixel values of an image to the range of a LUT. LUT must be a cv::Mat with shape . Input images should be
CV_8U
, CV_16U
, or CV_32F
. Inputs with more than one channel will be converted to grayscale prior to mapping. If invert is true, the bin mapping will be reversed.
This overload calculates the range of data values and maps that to the range of the LUT. A mask image may be provided to control the region used for calculating the data min/max.
cv::Mat volcart::ApplyLUT | ( | const cv::Mat & | img, |
const cv::Mat & | lut, | ||
float | min, | ||
float | max, | ||
bool | invert = false |
||
) |
Apply a LUT to an image.
Maps the pixel values of an image to the range of a LUT. LUT must be a cv::Mat with shape . Input images should be
CV_8U
, CV_16U
, or CV_32F
. Inputs with more than one channel will be converted to grayscale prior to mapping. Pixel values min will be mapped to the first bin and values
max will be mapped to the last bin. If invert is true, the bin mapping will be reversed.
|
inline |
Wrap an Iterable into a new one whose iterators return an [index, value] pair.
This is an overload for lists of arguments:
Definition at line 549 of file Iteration.hpp.
|
inline |
Wrap an Iterable into a new one whose iterators return an [index, value] pair.
This roughly approximates the functionality of Python's enumerate function.
Iterable | Iterable container class. Iterable::iterator must meet LegacyIterator requirements |
it | Object of type Iterable |
Definition at line 527 of file Iteration.hpp.
std::string volcart::FormatStrToRegexStr | ( | const std::string & | s | ) |
Converts a printf-style format string to a std::regex string.
Currently only supports decimal and width specifiers such as %d
or %04d
.
cv::Mat volcart::GenerateLUTScaleBar | ( | const cv::Mat & | lut, |
bool | invert = false , |
||
std::size_t | height = 36 , |
||
std::size_t | width = 256 |
||
) |
Generate a LUT scale bar image.
Generates an image plot of a LUT for use as a scale bar. If output image has a horizontal aspect ratio (width >= height), min to max values will be plotted left to right. If the output image has a vertical aspect ratio, then min to max values will be plotted bottom to top. If invert is true, the bin mapping will be reversed. If experiencing color banding, consider increasing the number of bins used when calling GetColorMap.
|
static |
Return the size of a Linear Neighborhood calculated with the given parameters.
Definition at line 18 of file LinearNeighborhoodSize.hpp.
auto volcart::QuantizeImage | ( | const cv::Mat & | m, |
int | depth = CV_16U , |
||
bool | scaleMinMax = true |
||
) | -> cv::Mat |
Convert image to specified depth using max scaling.
If scaleMinMax == true
, the input min and max will be calculated and scaled the full range of the output depth. Otherwise, the range of the input depth will be scaled to the range of the output depth. For floating-point images, the default input range is assumed to be [0,1].
auto volcart::range | ( | T | stop | ) |
Convenience method for constructing iterable ranges. Starting value is 0.
stop | ending value (non-inclusive) |
Definition at line 148 of file Iteration.hpp.
auto volcart::range | ( | T0 | start, |
T1 | stop | ||
) |
Convenience method for constructing iterable ranges. Step value is 1.
stop | ending value (non-inclusive) |
Definition at line 162 of file Iteration.hpp.
auto volcart::range | ( | T0 | start, |
T1 | stop, | ||
T2 | step | ||
) |
Convenience method for constructing iterable ranges.
start | starting value |
stop | ending value (non-inclusive) |
step | step size |
Definition at line 178 of file Iteration.hpp.
auto volcart::range2D | ( | T0 | vStart, |
T1 | vStop, | ||
T2 | uStart, | ||
T3 | uStop | ||
) |
Convenience method for constructing iterable 2D ranges. Step value is 1.
vStart | Starting value for outer loop index |
vStop | Upper limit for outer loop |
uStart | Starting value for inner loop index |
uStop | Upper limit for inner loop |
Definition at line 358 of file Iteration.hpp.
auto volcart::range2D | ( | T0 | vStart, |
T1 | vStop, | ||
T2 | uStart, | ||
T3 | uStop, | ||
T4 | step | ||
) |
Convenience method for constructing iterable 2D ranges.
vStart | Starting value for outer loop index |
vStop | Upper limit for outer loop |
uStart | Starting value for inner loop index |
uStop | Upper limit for inner loop |
step | Step size for both loops |
Definition at line 376 of file Iteration.hpp.
auto volcart::range2D | ( | T0 | vStop, |
T1 | uStop | ||
) |
Convenience method for constructing iterable 2D ranges. Starting value is 0.
vStop | Upper limit for outer loop |
uStop | Upper limit for inner loop |
Definition at line 341 of file Iteration.hpp.