latest version v1.9 - last update 10 Apr 2010 |
This viewerFunctor has as task to prepare an image, that will be visualized in the lti::viewer. More...
#include <ltiViewerFunctor.h>
Public Types | |
typedef viewer::parameters | parameters |
Public Member Functions | |
viewerFunctor () | |
viewerFunctor (const parameters &par) | |
viewerFunctor (const viewerFunctor &other) | |
virtual | ~viewerFunctor () |
virtual const char * | getTypeName () const |
bool | apply (const matrix< ubyte > &src, image &dest, const bool doStat=true) |
bool | apply (const matrix< int > &src, image &dest, const bool doStat=true) |
bool | apply (const matrix< float > &src, image &dest, const bool doStat=true) |
bool | apply (const matrix< double > &src, image &dest, const bool doStat=true) |
bool | apply (const image &src, image &dest, const bool doStat=true) |
bool | apply (const histogram1D &src, image &dest, const bool doStat=true) |
bool | apply (const histogram2D &src, image &dest, const bool doStat=true) |
bool | apply (const dvector &src, image &dest, const bool doStat=true) |
bool | apply (const vector< float > &src, image &dest, const bool doStat=true) |
bool | apply (const vector< int > &src, image &dest, const bool doStat=true) |
bool | apply (const vector< ubyte > &src, image &dest, const bool doStat=true) |
viewerFunctor & | copy (const viewerFunctor &other) |
viewerFunctor & | operator= (const viewerFunctor &other) |
virtual functor * | clone () const |
const parameters & | getParameters () const |
parameters & | getParameters () |
void | computeContrastBrightness (const float minp, const float maxp, const float norm, float &c, float &b) const |
Protected Member Functions | |
bool | scalarToImage (const matrix< ubyte > &chnl, image &img, const bool doStat) |
bool | scalarToImage (const matrix< int > &chnl, image &img, const bool doStat) |
bool | scalarToImage (const matrix< float > &chnl, image &img, const bool doStat) |
bool | scalarToImage (const matrix< double > &chnl, image &img, const bool doStat) |
bool | scalarToImage (const dvector &vct, image &img, const bool doStat) |
bool | imageToImage (const image &chnl, image &img, const bool doStat) |
bool | labelsToImage (const matrix< ubyte > &chnl, image &img, const bool doStat) |
bool | labelsToImage (const matrix< int > &chnl, image &img, const bool doStat) |
bool | zoom (image &img) |
bool | statistics (const matrix< ubyte > &chnl, parameters &par) const |
bool | statistics (const matrix< int > &chnl, parameters &par) const |
bool | statistics (const matrix< float > &chnl, parameters &par) const |
bool | statistics (const matrix< double > &chnl, parameters &par) const |
bool | statistics (const image &img, parameters &par) const |
bool | statistics (const dvector &img, parameters &par) const |
void | computeLinearTrans (const float norm, float &m, float &b) const |
void | computeContrastExtrema (const float norm, const float c, float &minp, float &maxp) const |
Static Protected Member Functions | |
static void | computePalettes () |
Static Protected Attributes | |
static palette | grayPalette |
static palette | redPalette |
static palette | greenPalette |
static palette | bluePalette |
static palette | huePalette |
This viewerFunctor has as task to prepare an image, that will be visualized in the lti::viewer.
For this reason, it uses the same parameters as the viewer, but it ignores those ones which control widget specific stuff like window size and so on.
This way, you can also generate images that you do with your viewer but without showing them.
Due to the fact, that viewer alter the "informational" part of the parameters, this functor will also do this. This means, after calling an apply method, the parameters can contain (if specified to do so) new information in the parameters corresponding to the statistics.
the parameters for the class viewerFunctor are the same parameters of the lti::viewer
lti::viewerFunctor::viewerFunctor | ( | ) |
default constructor
lti::viewerFunctor::viewerFunctor | ( | const parameters & | par | ) |
Construct a functor using the given parameters.
lti::viewerFunctor::viewerFunctor | ( | const viewerFunctor & | other | ) |
copy constructor
other | the object to be copied |
virtual lti::viewerFunctor::~viewerFunctor | ( | ) | [virtual] |
destructor
bool lti::viewerFunctor::apply | ( | const vector< ubyte > & | src, | |
image & | dest, | |||
const bool | doStat = true | |||
) |
create a visualization image for the the input data
src | vector<float> with the source data. | |
dest | image where the result will be left. | |
doStat | if true, the statistics for the src will be computed and leaved in the informational part of the parameters object. |
bool lti::viewerFunctor::apply | ( | const vector< int > & | src, | |
image & | dest, | |||
const bool | doStat = true | |||
) |
create a visualization image for the the input data
src | vector<float> with the source data. | |
dest | image where the result will be left. | |
doStat | if true, the statistics for the src will be computed and leaved in the informational part of the parameters object. |
bool lti::viewerFunctor::apply | ( | const vector< float > & | src, | |
image & | dest, | |||
const bool | doStat = true | |||
) |
create a visualization image for the the input data
src | vector<float> with the source data. | |
dest | image where the result will be left. | |
doStat | if true, the statistics for the src will be computed and leaved in the informational part of the parameters object. |
create a visualization image for the the input data
src | vector<double> with the source data. | |
dest | image where the result will be left. | |
doStat | if true, the statistics for the src will be computed and leaved in the informational part of the parameters object. |
bool lti::viewerFunctor::apply | ( | const histogram2D & | src, | |
image & | dest, | |||
const bool | doStat = true | |||
) |
create a visualization image for the the input data
src | histogram1D with the source data. | |
dest | image where the result will be left. | |
doStat | if true, the statistics for the src will be computed and leaved in the informational part of the parameters object. |
bool lti::viewerFunctor::apply | ( | const histogram1D & | src, | |
image & | dest, | |||
const bool | doStat = true | |||
) |
create a visualization image for the the input data
src | histogram1D with the source data. | |
dest | image where the result will be left. | |
doStat | if true, the statistics for the src will be computed and leaved in the informational part of the parameters object. |
create a visualization image for the the input data
src | image with the source data. | |
dest | image where the result will be left. | |
doStat | if true, the statistics for the src will be computed and leaved in the informational part of the parameters object. |
bool lti::viewerFunctor::apply | ( | const matrix< double > & | src, | |
image & | dest, | |||
const bool | doStat = true | |||
) |
create a visualization image for the the input data
src | matrix<double> with the source data. | |
dest | matrix<double> where the result will be left. | |
doStat | if true, the statistics for the src will be computed and leaved in the informational part of the parameters object. |
bool lti::viewerFunctor::apply | ( | const matrix< float > & | src, | |
image & | dest, | |||
const bool | doStat = true | |||
) |
create a visualization image for the the input data
src | matrix<float> with the source data. | |
dest | matrix<float> where the result will be left. | |
doStat | if true, the statistics for the src will be computed and leaved in the informational part of the parameters object. |
bool lti::viewerFunctor::apply | ( | const matrix< int > & | src, | |
image & | dest, | |||
const bool | doStat = true | |||
) |
create a visualization image for the the input data
src | matrix<int> with the source data. | |
dest | matrix<int> where the result will be left. | |
doStat | if true, the statistics for the src will be computed and leaved in the informational part of the parameters object. |
bool lti::viewerFunctor::apply | ( | const matrix< ubyte > & | src, | |
image & | dest, | |||
const bool | doStat = true | |||
) |
create a visualization image for the the input data
src | matrix<ubyte> with the source data. | |
dest | matrix<ubyte> where the result will be left. | |
doStat | if true, the statistics for the src will be computed and leaved in the informational part of the parameters object. |
virtual functor* lti::viewerFunctor::clone | ( | ) | const [virtual] |
returns a pointer to a clone of this functor.
Implements lti::functor.
void lti::viewerFunctor::computeContrastBrightness | ( | const float | minp, | |
const float | maxp, | |||
const float | norm, | |||
float & | c, | |||
float & | b | |||
) | const |
compute the values for contrast and brightness necessary to map the minI and maxI attributes in the parameters to the given minp and maxp values.
Note that must be minp <= maxp.
void lti::viewerFunctor::computeContrastExtrema | ( | const float | norm, | |
const float | c, | |||
float & | minp, | |||
float & | maxp | |||
) | const [protected] |
compute, for the contrast argument c and the minI and maxI attributes in the parameters object, the values to which this two extrema are mapped, if the brightness = 0;
void lti::viewerFunctor::computeLinearTrans | ( | const float | norm, | |
float & | m, | |||
float & | b | |||
) | const [protected] |
compute, using the informational data in the parameters, the required linear transformation to change the contrast of an image intensity.
norm | the norm used for the current type (255 or 1) | |
m | slope | |
b | offset |
static void lti::viewerFunctor::computePalettes | ( | ) | [static, protected] |
compute the static color palettes used to create the images
viewerFunctor& lti::viewerFunctor::copy | ( | const viewerFunctor & | other | ) |
copy data of "other" functor.
other | the functor to be copied |
Reimplemented from lti::functor.
parameters& lti::viewerFunctor::getParameters | ( | ) |
returns a read/write-reference of the used parameters.
This is required by the viewer, in order to write in the parameters the options specified by the user in the Configuration Dialogs and to write the statistics (informational data) into the parameters object.
Reimplemented from lti::functor.
const parameters& lti::viewerFunctor::getParameters | ( | ) | const |
returns used parameters
Reimplemented from lti::transform.
virtual const char* lti::viewerFunctor::getTypeName | ( | ) | const [virtual] |
returns the name of this type ("viewerFunctor")
Reimplemented from lti::transform.
bool lti::viewerFunctor::labelsToImage | ( | const matrix< int > & | chnl, | |
image & | img, | |||
const bool | doStat | |||
) | [protected] |
The input channel is a label map.
bool lti::viewerFunctor::labelsToImage | ( | const matrix< ubyte > & | chnl, | |
image & | img, | |||
const bool | doStat | |||
) | [protected] |
The input channel is a label map.
viewerFunctor& lti::viewerFunctor::operator= | ( | const viewerFunctor & | other | ) |
bool lti::viewerFunctor::statistics | ( | const dvector & | img, | |
parameters & | par | |||
) | const [protected] |
statistics
bool lti::viewerFunctor::statistics | ( | const image & | img, | |
parameters & | par | |||
) | const [protected] |
statistics
bool lti::viewerFunctor::statistics | ( | const matrix< double > & | chnl, | |
parameters & | par | |||
) | const [protected] |
statistics
bool lti::viewerFunctor::statistics | ( | const matrix< float > & | chnl, | |
parameters & | par | |||
) | const [protected] |
statistics
bool lti::viewerFunctor::statistics | ( | const matrix< int > & | chnl, | |
parameters & | par | |||
) | const [protected] |
statistics
bool lti::viewerFunctor::statistics | ( | const matrix< ubyte > & | chnl, | |
parameters & | par | |||
) | const [protected] |
statistics
palette lti::viewerFunctor::bluePalette [static, protected] |
The gray palette.
palette lti::viewerFunctor::grayPalette [static, protected] |
the static color palettes
The gray palette
palette lti::viewerFunctor::greenPalette [static, protected] |
The gray palette.
palette lti::viewerFunctor::huePalette [static, protected] |
The gray palette.
palette lti::viewerFunctor::redPalette [static, protected] |
The gray palette.