MeVisLab Toolbox Reference
mlReleaseToolsMisc.h File Reference

A collection of some general tool functions. More...

Go to the source code of this file.

Namespaces

 ml
 Main documentation file for ML users and developers.
 
 ml::ReleaseToolsMisc
 A collection of miscellaneous tool functions.
 

Enumerations

enum  ml::ReleaseToolsMisc::MonotonicTypes {
  ml::ReleaseToolsMisc::Empty = 1 , ml::ReleaseToolsMisc::Singular = 2 , ml::ReleaseToolsMisc::Irregular = 4 , ml::ReleaseToolsMisc::Uniform = 8 ,
  ml::ReleaseToolsMisc::StrictlyMonotonicDecreasing = 16 , ml::ReleaseToolsMisc::MonotonicDecreasing = 32 , ml::ReleaseToolsMisc::MonotonicIncreasing = 64 , ml::ReleaseToolsMisc::StrictlyMonotonicIncreasing = 128
}
 An enumerator describing whether elements of a vector have a monotonic order. More...
 

Functions

MLRELEASE_TOOLS_EXPORT ReleaseToolsIO::StringVector ml::ReleaseToolsMisc::split (const std::string &value, const std::string &sep=LineSeparator)
 Subdivides value at all positions of sep and returns all values in the vector. More...
 
MLRELEASE_TOOLS_EXPORT ReleaseToolsIO::StringVector ml::ReleaseToolsMisc::filterWithRegExVector (const ReleaseToolsIO::StringVector &strVec, const ReleaseToolsIO::StringVector &regExpressionsVec, std::vector< size_t > *matchedRegExIdxVec=nullptr)
 Filter list of strings in strVec by regular expressions in regExpressionsVec and return list of matching strings. More...
 
MLRELEASE_TOOLS_EXPORT ReleaseToolsIO::StringVector ml::ReleaseToolsMisc::filterWithRegExVector (const ReleaseToolsIO::StringVector &strVec, const std::string &regEx)
 Convenience version of filterWithRegExVector(strVec, regExpressionsVec, matchedRegExIdxVec) where regExpressionsVec is constructed with one entry built from regEx. More...
 
MLRELEASE_TOOLS_EXPORT std::string ml::ReleaseToolsMisc::filterLinesWithRegEx (const std::string &str, const std::string &regEx, const std::string &sep=LineSeparator)
 Decompose str into lines with split(str, sep), filter them with filterWithRegExVector(strLines, regEx) and return a string composed of all matching lines. More...
 
MLRELEASE_TOOLS_EXPORT ReleaseToolsIO::StringVector ml::ReleaseToolsMisc::filterLines (const ReleaseToolsIO::StringVector &inLines, const bool useRegularExpression, const std::string &firstExpression, const std::string &lineEnd, const MLint index, std::string *errorInfos=nullptr)
 Searches lines in inLines which match given strings/expression to extract string value(s). More...
 
MLRELEASE_TOOLS_EXPORT MLErrorCode ml::ReleaseToolsMisc::copyBitSubImagesToUInt8SubImage (SubImage &outSubImage, const std::vector< SubImage > &frameSubImgs, MLint zTranslate=0, MLuint8 value=1, bool orValue=false)
 Decompose packed bit data from packed single pixel data in frameSubImgs to a normal MLuint8Type'd subimage. More...
 
MLRELEASE_TOOLS_EXPORT bool ml::ReleaseToolsMisc::isEquidistant (const std::vector< double > &dblVec, double eps=10e-5)
 Returns true if the number of elements in dblVec is <= 1 or if each dblVec[i]-dblVec[i-1] equals dblVec[1]-dblVec[0] (comparisons are made with the given eps). More...
 
MLRELEASE_TOOLS_EXPORT int ml::ReleaseToolsMisc::getMonotonicProperties (const std::vector< double > &dblVec, double eps=10e-5)
 Returns a bit mask contains bits defined in MonotonicTypes which describe properties of the elements in dblVec; comparisons are performed with the precision given by eps. More...
 
MLRELEASE_TOOLS_EXPORT MLErrorCode ml::ReleaseToolsMisc::calculateAverageOfSumOfSquaredDifferences (const SubImage &subImg1, const SubImage &subImg2, double &avrOfSumOfSquaredDiffs)
 Determines the average of pixel-wise sum of squared differences between the overlapping regions of subImage1 and subImage2. More...
 
template<typename DT1 , typename DT2 >
double ml::ReleaseToolsMisc::calculateAverageOfSumOfSquaredDifferences (TSubImage< DT1 > &img1, TSubImage< DT2 > &img2, SubImageBox box)
 Compares the average of the sum of squared differences over all voxels in the given box in corresponding and overlapping regions in subimg1 and subimg2. More...
 
MLRELEASE_TOOLS_EXPORT std::string ml::ReleaseToolsMisc::toBase64 (const std::string &inString)
 Converts inString including the terminating null character to a Base64 coded string, thus even an empty string always results to a non-empty coded and returned string. More...
 
MLRELEASE_TOOLS_EXPORT std::string ml::ReleaseToolsMisc::fromBase64 (const std::string &inString)
 Converts inString from a Base64 coded string to a decoded original string, assuming that the string has been encoded with toBase64. More...
 
MLRELEASE_TOOLS_EXPORT std::string ml::ReleaseToolsMisc::createHashFromBytes (const unsigned char *data, size_t numBytes, const std::string &hashAlgorithm="SHA1")
 Creates a hash string for the numBytes bytes data pointed to by data; nullptr data and numBytes == 0 are also allowed as arguments; 0-chars in data are also included in hash calculation and are not regarded as terminators. More...
 

Variables

MLRELEASE_TOOLS_EXPORT const std::string ml::ReleaseToolsMisc::LineSeparator
 The default line separator used for line endings. More...
 

Detailed Description

A collection of some general tool functions.

Author
Wolf Spindler
Date
10/2012

Definition in file mlReleaseToolsMisc.h.