3Depict
|
Spatial analysis filter. More...
#include <spatialAnalysis.h>
Public Member Functions | |
SpatialAnalysisFilter () | |
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 fitler. More... | |
void | getProperties (FilterPropGroup &propertyList) const |
Get the properties of the filter, in key-value form. First 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... | |
std::string | getSpecificErrString (unsigned int code) const |
Get the human readable error string associated with a particular error code during refresh(...) More... | |
bool | writeState (std::ostream &f, unsigned int format, unsigned int depth=0) const |
Dump state to output stream, using specified format. More... | |
virtual bool | writePackageState (std::ostream &f, unsigned int format, const std::vector< std::string > &valueOverrides, unsigned int depth=0) const |
write an overridden filename version of the state More... | |
void | getStateOverrides (std::vector< string > &externalAttribs) 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... | |
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 possibly used during ::refresh. More... | |
void | setPropFromBinding (const SelectionBinding &b) |
Set internal property value using a selection binding. More... | |
void | setUserString (const std::string &s) |
Set a user-specified string return value is. 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... | |
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... | |
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 |
Spatial analysis filter.
SpatialAnalysisFilter::SpatialAnalysisFilter | ( | ) |
References ALGORITHM_DENSITY, ALGORITHM_ENUM_END, Filter::cache, Filter::cacheOK, COMPILE_ASSERT, REPLACE_ALGORITHMS, REPLACE_MODE_ENUM_END, REPLACE_MODE_SUBTRACT, SPATIAL_ALGORITHMS, STOP_MODE_ENUM_END, STOP_MODE_NEIGHBOUR, STOP_MODES, THREEDEP_ARRAYSIZE, and WANT_RANGE_PROPAGATION.
Referenced by cloneUncached(), and setPropFromBinding().
|
virtual |
Duplicate filter contents, excluding cache.
Implements Filter.
References Filter::cache, Filter::cacheOK, SpatialAnalysisFilter(), and Filter::userString.
|
virtual |
Get the properties of the filter, in key-value form. First vector is for each output.
Implements Filter.
References FilterPropGroup::addProperty(), ALGORITHM_AXIAL_DF, ALGORITHM_BINOMIAL, ALGORITHM_DENSITY, ALGORITHM_DENSITY_FILTER, ALGORITHM_ENUM_END, ALGORITHM_LOCAL_CHEMISTRY, ALGORITHM_RDF, ALGORITHM_REPLACE, ASSERT, boolStrEnc(), choiceString(), FilterProperty::data, FilterProperty::dataSecondary, FilterProperty::helpText, FilterProperty::key, KEY_ALGORITHM, KEY_BINOMIAL_EXTRUDE_DIR, KEY_BINOMIAL_MAX_ASPECT, KEY_COLOUR, KEY_CUTOFF, KEY_DISTMAX, KEY_ENABLE_NUMERATOR_ALL, KEY_ENABLE_SOURCE_ALL, KEY_ENABLE_TARGET_ALL, KEY_NNMAX, KEY_NNMAX_NORMALISE, KEY_NNMAX_SHOWRANDOM, KEY_NORMAL, KEY_NUMBINS, KEY_NUMIONS, KEY_REDUCTIONDIST, KEY_REMOVAL, KEY_REPLACE_ALGORITHM, KEY_REPLACE_FILE, KEY_REPLACE_TOLERANCE, KEY_REPLACE_VALUE, KEY_RETAIN_UPPER, KEY_SHOW_BINOM_3D_GRID, KEY_SHOW_BINOM_FREQ, KEY_SHOW_BINOM_NORM_FREQ, KEY_SHOW_BINOM_THEOR_FREQ, KEY_STOPMODE, KEYTYPE_ENABLE_NUMERATOR, KEYTYPE_ENABLE_SOURCE, KEYTYPE_ENABLE_TARGET, Filter::muxKey(), FilterProperty::name, PROPERTY_TYPE_BOOL, PROPERTY_TYPE_CHOICE, PROPERTY_TYPE_COLOUR, PROPERTY_TYPE_FILE, PROPERTY_TYPE_INTEGER, PROPERTY_TYPE_POINT3D, PROPERTY_TYPE_REAL, REPLACE_ALGORITHMS, REPLACE_MODE_ENUM_END, REPLACE_MODE_SUBTRACT, ColourRGBA::rgbaString(), ColourRGBA::rgbString(), FilterPropGroup::setGroupTitle(), SPATIAL_ALGORITHMS, STOP_MODE_NEIGHBOUR, STOP_MODE_RADIUS, STOP_MODES, stream_cast(), ColourRGBAf::toColourRGBA(), TRANS, and FilterProperty::type.
Referenced by typeString().
|
virtual |
Get the stream types that will be dropped during ::refresh.
Implements Filter.
References STREAM_TYPE_IONS, STREAM_TYPE_RANGE, and WANT_RANGE_PROPAGATION.
Referenced by refresh(), and typeString().
|
virtual |
Get the stream types that will be generated during ::refresh.
Implements Filter.
References ALGORITHM_AXIAL_DF, ALGORITHM_BINOMIAL, ALGORITHM_RDF, STREAM_TYPE_DRAW, STREAM_TYPE_IONS, and STREAM_TYPE_PLOT.
Referenced by typeString().
|
virtual |
Get the stream types that will be possibly used during ::refresh.
Implements Filter.
References STREAM_TYPE_IONS.
Referenced by typeString().
|
virtual |
Get the human readable error string associated with a particular error code during refresh(...)
Implements Filter.
References ASSERT, COMPILE_ASSERT, SPAT_ERR_END_OF_ENUM, THREEDEP_ARRAYSIZE, and TRANS.
Referenced by typeString().
|
virtual |
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.
Reimplemented from Filter.
Referenced by typeString().
|
inlinevirtual |
Returns FILTER_TYPE_SPATIAL_ANALYSIS.
Implements Filter.
References FILTER_TYPE_SPATIAL_ANALYSIS, and refresh().
|
virtual |
Initialise filter prior to tree propagation.
Reimplemented from Filter.
References RangeStreamData::enabledIons, RangeFile::getName(), RangeFile::getNumIons(), RangeFile::getNumRanges(), RangeStreamData::rangeFile, STREAM_TYPE_RANGE, and WANT_RANGE_PROPAGATION.
Referenced by setPropFromBinding().
|
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 ALGORITHM_ENUM_END, boolStrDec(), Filter::convertFileStringToAbsolute(), convertFileStringToNative(), parseXMLColour(), readIonsEnabledXML(), readScalarsXML(), readVectorsXML(), REPLACE_MODE_ENUM_END, STOP_MODE_ENUM_END, 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 ALGORITHM_AXIAL_DF, ALGORITHM_BINOMIAL, ALGORITHM_DENSITY, ALGORITHM_DENSITY_FILTER, ALGORITHM_LOCAL_CHEMISTRY, ALGORITHM_RDF, ALGORITHM_REPLACE, ASSERT, IonStreamData::b, K3DTreeMk2::build(), Filter::cacheAsNeeded(), Filter::cacheOK, Filter::collateIons(), IonStreamData::data, ERR_ABORT_FAIL, ERR_FILE_READ_FAIL, ERR_NO_RANGE, ProgressData::filterProgress, K3DTreeMk2::findNearestUntagged(), IonStreamData::g, GenericLoadFloatFile(), K3DTreeMk2::getBoundCube(), K3DTreeMk2::getOrigIndex(), K3DTreeMk2::getPt(), getRangeFile(), getRefreshBlockMask(), ProgressData::maxStep, numElements(), Filter::propagateCache(), Filter::propagateStreams(), IonStreamData::r, REPLACE_MODE_INTERSECT, REPLACE_MODE_SUBTRACT, REPLACE_MODE_UNION, K3DTreeMk2::resetPts(), K3DTreeMk2::setAbortFlag(), K3DTree::setAbortFlag(), K3DTreeMk2::setProgressPtr(), K3DTree::setProgressPtr(), ProgressData::step, ProgressData::stepName, STREAM_TYPE_IONS, STREAM_TYPE_RANGE, TRANS, WANT_RANGE_PROPAGATION, and Filter::wantAbort.
Referenced by getType(), and setPropFromBinding().
|
virtual |
Set the properties for the nth filter.
Implements Filter.
References ALGORITHM_AXIAL_DF, ALGORITHM_DENSITY, ALGORITHM_DENSITY_FILTER, ALGORITHM_ENUM_END, ALGORITHM_LOCAL_CHEMISTRY, ALGORITHM_RDF, Filter::applyPropertyNow(), ASSERT, PlotStreamData::b, ColourRGBAf::b(), boolStrDec(), Filter::cacheOK, Filter::clearCache(), Filter::demuxKey(), Filter::filterOutputs, PlotStreamData::g, ColourRGBAf::g(), KEY_ALGORITHM, KEY_BINOMIAL_EXTRUDE_DIR, KEY_BINOMIAL_MAX_ASPECT, KEY_COLOUR, KEY_CUTOFF, KEY_DISTMAX, KEY_ENABLE_NUMERATOR_ALL, KEY_ENABLE_SOURCE_ALL, KEY_ENABLE_TARGET_ALL, KEY_NNMAX, KEY_NNMAX_NORMALISE, KEY_NNMAX_SHOWRANDOM, KEY_NORMAL, KEY_NUMBINS, KEY_NUMIONS, KEY_ORIGIN, KEY_RADIUS, KEY_REDUCTIONDIST, KEY_REMOVAL, KEY_REPLACE_ALGORITHM, KEY_REPLACE_FILE, KEY_REPLACE_TOLERANCE, KEY_REPLACE_VALUE, KEY_RETAIN_UPPER, KEY_SHOW_BINOM_3D_GRID, KEY_SHOW_BINOM_FREQ, KEY_SHOW_BINOM_NORM_FREQ, KEY_SHOW_BINOM_THEOR_FREQ, KEY_STOPMODE, KEYTYPE_ENABLE_DENOMINATOR, KEYTYPE_ENABLE_NUMERATOR, KEYTYPE_ENABLE_SOURCE, KEYTYPE_ENABLE_TARGET, Point3D::parse(), ColourRGBA::parse(), PlotStreamData::r, ColourRGBAf::r(), REPLACE_ALGORITHMS, REPLACE_MODE_ENUM_END, SPATIAL_ALGORITHMS, Point3D::sqrMag(), STOP_MODE_ENUM_END, STOP_MODES, stream_cast(), STREAM_TYPE_PLOT, stripWhite(), ColourRGBAf::toColourRGBA(), ColourRGBA::toRGBAf(), and TRANS.
Referenced by setPropFromBinding(), and typeString().
|
virtual |
Set internal property value using a selection binding.
Implements Filter.
References IonStreamData::a, RangeFile::addIon(), RangeFile::addRange(), ALGORITHM_AXIAL_DF, ALGORITHM_DENSITY, ALGORITHM_LOCAL_CHEMISTRY, ALGORITHM_RDF, ALGORITHM_REPLACE, ASSERT, IonStreamData::b, PlotStreamData::b, ColourRGBAf::b(), BINDING_CYLINDER_DIRECTION, BINDING_CYLINDER_ORIGIN, BINDING_CYLINDER_RADIUS, BINOMIAL_NO_MEM, BINOMIAL_SEGMENT_AUTO_BRICK, RGBf::blue, K3DTreeMk2::build(), K3DTree::buildByRef(), Filter::buildSplitPoints(), Filter::cacheAsNeeded(), FilterStreamData::cached, BINOMIAL_STATS::chiSquare, Filter::clearCache(), Filter::collateIons(), BINOMIAL_STATS::comparisonCoeff, computeBinomialStats(), Filter::consoleOutput, countBinnedIons(), createTmpFilename(), IonStreamData::data, PlotStreamData::dataLabel, DEFAULT_AXIAL_DISTANCE, DISTANCE_EPSILON, DrawStreamData::drawables, RangeStreamData::enabledIons, RangeStreamData::enabledRanges, EQ_TOL, ERR_ABORT_FAIL, ERR_BINOMIAL_BIN_FAIL, ERR_BINOMIAL_NO_MEM, IonStreamData::estimateIonParameters(), SEGMENT_OPTION::extrudeMaxRatio, SEGMENT_OPTION::extrusionDirection, FILTER_ERR_ABORT, Filter::filterOutputs, ProgressData::filterProgress, K3DTree::findKNearest(), K3DTree::findNearest(), K3DTreeMk2::findNearestWithSkip(), IonStreamData::g, PlotStreamData::g, ColourRGBAf::g(), genBinomialHistogram(), generate1DAxialDistHist(), generate1DAxialNNHist(), generateDistHist(), generateKnnTheoreticalDist(), generateNNHist(), K3DTreeMk2::getBoundCube(), RangeFile::getColour(), SelectionBinding::getID(), RangeFile::getIonID(), Filter::getIonstreamIonID(), RangeFile::getName(), IonStreamData::getNumBasicObjects(), RangeFile::getNumIons(), K3DTreeMk2::getOrigIndex(), IonHit::getPos(), K3DTreeMk2::getPtRef(), GetReducedHullPts(), Filter::getUserString(), SelectionBinding::getValue(), RGBf::green, PlotStreamData::index, initFilter(), INSUFFICIENT_SIZE_ERR, IonStreamData::ionSize, KEY_ALGORITHM, KEY_DISTMAX, KEY_NNMAX, KEY_NORMAL, KEY_ORIGIN, KEY_RADIUS, KEY_REMOVAL, KEY_REPLACE_ALGORITHM, KEY_REPLACE_FILE, KEY_REPLACE_VALUE, KEY_STOPMODE, KEYTYPE_ENABLE_DENOMINATOR, KEYTYPE_ENABLE_NUMERATOR, KEYTYPE_ENABLE_SOURCE, M_PI, IonHit::makePos(), BINOMIAL_HIST::mapIonFrequencies, ProgressData::maxStep, BINOMIAL_STATS::mean, Filter::muxKey(), SEGMENT_OPTION::nIons, K3DTree::nodeCount(), Point3D::normalise(), BINOMIAL_HIST::normalisedFrequencies, NUM_CALLBACK, FilterStreamData::parent, PLOT_LINE_STEM, PLOT_LINE_STEPS, PLOT_MODE_1D, PlotStreamData::plotMode, PlotStreamData::plotStyle, K3DTreeMk2::ptsInSphere(), BINOMIAL_STATS::pValue, BINOMIAL_STATS::pValueOK, IonStreamData::r, PlotStreamData::r, ColourRGBAf::r(), RangeFile::rangeByIon(), RangeStreamData::rangeFile, RDF_ABORT_FAIL, RDF_ERR_INSUFFICIENT_INPUT_POINTS, RGBf::red, refresh(), REPLACE_ALGORITHMS, REPLACE_MODE_INTERSECT, REPLACE_MODE_SUBTRACT, REPLACE_MODE_UNION, K3DTreeMk2::resetPts(), DrawRectPrism::setAxisAligned(), BoundCube::setBounds(), Filter::setCaching(), DrawRectPrism::setColour(), DrawRectPrism::setLineWidth(), IonHit::setMassToCharge(), IonHit::setPos(), setProperty(), SPAT_ERR_END_OF_ENUM, SPATIAL_ALGORITHMS, SpatialAnalysisFilter(), Point3D::sqrDist(), Point3D::sqrMag(), ProgressData::step, ProgressData::stepName, STOP_MODE_NEIGHBOUR, STOP_MODE_RADIUS, STOP_MODES, SEGMENT_OPTION::strategy, stream_cast(), STREAM_TYPE_IONS, STREAM_TYPE_PLOT, STREAM_TYPE_RANGE, TEST, BINOMIAL_HIST::theoreticFrequencies, BINOMIAL_HIST::theoreticNormalisedFrequencies, TRANS, IonStreamData::valueType, Filter::wantAbort, weightedMean(), PlotStreamData::xLabel, xorFunc(), PlotStreamData::xyData, and PlotStreamData::yLabel.
Referenced by typeString().
|
virtual |
Set a user-specified string return value is.
Reimplemented from Filter.
References ALGORITHM_ENUM_END, Filter::clearCache(), COMPILE_ASSERT, THREEDEP_ARRAYSIZE, and Filter::userString.
Referenced by typeString().
|
inlinevirtual |
Get the type string for this fitler.
Implements Filter.
References getProperties(), getRefreshBlockMask(), getRefreshEmitMask(), getRefreshUseMask(), getSpecificErrString(), getStateOverrides(), readState(), setProperty(), setPropFromBinding(), setUserString(), TRANS, writePackageState(), and writeState().
|
virtual |
write an overridden filename version of the state
Reimplemented from Filter.
References ASSERT, and writeState().
Referenced by typeString().
|
virtual |
Dump state to output stream, using specified format.
Implements Filter.
References ColourRGBAf::a(), ASSERT, ColourRGBAf::b(), boolStrEnc(), convertFileStringToCanonical(), escapeXML(), ColourRGBAf::g(), ColourRGBAf::r(), STATE_FORMAT_XML, tabs(), Filter::trueName(), Filter::userString, writeIonsEnabledXML(), writeScalarsXML(), and writeVectorsXML().
Referenced by typeString(), and writePackageState().