Structural deformable models
|
#include <Data.h>
Public Member Functions | |
Dataset () | |
Dataset (const char *filename) | |
~Dataset () | |
bool | load (const char *filename, dword ppmm=0) |
Dataset & | copyData (const Dataset &rhs) |
void | draw (float x=0, float y=0, float sx=1.0f, float sy=1.0f) const |
int | getDim1Size () const |
int | getDim2Size () const |
int | getDim3Size () const |
int | getNChannels () const |
std::ostream & | print (std::ostream &os) const |
void | clear () |
bool | initialized () const |
operator bool () const | |
const ByteImage & | getImage () const |
ByteImage & | getImage () |
const ByteImage & | getImage (int index) const |
ByteImage & | getImage (int index) |
dword | getPPMM () const |
void | setPPMM (dword ppmm) |
const Point2D & | getOrigin () const |
const Point2D & | getOSize () const |
const std::string & | getFilename () const |
PropVec | getPropVec () const |
PropVec | getPropVecMM () const |
void | setHalveBeyondSize (dword hbs=0xffffffff) |
dword | getHalveBeyondSize () const |
void | addNoise (float sigma) |
Public Member Functions inherited from Sensor | |
virtual | ~Sensor () |
sensor_cptr | getSource () |
virtual void | changeSource (sensor_cptr _source) |
void | replaceBy (sensor_ptr target) |
bool | assignRef (sensor_cptr rhs) |
virtual Sensor & | assign (const Sensor &rhs) |
virtual float | getValue (int x, int y) const |
get value at discrete position More... | |
float | getValue (const Point &p) const |
get value at position p using nearest neighbour interpolation More... | |
virtual std::vector< float > | getMValue (int x, int y) const |
get multi-channel value More... | |
virtual Point2D | getGradient (int x, int y) const |
get gradient at discrete position More... | |
Point2D | getGradient (const Point2D &p) const |
get gradient at position p using nearest neighbor interpolation More... | |
float | getMax () const |
float | getMin () const |
float | getMinMaxRange () const |
float | getWeightedValue (int x, int y) const |
get max normalized value at discrete position range [0,1] More... | |
Point2D | getWeightedGradient (int x, int y) const |
get range weighted gradient at discrete position More... | |
void | setCWeights (const std::vector< float > &weights) |
const std::vector< float > & | getCWeights () const |
void | setDirection (const Point &dir) |
const Point & | getDirection () const |
void | setScale (float _scale) |
float | getScale () const |
bool | isModified (dword mask=UPD_ALL) const |
void | setModified (dword mask=UPD_ALL) |
void | unsetModified (dword mask=UPD_ALL) |
bool | isUpdate (dword udMask) const |
void | enableUpdate (dword udMask) |
void | disableUpdate (dword udMask) |
virtual bool | performUpdate () |
virtual int | getSkip () const |
bool | isValid (int x, int y) const |
virtual Image< float > | createSensorImage () const |
const std::string & | getID () const |
void | setID (const std::string &id) |
virtual std::ostream & | hprint (std::ostream &os, SensorCollection *sc) const |
void | refSuperSensor (sensor_ptr super) |
void | unrefSuperSensor (sensor_ptr super) |
void | invalidateSource () |
template<typename Derived > | |
std::shared_ptr< Derived > | shared_from_base () |
Static Public Member Functions | |
static bool | loadImage (std::vector< Image< byte > > &image, const char *filename) |
static void | drawImage (const std::vector< Image< byte > > &image, float x=0, float y=0, float sx=1.0f, float sy=1.0f) |
static void | drawImage (const Image< byte > &image, float x=0, float y=0, float sx=1.0f, float sy=1.0f) |
Static Public Member Functions inherited from Sensor | |
static dword | getStringNumber (const char *sid) |
static void | getNumberString (char sid[5], dword id) |
Public Attributes | |
vuMutex | writeMutex |
Protected Member Functions | |
float | calcValue (int x, int y) const |
std::vector< float > | calcMValue (int x, int y) const |
void | calcMinMax () |
Protected Member Functions inherited from Sensor | |
Sensor (dword updateMask) | |
Sensor () | |
virtual Point | calcGradient (int x, int y) const |
Protected Attributes | |
std::vector< ByteImage > | data |
int | m_Dim1 |
int | m_Dim2 |
int | m_Dim3 |
int | m_NChannels |
int | m_CurrImage |
current image More... | |
dword | m_ppmm |
std::string | m_Filename |
Point2D | m_Origin |
Point2D | m_OSize |
GLImage | m_GLImage |
bool | m_RefreshImage |
dword | m_HalveBeyondSize |
Protected Attributes inherited from Sensor | |
sensor_cptr | source |
float | scale |
std::vector< float > | cweights |
multi-channel weights ('color') More... | |
Point | dir |
direction parameter More... | |
float | maxval |
float | minval |
overall minimum and maximum More... | |
float | mean |
float | stdev |
overall mean and stdev More... | |
dword | toupdate |
bitflag for updates More... | |
dword | updateMask |
bitflag to mask unimportant updates More... | |
std::string | m_ID |
int | m_Skip |
int | m_AddSkip |
Additional Inherited Members | |
Public Types inherited from Sensor | |
enum | UpdateParam { UPD_NOTHING =0, UPD_DATA =1, UPD_SCALE =2, UPD_CWEIGHTS =4, UPD_DIR =8, UPD_MINMAX =16, UPD_LAST =32, UPD_ALL =0xffffffff } |
Implements data management. Function for loading and querying the dataset. Also a set of data sheets is managed that contains preprocessed results for sensor evaluation.
Dataset::Dataset | ( | ) |
Dataset::Dataset | ( | const char * | filename | ) |
|
inline |
void Dataset::addNoise | ( | float | sigma | ) |
Definition at line 212 of file Data.cpp.
References data, fgauss01(), and m_RefreshImage.
Referenced by getHalveBeyondSize().
|
inlineprotectedvirtual |
Reimplemented from Sensor.
Definition at line 102 of file Data.h.
References Sensor::maxval, and Sensor::minval.
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
void Dataset::clear | ( | ) |
Definition at line 143 of file Data.cpp.
References data, DEFAULT_PPMM, m_CurrImage, m_Dim1, m_Dim2, m_Dim3, m_Filename, m_NChannels, m_Origin, m_ppmm, Sensor::performUpdate(), Sensor::setModified(), and Sensor::UPD_DATA.
Referenced by print().
Definition at line 127 of file Data.cpp.
References data, m_CurrImage, m_Dim1, m_Dim2, m_Dim3, m_Filename, m_HalveBeyondSize, m_NChannels, m_ppmm, Sensor::performUpdate(), Sensor::setModified(), and Sensor::UPD_DATA.
Referenced by ~Dataset().
void Dataset::draw | ( | float | x = 0 , |
float | y = 0 , |
||
float | sx = 1.0f , |
||
float | sy = 1.0f |
||
) | const |
Draw data set (using OpenGL)
Definition at line 113 of file Data.cpp.
References data, GLImage::draw(), m_GLImage, m_RefreshImage, GLImage::setImage(), and GLImage::unsetImage().
Referenced by ImageWindow::drawScene(), and ~Dataset().
|
static |
Draw Image using glDrawPixels()
Definition at line 263 of file Data.cpp.
References interleave().
Referenced by getImage().
|
static |
Definition at line 229 of file Data.cpp.
References Image< T >::getData(), Image< T >::getSizeX(), and Image< T >::getSizeY().
|
inlinevirtual |
the real dataset will override these
Reimplemented from Sensor.
Definition at line 44 of file Data.h.
References m_Dim1.
Referenced by ImageWindow::drawScene(), main(), ImageWindow::onKeyPress(), ImageWindow::onLeftMouseClick(), and ImageWindow::onRightMouseClick().
|
inlinevirtual |
Reimplemented from Sensor.
Definition at line 45 of file Data.h.
References m_Dim2.
Referenced by ImageWindow::drawScene(), main(), ImageWindow::onKeyPress(), ImageWindow::onLeftMouseClick(), and ImageWindow::onRightMouseClick().
|
inlinevirtual |
|
inline |
|
inline |
|
inline |
Definition at line 54 of file Data.h.
References data, and m_CurrImage.
Referenced by ImageWindow::onKeyPress().
|
inline |
|
inline |
|
inline |
|
inlinevirtual |
|
inline |
|
inline |
|
inline |
Definition at line 76 of file Data.h.
References m_Dim1, and setPropScale().
Referenced by getPropVecMM().
|
inline |
Definition at line 78 of file Data.h.
References getPropVec(), m_ppmm, and scalePropVec().
|
inline |
Definition at line 52 of file Data.h.
References m_Dim1, and m_Dim2.
Referenced by ImageWindow::drawScene(), and operator bool().
bool Dataset::load | ( | const char * | filename, |
dword | ppmm = 0 |
||
) |
Load data set from file
Definition at line 62 of file Data.cpp.
References data, Image< T >::getSizeX(), Image< T >::getSizeY(), Image< T >::insert(), loadImage(), m_CurrImage, m_Dim1, m_Dim2, m_Dim3, m_Filename, m_HalveBeyondSize, m_NChannels, m_Origin, m_OSize, m_RefreshImage, Sensor::performUpdate(), Sensor::setModified(), setPPMM(), Image< T >::sum(), Sensor::UPD_DATA, writeMutex, Point2D::x, and Point2D::y.
Referenced by ImageWindow::changeSpecies(), Dataset(), and ~Dataset().
Load an Image<byte>
Definition at line 159 of file Data.cpp.
References copyFXImage2Image(), and NULL.
Referenced by getImage(), and load().
|
inline |
|
inlinevirtual |
|
inline |
|
inline |
|
protected |
The data as one dimensional array. If more than one channel is used data will be organized as vector<ByteImage>.
Definition at line 108 of file Data.h.
Referenced by addNoise(), calcMValue(), calcValue(), clear(), copyData(), draw(), getImage(), load(), and makeNoiseImage().
|
protected |
current image
Definition at line 112 of file Data.h.
Referenced by calcValue(), clear(), copyData(), getImage(), and load().
|
protected |
Dimensions in X, Y, and Z direction + number of channels
Definition at line 111 of file Data.h.
Referenced by calcValue(), clear(), copyData(), getDim1Size(), getPropVec(), initialized(), and load().
|
protected |
Definition at line 111 of file Data.h.
Referenced by calcValue(), clear(), copyData(), getDim2Size(), initialized(), and load().
|
protected |
Definition at line 111 of file Data.h.
Referenced by clear(), copyData(), getDim3Size(), and load().
|
protected |
Definition at line 114 of file Data.h.
Referenced by clear(), copyData(), getFilename(), and load().
|
mutableprotected |
|
protected |
Definition at line 118 of file Data.h.
Referenced by copyData(), getHalveBeyondSize(), load(), and setHalveBeyondSize().
|
protected |
Definition at line 111 of file Data.h.
Referenced by calcMValue(), clear(), copyData(), getNChannels(), and load().
|
protected |
Definition at line 115 of file Data.h.
Referenced by clear(), getOrigin(), and load().
|
protected |
Definition at line 115 of file Data.h.
Referenced by getOSize(), and load().
|
protected |
Definition at line 113 of file Data.h.
Referenced by clear(), copyData(), getPPMM(), getPropVecMM(), and setPPMM().
|
mutableprotected |
Definition at line 117 of file Data.h.
Referenced by addNoise(), draw(), and load().