8 #include <unordered_set> 24 if(rm_instances.find(rm) == rm_instances.end()) {
41 std::vector<std::string> colNames;
46 rm_instances.insert(rm);
60 rm_instances.erase(rm);
69 dbgprintf(
"rm_store_frame_info: frame=%d, ts=%f\n", frame,timestamp);
88 int* endFrame,
int *capturedFrames,
int *localizationsDone,
int *lostFrames,
ErrorCluster* err)
95 if (lastSaveFrame) *lastSaveFrame = r.lastSaveFrame;
96 if (endFrame) * endFrame = r.processedFrames;
97 if (capturedFrames) *capturedFrames = r.capturedFrames;
98 if (localizationsDone) *localizationsDone = r.localizationsDone;
99 if (lostFrames) *lostFrames = r.lostFrames;
114 return rm->
GetResults(results, startFrame, numFrames);
123 ArgumentErrorMsg(err,
"Cannot discard bead results while tracking in progress");
CDLL_EXPORT int DLL_CALLCONV rm_getbeadresults(ResultManager *rm, int start, int numFrames, int bead, LocalizationResult *results, ErrorCluster *err)
const ResultManagerConfig & Config()
Returns a reference to the used configuration to review.
int numBeads
Number of beads for which to grab results. Should always equal the amount of beads in a single frame...
CDLL_EXPORT void DLL_CALLCONV rm_destroy_all()
bool RemoveBeadResults(int bead)
Remove all results of a certain bead.
CDLL_EXPORT int DLL_CALLCONV rm_getresults(ResultManager *rm, int startFrame, int numFrames, LocalizationResult *results, ErrorCluster *err)
QueuedTracker * GetTracker()
Get the tracker from which results are fetched.
CDLL_EXPORT void DLL_CALLCONV rm_flush(ResultManager *rm, ErrorCluster *err)
CDLL_EXPORT ResultManager *DLL_CALLCONV rm_create(const char *file, const char *frameinfo, ResultManagerConfig *cfg, LStrHandle *names)
Structure for job results.
void StoreFrameInfo(int frame, double timestamp, float *columns)
Store metadata for a frame. This data will be saved in the info file.
CDLL_EXPORT void DLL_CALLCONV rm_removebead(ResultManager *rm, int bead, ErrorCluster *err)
int startFrame
Index of the first frame for which results are available.
Class that handles data gathering and saving from QueuedTracker instances.
int GetResults(LocalizationResult *results, int startFrame, int numResults)
Get the positions of all beads over an interval of frames.
static bool ValidRM(ResultManager *rm, ErrorCluster *err)
Verify the referenced resultmanager is a valid ResultManager instance.
int numFrameInfoColumns
Number of columns in the frame info metadata file. Additional columns can be added to save more data ...
CDLL_EXPORT void DLL_CALLCONV rm_getframecounters(ResultManager *rm, int *startFrame, int *lastSaveFrame, int *endFrame, int *capturedFrames, int *localizationsDone, int *lostFrames, ErrorCluster *err)
CDLL_EXPORT void DLL_CALLCONV rm_store_frame_info(ResultManager *rm, int frame, double timestamp, float *cols, ErrorCluster *err)
void ArgumentErrorMsg(ErrorCluster *e, const std::string &msg)
Structure for settings used by ResultManager.
void DeleteAllElems(T &c)
void SetTracker(QueuedTracker *qtrk)
Set the tracker from which to fetch results.
void Flush()
Write all available data regardless of ResultManagerConfig::writeInterval.
int GetBeadPositions(int startFrame, int endFrame, int bead, LocalizationResult *r)
Get the positions of a single bead over an interval of frames.
FrameCounters GetFrameCounters()
Returns a FrameCounters structure with the current counts.
CDLL_EXPORT void DLL_CALLCONV rm_getconfig(ResultManager *rm, ResultManagerConfig *cfg, ErrorCluster *err)
void dbgprintf(const char *fmt,...)
std::vector< std::string > LVGetStringArray(int count, LStrHandle *str)
static std::unordered_set< ResultManager * > rm_instances
CDLL_EXPORT void DLL_CALLCONV rm_set_tracker(ResultManager *rm, QueuedTracker *qtrk, ErrorCluster *err)
CDLL_EXPORT void DLL_CALLCONV rm_destroy(ResultManager *rm, ErrorCluster *err)
Abstract tracker interface, implemented by QueuedCUDATracker and QueuedCPUTracker.
std::string SPrintf(const char *fmt,...)