3Depict
|
Cluster analysis filter. More...
#include <clusterAnalysis.h>
Public Member Functions | |
ClusterAnalysisFilter () | |
Filter * | cloneUncached () const |
Duplicate filter contents, excluding cache. More... | |
virtual void | initFilter (const std::vector< const FilterStreamData *> &dataIn, std::vector< const FilterStreamData *> &dataOut) |
Initialise filter prior to tree propagation. More... | |
virtual size_t | numBytesForCache (size_t nObjects) const |
Returns -1, as range file cache size is dependant upon input. More... | |
unsigned int | getType () const |
Returns FILTER_TYPE_SPATIAL_ANALYSIS. More... | |
unsigned int | refresh (const std::vector< const FilterStreamData *> &dataIn, std::vector< const FilterStreamData *> &getOut, ProgressData &progress) |
Apply filter to new data, updating cache as needed. Vector of returned pointers must be deleted manually, first checking ->cached. More... | |
virtual std::string | typeString () const |
Get the type string for this filter. More... | |
std::string | getSpecificErrString (unsigned int i) const |
Get the per-filter error codes. More... | |
void | getProperties (FilterPropGroup &propertyList) const |
Get the properties of the filter, in key-value form. First std::vector is for each output. More... | |
bool | setProperty (unsigned int key, const std::string &value, bool &needUpdate) |
Set the properties for the nth filter. More... | |
bool | writeState (std::ostream &f, unsigned int format, unsigned int depth=0) const |
Dump state to output stream, using specified format. More... | |
bool | readState (xmlNodePtr &node, const std::string &packDir) |
Read the state of the filter from XML file. If this. More... | |
unsigned int | getRefreshBlockMask () const |
Get the stream types that will be dropped during ::refresh. More... | |
unsigned int | getRefreshEmitMask () const |
Get the stream types that will be generated during ::refresh. More... | |
unsigned int | getRefreshUseMask () const |
Get the stream types that will be generated during ::refresh. More... | |
void | setPropFromBinding (const SelectionBinding &b) |
Set internal property value using a selection binding (Disabled, this filter has no bindings) More... | |
![]() | |
Filter () | |
virtual | ~Filter () |
virtual void | clearCache () |
Erase cache. More... | |
virtual void | clearDevices () |
Erase any active devices. More... | |
std::string | getErrString (unsigned int code) const |
Get the human readable error string associated with a particular error code during refresh(...). Do not override this for specific filter errors. Override getSpecificErrString. More... | |
std::string | trueName () const |
Return the unique name for a given filter – DO NOT TRANSLATE. More... | |
virtual void | getStateOverrides (std::vector< std::string > &overrides) const |
Return the XML elements that refer to external entities (i.e. files) which do not move with the XML files. At this time, only files are supported. These will be looked for on the filesystem and moved as needed. More... | |
void | setCaching (bool enableCache) |
Enable/disable caching for this filter. More... | |
bool | haveCache () const |
Have cached output data? More... | |
virtual std::string | getUserString () const |
Return a user-specified string, or just the typestring if user set string not active. More... | |
virtual void | setUserString (const std::string &str) |
Set a user-specified string return value is. More... | |
virtual bool | writePackageState (std::ostream &f, unsigned int format, const std::vector< std::string > &valueOverrides, unsigned int depth=0) const |
Modified version of writeState for packaging. By default simply calls writeState. More... | |
void | getSelectionDevices (std::vector< SelectionDevice *> &devices) const |
Get the selection devices for this filter. MUST be called after refresh() More... | |
void | updateOutputInfo (const std::vector< const FilterStreamData *> &dataOut) |
Update the output statistics for this filter (num items of streams of each type output) More... | |
virtual void | setPropFromRegion (unsigned int method, unsigned int regionID, float newPos) |
Set a region update. More... | |
virtual bool | canBeHazardous () const |
Can this filter perform actions that are potentially a security concern? More... | |
unsigned int | getNumOutput (unsigned int streamType) const |
Get the number of outputs for the specified type during the filter's last refresh. More... | |
void | getConsoleStrings (std::vector< std::string > &v) const |
Get the filter messages from the console. To erase strings, either call erase, or erase cahche. More... | |
void | clearConsole () |
virtual bool | monitorNeedsRefresh () const |
virtual bool | isPureDataSource () const |
virtual bool | isUsefulAsAppend () const |
template<> | |
bool | applyPropertyNow (bool &prop, const std::string &val, bool &needUp) |
template<> | |
bool | applyPropertyNow (Point3D &prop, const std::string &val, bool &needUp) |
template<> | |
bool | applyPropertyNow (std::string &prop, const std::string &val, bool &needUp) |
Additional Inherited Members | |
![]() | |
static void | setStrongRandom (bool strongRand) |
Should filters use strong randomisation (where applicable) or not? More... | |
template<typename T > | |
static void | getStreamsOfType (const std::vector< const FilterStreamData *> &vec, std::vector< const T *> &dataOut) |
![]() | |
static ATOMIC_BOOL * | wantAbort = 0 |
![]() | |
void | convertFileStringToAbsolute (const string &basePath, std::string &s) const |
void | propagateCache (std::vector< const FilterStreamData *> &dataOut) const |
Propagate the cache into output. More... | |
template<class T > | |
bool | applyPropertyNow (T &oldProp, const std::string &newVal, bool &needUp) |
void | cacheAsNeeded (FilterStreamData *s) |
![]() | |
static unsigned int | collateIons (const std::vector< const FilterStreamData *> &dataIn, std::vector< IonHit > &outVector, ProgressData &prog, size_t totalDataSize=(size_t) -1) |
static unsigned int | collateIons (const std::vector< const FilterStreamData *> &dataIn, std::vector< Point3D > &outVector, ProgressData &prog, size_t totalDataSize=(size_t) -1) |
static void | propagateStreams (const std::vector< const FilterStreamData *> &dataIn, std::vector< const FilterStreamData *> &dataOut, size_t mask=STREAMTYPE_MASK_ALL, bool invertMask=false) |
Propagate the given input data to an output vector. More... | |
static std::string | getBaseErrString (unsigned int errCode) |
Get the generic (applies to any filter) error codes. More... | |
template<class T > | |
static unsigned int | extendDataVector (std::vector< T > &dest, const std::vector< IonHit > &vIonData, unsigned int &progress, size_t offset) |
Extend a point data vector using some ion data. More... | |
template<class T > | |
static size_t | buildSplitPoints (const vector< const FilterStreamData *> &dataIn, ProgressData &progress, size_t totalDataSize, const RangeFile *rngF, const vector< bool > &pSourceEnabled, const vector< bool > &pTargetEnabled, vector< T > &pSource, vector< T > &pTarget) |
static unsigned int | getIonstreamIonID (const IonStreamData *d, const RangeFile *r) |
static void | demuxKey (unsigned int key, unsigned int &keyType, unsigned int &ionOffset) |
Hack to merge/extract two bits of information into a single property key. More... | |
static unsigned int | muxKey (unsigned int keyType, unsigned int ionOffset) |
![]() | |
bool | cache |
bool | cacheOK |
unsigned int | numStreamsLastRefresh [NUM_STREAM_TYPES] |
Array of the number of streams propagated on last refresh. More... | |
std::vector< std::string > | consoleOutput |
Temporary console output. Should be only nonzero size if messages are present. More... | |
std::string | userString |
User settable labelling string (human readable ID, etc etc) More... | |
std::vector< FilterStreamData * > | filterOutputs |
std::vector< SelectionDevice * > | devices |
User interaction "Devices" associated with this filter. More... | |
![]() | |
static bool | strongRandom = false |
Cluster analysis filter.
ClusterAnalysisFilter::ClusterAnalysisFilter | ( | ) |
References Filter::cache, and Filter::cacheOK.
Referenced by cloneUncached(), and computeMatrixEntries().
|
virtual |
Duplicate filter contents, excluding cache.
Implements Filter.
References Filter::cache, Filter::cacheOK, ClusterAnalysisFilter(), and Filter::userString.
|
virtual |
Get the properties of the filter, in key-value form. First std::vector is for each output.
Implements Filter.
References FilterPropGroup::addProperty(), ASSERT, boolStrEnc(), choiceString(), CLUSTER_ALGORITHM_ENUM_END, CLUSTER_LINK_ERODE, FilterProperty::data, FilterProperty::helpText, FilterProperty::key, KEY_BULK_ALL, KEY_BULK_OFFSET, KEY_BULKLINK, KEY_BULKLINK_ENABLE, KEY_CLUSTERANALYSIS_ALGORITHM, KEY_CORE_OFFSET, KEY_CORECLASSIFY_ENABLE, KEY_CORECLASSIFYDIST, KEY_CORECLASSIFYKNN, KEY_CROP_NMAX, KEY_CROP_NMIN, KEY_CROP_SIZE, KEY_ERODE_ENABLE, KEY_ERODEDIST, KEY_LINKDIST, KEY_NORMALISE_COMPOSITION, KEY_WANT_CLUSTERID, KEY_WANT_CLUSTERMORPHOLOGY, KEY_WANT_CLUSTERSIZEDIST, KEY_WANT_COMPOSITIONDIST, KEY_WANT_LOGSIZEDIST, FilterProperty::name, PROPERTY_TYPE_BOOL, PROPERTY_TYPE_CHOICE, PROPERTY_TYPE_INTEGER, PROPERTY_TYPE_REAL, FilterPropGroup::setGroupTitle(), stream_cast(), TRANS, and FilterProperty::type.
Referenced by typeString().
|
virtual |
Get the stream types that will be dropped during ::refresh.
Implements Filter.
References STREAM_TYPE_IONS.
Referenced by typeString().
|
virtual |
Get the stream types that will be generated during ::refresh.
Implements Filter.
References STREAM_TYPE_DRAW, STREAM_TYPE_IONS, STREAM_TYPE_PLOT, and STREAM_TYPE_PLOT2D.
Referenced by typeString().
|
virtual |
Get the stream types that will be generated during ::refresh.
Implements Filter.
References STREAM_TYPE_IONS, and STREAM_TYPE_RANGE.
Referenced by typeString().
|
virtual |
Get the per-filter error codes.
Implements Filter.
References ASSERT, CLUSTER_ERR_ENUM_END, COMPILE_ASSERT, and THREEDEP_ARRAYSIZE.
Referenced by typeString().
|
inlinevirtual |
Returns FILTER_TYPE_SPATIAL_ANALYSIS.
Implements Filter.
References FILTER_TYPE_CLUSTER_ANALYSIS, and refresh().
|
virtual |
Initialise filter prior to tree propagation.
Reimplemented from Filter.
References RangeStreamData::enabledIons, RangeFile::getName(), RangeFile::getNumIons(), RangeFile::getNumRanges(), RangeStreamData::rangeFile, and STREAM_TYPE_RANGE.
Referenced by computeMatrixEntries().
|
virtual |
Returns -1, as range file cache size is dependant upon input.
Implements Filter.
References IONDATA_SIZE.
|
virtual |
Read the state of the filter from XML file. If this.
Implements Filter.
References ASSERT, CLUSTER_ALGORITHM_ENUM_END, CLUSTER_LINK_ERODE, Filter::userString, XMLGetAttrib(), XMLGetNextElemAttrib(), XMLHelpFwdToElem(), and XMLHelpGetProp().
Referenced by typeString().
|
virtual |
Apply filter to new data, updating cache as needed. Vector of returned pointers must be deleted manually, first checking ->cached.
Implements Filter.
References IonStreamData::a, ASSERT, IonStreamData::b, Filter::cache, Filter::cacheAsNeeded(), FilterStreamData::cached, Filter::cacheOK, CLUSTER_LINK_ERODE, Filter::consoleOutput, IonStreamData::data, Plot2DStreamData::dataLabel, DrawStreamData::drawables, Filter::filterOutputs, ProgressData::filterProgress, IonStreamData::g, PlotStreamData::index, Plot2DStreamData::index, makeCompositionTable(), makeFrequencyTable(), NOBULK_ERR, NOCORE_ERR, FilterStreamData::parent, PLOT_2D_SCATTER, Plot2DStreamData::plotStyle, Filter::propagateCache(), IonStreamData::r, RangeStreamData::rangeFile, Plot2DStreamData::scatterData, Plot2DStreamData::scatterIntensity, Plot2DStreamData::scatterIntensityLog, K3DTreeMk2::setAbortFlag(), DrawVector::setColour(), DrawVector::setDrawArrow(), DrawVector::setOrigin(), K3DTreeMk2::setProgressPtr(), DrawVector::setVector(), stream_cast(), STREAM_TYPE_IONS, STREAM_TYPE_RANGE, TRANS, WANT_COUNT_BULK_FORCROP, Filter::wantAbort, Plot2DStreamData::xLabel, and Plot2DStreamData::yLabel.
Referenced by computeMatrixEntries(), and getType().
|
virtual |
Set the properties for the nth filter.
Implements Filter.
References Filter::applyPropertyNow(), ASSERT, boolStrDec(), CHEM_DIST_DATALABEL, Filter::clearCache(), CLUSTER_ALGORITHM_ENUM_END, CLUSTER_LINK_ERODE, PlotStreamData::dataLabel, Filter::filterOutputs, KEY_BULK_ALL, KEY_BULK_OFFSET, KEY_BULKLINK, KEY_BULKLINK_ENABLE, KEY_CLUSTERANALYSIS_ALGORITHM, KEY_CORE_OFFSET, KEY_CORECLASSIFY_ENABLE, KEY_CORECLASSIFYDIST, KEY_CORECLASSIFYKNN, KEY_CROP_NMAX, KEY_CROP_NMIN, KEY_CROP_SIZE, KEY_ERODE_ENABLE, KEY_ERODEDIST, KEY_LINKDIST, KEY_NORMALISE_COMPOSITION, KEY_WANT_CLUSTERID, KEY_WANT_CLUSTERMORPHOLOGY, KEY_WANT_CLUSTERSIZEDIST, KEY_WANT_COMPOSITIONDIST, KEY_WANT_LOGSIZEDIST, PlotStreamData::logarithmic, SIZE_DIST_DATALABEL, stream_cast(), STREAM_TYPE_PLOT, stripWhite(), and TRANS.
Referenced by computeMatrixEntries(), and typeString().
|
virtual |
Set internal property value using a selection binding (Disabled, this filter has no bindings)
Implements Filter.
References ASSERT, PlotStreamData::b, RGBf::blue, K3DTreeMk2::build(), CHEM_DIST_DATALABEL, K3DTreeMk2::clearTags(), CLUSTER_LINK_ERODE, Filter::consoleOutput, IonStreamData::data, PlotStreamData::dataLabel, FILTER_ERR_ABORT, ProgressData::filterProgress, K3DTreeMk2::findNearestUntagged(), PlotStreamData::g, K3DTreeMk2::getBoundCube(), RangeFile::getColour(), RangeFile::getIonID(), RangeFile::getName(), RangeFile::getNumIons(), K3DTreeMk2::getOrigIndex(), K3DTreeMk2::getPt(), K3DTreeMk2::getTag(), RGBf::green, BoundCube::isValid(), PlotStreamData::logarithmic, ProgressData::maxStep, FilterStreamData::parent, PLOT_LINE_STEM, PLOT_MODE_1D, PlotStreamData::plotMode, PlotStreamData::plotStyle, PROGRESS_REDUCE, K3DTreeMk2::ptsInSphere(), PlotStreamData::r, RangeStreamData::rangeFile, RGBf::red, K3DTreeMk2::resetPts(), K3DTreeMk2::size(), SIZE_DIST_DATALABEL, Point3D::sqrDist(), ProgressData::step, ProgressData::stepName, STREAM_TYPE_IONS, STREAM_TYPE_RANGE, K3DTreeMk2::tag(), TRANS, WANT_COUNT_BULK_FORCROP, Filter::wantAbort, PlotStreamData::xLabel, PlotStreamData::xyData, and PlotStreamData::yLabel.
Referenced by typeString().
|
inlinevirtual |
Get the type string for this filter.
Implements Filter.
References getProperties(), getRefreshBlockMask(), getRefreshEmitMask(), getRefreshUseMask(), getSpecificErrString(), readState(), setProperty(), setPropFromBinding(), TRANS, and writeState().
|
virtual |
Dump state to output stream, using specified format.
Implements Filter.
References ASSERT, boolStrEnc(), escapeXML(), STATE_FORMAT_XML, tabs(), Filter::trueName(), Filter::userString, and writeIonsEnabledXML().
Referenced by typeString().