MISA++ Imaging  1.0.0
Adds support for OpenCV
misaxx::imaging::utils Namespace Reference

Enumerations

enum  tiff_compression : unsigned short { tiff_compression::none = 1, tiff_compression::lzw = 5 }
 

Functions

template<class T >
cantor_pairing (T x, T y)
 
template<typename T , typename U >
void find_percentiles (std::vector< U > &t_result, std::vector< T > &t_pixels, const std::vector< double > &t_percentiles, bool t_multi_use_nth_element=true)
 
template<typename T >
find_percentile (std::vector< T > &t_pixels, const double t_percentile)
 
template<typename T >
find_percentile (const std::vector< T > &t_pixels, const double t_percentile)
 
size_t otsu (const std::vector< int > &t_histogram)
 
template<class T >
size_t huang_shannon2 (const std::vector< T > &data)
 
cv::Mat tiffread (const boost::filesystem::path &t_path)
 
void tiffwrite (const cv::Mat &t_img, const boost::filesystem::path &t_path, tiff_compression t_compression=tiff_compression::none)
 

Enumeration Type Documentation

◆ tiff_compression

enum misaxx::imaging::utils::tiff_compression : unsigned short
strong
Enumerator
none 
lzw 

Function Documentation

◆ cantor_pairing()

template<class T >
T misaxx::imaging::utils::cantor_pairing ( x,
y 
)

Cantor pairing function that transforms two natural numbers into a unique numerical representation of those numbers.

Template Parameters
T
Parameters
x
y
Returns

◆ find_percentile() [1/2]

template<typename T >
T misaxx::imaging::utils::find_percentile ( std::vector< T > &  t_pixels,
const double  t_percentile 
)
inline

◆ find_percentile() [2/2]

template<typename T >
T misaxx::imaging::utils::find_percentile ( const std::vector< T > &  t_pixels,
const double  t_percentile 
)
inline

◆ find_percentiles()

template<typename T , typename U >
void misaxx::imaging::utils::find_percentiles ( std::vector< U > &  t_result,
std::vector< T > &  t_pixels,
const std::vector< double > &  t_percentiles,
bool  t_multi_use_nth_element = true 
)
inline

Finds percentiles of a vector. NOTE: This function WILL partially sort the vector!

Parameters
t_pixels
t_percentilesVector of percentiles to fetch
Returns
List of percentile values with the same order as t_percentiles

◆ huang_shannon2()

template<class T >
size_t misaxx::imaging::utils::huang_shannon2 ( const std::vector< T > &  data)
inline

◆ otsu()

size_t misaxx::imaging::utils::otsu ( const std::vector< int > &  t_histogram)
inline

Calculates Otsu threshold from a histogram. Legacy function until cxxh::math::histogram will take over

Template Parameters
T
Parameters
t_histogram
Returns

◆ tiffread()

cv::Mat misaxx::imaging::utils::tiffread ( const boost::filesystem::path &  t_path)

Reads a cv::Mat from TIFF. Supports all types supported by OpenCV

Parameters
t_path
Returns

◆ tiffwrite()

void misaxx::imaging::utils::tiffwrite ( const cv::Mat &  t_img,
const boost::filesystem::path &  t_path,
tiff_compression  t_compression = tiff_compression::none 
)

Writes a cv::Mat to TIFF. Supports all types supported by OpenCV

Parameters
t_img
t_path