40 bool peakAtEnd, startFitAtPeak, initialized, progress;
46 bool outOfRange(std::size_t check) {
76 wxMenu* doc_file_menu;
82 stf::pslope_mode_beg pslopeBegMode;
83 stf::pslope_mode_end pslopeEndMode;
85 std::size_t baseBeg, baseEnd, peakBeg, peakEnd, fitBeg, fitEnd;
88 std::size_t PSlopeBeg, PSlopeEnd;
92 std::size_t measCursor;
94 double latencyStartCursor,
97 base, APBase, baseSD, threshold, slopeForThreshold, peak, APPeak, tLoReal, tHiReal, t50LeftReal, t50RightReal,
98 maxT, thrT, maxRiseY, maxRiseT, maxDecayY, maxDecayT, maxRise, maxDecay,
99 t50Y, APMaxT, APMaxRiseY, APMaxRiseT, APt50LeftReal,
100 APrtLoHi, APtLoReal, APtHiReal, APt0Real,
104 rtLoHi, InnerLoRT, InnerHiRT, OuterLoRT, OuterHiRT, halfDuration, slopeRatio, t0Real;
109 std::size_t tLoIndex, tHiIndex, t50LeftIndex, t50RightIndex, APt50LeftIndex, APt50RightIndex, APtLoIndex, APtHiIndex;
111 bool fromBase, viewCrosshair,viewBaseline,viewBaseSD,viewThreshold, viewPeakzero,viewPeakbase,viewPeakthreshold,
112 viewRTLoHi, viewInnerRiseTime, viewOuterRiseTime,
113 viewT50,viewRD,viewSloperise,viewSlopedecay,viewLatency,
117 std::vector<YZoom> yzoom;
119 std::vector< std::vector<stf::SectionAttributes> > sec_attr;
254 void Userdef(std::size_t
id);
381 std::size_t GetPSlopeBeg()
const {
return PSlopeBeg; }
386 std::size_t GetPSlopeEnd()
const {
return PSlopeEnd; }
398 int GetDeltaT()
const {
return DeltaT; }
615 double GetPSlope()
const {
return PSlope; }
643 stf::pslope_mode_beg GetPSlopeBegMode()
const {
return pslopeBegMode; }
648 stf::pslope_mode_end GetPSlopeEndMode()
const {
return pslopeEndMode; }
735 bool GetViewPSlope()
const {
return viewPSlope; }
841 void SetPSlopeBeg(
int value);
846 void SetPSlopeEnd(
int value);
851 void SetPSlope(
double value) { PSlope=value; }
856 void SetPSlopeBegMode(stf::pslope_mode_beg value) { pslopeBegMode=value; }
861 void SetPSlopeEndMode(stf::pslope_mode_end value) { pslopeEndMode=value; }
866 void SetDeltaT(
int value) { DeltaT=value; }
890 latencyEndMode=value;
897 latencyWindowMode=value;
1004 void SetViewPSlope(
bool value) { viewPSlope=value; }
1033 virtual void resize(std::size_t c_n_channels);
1058 double chisqr, std::size_t fitBeg_, std::size_t fitEnd_ );
1065 std::size_t begin, std::size_t end,
const Vector_double& quad_p_);
1076 std::vector<int>
CalcScoringTrace(std::vector<Annotation> expertAnnotations, std::size_t startPoint, std::size_t endPoint);
1078 std::pair<std::size_t, double>
CalcMaxKappa(std::vector<double> &sortedRawDetectionTrace, std::vector<int> &sortedScoringTrace);
1080 std::vector<stf::Event>
DetectEvents(
double threshold_, std::vector<double> &rawDetectionTrace);
1083 DECLARE_EVENT_TABLE()
WORD TSTime TpMarker WORD size
A Channel contains several data Sections representing observations of the same physical quantity.
Handles x-scaling of traces.
Handles y-scaling of traces.
A table used for printing information.
See http://www.wxwidgets.org/manuals/stable/wx_wxcommandevent.html (wxWidgets documentation)
See http://www.wxwidgets.org/manuals/stable/wx_wxdocument.html (wxWidgets documentation)
See http://www.wxwidgets.org/manuals/stable/wx_wxstring.html (wxWidgets documentation)
std::vector< double > Vector_double
const Section & cursec() const
Retrieves the currently accessed section in the active channel (read-only)
Recording()
Default constuctor.
direction
The direction of peak calculations.
latency_mode
Latency cursor settings.
baseline_method
Methods for Baseline computation.
extraction_mode
Deconvolution.
latency_window_mode
Latency window settings.
double GetSlopeRatio() const
Retrieves ratio of the maximal slopes during the rising and decaying phase.
double GetHalfDuration() const
Retrieves the full width at half-maximal amplitude ("half duration").
virtual bool OnOpenPyDocument(const wxString &filename)
Open document without progress dialog.
void CheckBoundaries()
Checks whether any cursor is reversed or out of range and corrects it if required.
void OnEraseAllAnnotations(wxCommandEvent &WXUNUSED(event))
Erase all annotations at the current channel and sweep.
const YZoom & GetYZoom(int ch)
Returns the current zoom settings for this channel (read-only).
void SetFromBase(bool frombase)
Sets the reference for AP kinetics measurements.
void FitDecay(wxCommandEvent &event)
Fit a function to the data.
double GetMaxRiseT() const
Retrieves the time point of the maximal slope during the rising phase.
double CalcAreaUnderCurve(std::vector< double > d, std::vector< int > c)
double GetTHiReal() const
Retrieves the time point at which Hi% of the maximal amplitude have been reached.
std::pair< std::size_t, double > CalcMaxKappa(std::vector< double > &sortedRawDetectionTrace, std::vector< int > &sortedScoringTrace)
double GetOuterRiseTime() const
Retrieves the outer rise time.
void SetViewRD(bool value)
Determines whether the ratio of the maximal slopes during rise and decay should be shown in the resul...
virtual bool OnNewDocument()
Override default file creation.
double GetAPMaxT() const
Retrieves the time point of the peak in the second channel.
virtual void InsertChannel(Channel &c_Channel, std::size_t pos)
Insert a Channel at a given position.
double GetMaxT() const
Retrieves the time point at which the peak is found.
bool GetViewT50() const
Indicates whether the half duration should be shown in the results table.
void SetViewPeakZero(bool value)
Determines whether the peak value (measured from zero) should be shown in the results table.
bool GetViewPeakZero() const
Indicates whether the peak value (measured from zero) should be shown in the results table.
std::size_t GetPeakBeg() const
Retrieves the position of the left peak cursor.
YZoom & GetYZoomW(int ch)
Returns the current zoom settings for this channel (read & write).
void Measure()
Measure everything using functions defined in measlib.h.
bool GetIsAverage() const
Indicates whether an average has been created.
stf::latency_mode GetLatencyEndMode() const
Retrieves the mode of the latency end cursor.
double GetInnerLoRT() const
Retrieves the time point at which Lo% of the maximal amplitude have been reached.
bool GetViewThreshold() const
Indicates whether the threshold should be shown in the results table.
void SetViewOuterRiseTime(bool value)
Determines whether the outer rise time should be shown in the results table.
void SetViewRTLoHi(bool value)
Determines whether the Lo to Hi% rise time should be shown in the results table.
bool IsInitialized() const
Indicates whether the the document is fully initialised.
void SetLatencyEndMode(stf::latency_mode value)
Sets the mode of the latency end cursor.
void SetViewThreshold(bool value)
Determines whether the threshold should be shown in the results table.
void OnExportAnnotations(wxCommandEvent &WXUNUSED(event))
Export all annotations of current doc.
const XZoom & GetXZoom()
Returns the current zoom settings for this channel (read-only).
virtual bool SaveAs()
Override default file saving.
void Select()
Selects the current section if previously unselected.
bool SubtractBase()
Subtracts the baseline of all selected traces.
bool GetViewRTLoHi() const
Indicates whether the Lo to Hi% rise time should be shown in the results table.
bool OnNewfromselectedThis()
Creates a new window containing the selected sections of this file.
bool GetPeakAtEnd() const
Indicates whether the right peak cursor should always be at the end of a trace.
void Selectall(wxCommandEvent &event)
Selects all sections.
double GetInnerHiRT() const
Retrieves the time point at which Hi% of the maximal amplitude have been reached.
std::size_t GetBaseBeg() const
Retrieves the position of the left baseline cursor.
void SetViewPeakThreshold(bool value)
Determines whether the peak value (measured from threshold) should be shown in the results table.
bool GetViewPeakThreshold() const
Indicates whether the peak value (measured from threshold) should be shown in the results table.
std::size_t GetBaseEnd() const
Retrieves the position of the right baseline cursor.
double GetOuterHiRT() const
Retrieves the time point at which Hi% of the maximal amplitude have been reached.
XZoom & GetXZoomW()
Returns the current zoom settings for this channel (read & write).
std::vector< double > SortScoringTraceByRawDetection(std::vector< double > &rawDetectionTrace, std::vector< int > &scoringTrace)
void SetPeakBeg(int value)
Sets the position of the left peak cursor.
void SetViewInnerRiseTime(bool value)
Determines whether the inner rise time should be shown in the results table.
void SetLatency(double value)
Sets the latency.
const Recording & GetAverage() const
Retrieves the average trace(s).
void SetViewBaseSD(bool value)
Determines whether the baseline's standard deviation should be shown in the results table.
bool GetViewPeakBase() const
Indicates whether the peak value (measured from baseline) should be shown in the results table.
void CopyCursors(const wxStfDoc &c_Recording)
Copies the cursor positions from another Recording to this Recording.
std::size_t GetFitEnd() const
Retrieves the position of the right fitting cursor.
void SetIsIntegrated(std::size_t nchannel, std::size_t nsection, bool value, std::size_t begin, std::size_t end, const Vector_double &quad_p_)
Determines whether an integral has been calculated in this section.
void SetLatencyBeg(double value)
Sets the position of the left latency cursor.
double GetMeasValue()
Retrieves the y-value at the measurement cursor (crosshair). Will update measCursor if out of range.
void SetBaseEnd(int value)
Sets the position of the right baseline cursor.
std::size_t GetPeakEnd() const
Retrieves the position of the right peak cursor.
void SetSlopeForThreshold(double value)
Sets the slope where the baseline should be set.
void ClearEvents(std::size_t nchannel, std::size_t nsection)
Erases all events.
void SetViewCrosshair(bool value)
Determines whether the measurement cursor (crosshair) value should be shown in the results table.
bool GetStartFitAtPeak() const
Indicates whether the left decay cursor should always be at the peak of the trace.
void correctRangeR(std::size_t &value)
bool GetFromBase() const
Indicates whether to use the baseline as a reference for AP kinetics.
const stf::SectionAttributes & GetCurrentSectionAttributes() const
std::vector< stf::Event > DetectEvents(double threshold_, std::vector< double > &rawDetectionTrace)
void SetRTFactor(int value)
Sets the lower value (e.g 20) to calculate the rise time.
void SetData(const Recording &c_Data, const wxStfDoc *Sender, const wxString &title)
Sets the content of a newly created file.
double GetLatencyEnd() const
Retrieves the position of the right latency cursor.
double GetPeakTime() const
Retrieves the peak time value.
double GetSlopeForThreshold() const
Returns the slope for threshold detection.
std::vector< int > CalcScoringTrace(std::vector< Annotation > expertAnnotations, std::size_t startPoint, std::size_t endPoint)
double GetLatency() const
Retrieves the latency.
double GetBaseSD() const
Retrieves the standard deviation of the baseline.
virtual bool DoSaveDocument(const wxString &filename)
Override default file saving.
double GetMaxRiseY() const
Retrieves the y-value at the time point of the maximal slope during the rising phase.
bool GetViewRD() const
Indicates whether the ratio of the maximal slopes during rise and decay should be shown in the result...
bool GetViewSlopeRise() const
Indicates whether the maximal slope during the rising phase should be shown in the results table.
void SetIsFitted(std::size_t nchannel, std::size_t nsection, const Vector_double &bestFitP_, stfnum::storedFunc *fitFunc_, double chisqr, std::size_t fitBeg_, std::size_t fitEnd_)
Sets the best-fit parameters when a fit has been performed on this section.
bool GetViewSlopeDecay() const
Indicates whether the maximal slope during the decaying phase should be shown in the results table.
void SetMeasRuler(bool value)
Sets whether the measurement cursor (crosshair) should be visible.
bool GetViewCursors() const
Indicates whether two additional rows showing the positions of start and end cursors should be shown ...
double GetThreshold() const
Retrieves the value at which the threshold slope is crossed.
double GetLatencyBeg() const
Retrieves the position of the left latency cursor.
void SetPeakEnd(int value)
Sets the position of the right peak cursor.
double GetThrT() const
Retrieves the time point at which the threshold slope is crossed.
bool GetViewBaseline() const
Indicates whether the baseline value should be shown in the results table.
bool GetViewBaseSD() const
Indicates whether the baseline's standard deviation should be shown in the results table.
bool GetViewInnerRiseTime() const
Indicates whether the inner rise time should be shown in the results table.
void SetMeasCursor(int value)
Sets the position of the measurement cursor (crosshair).
void AddEvent(wxCommandEvent &event)
Adds an event at the current eventPos.
int GetPM() const
Retrieves the number of points used for averaging during peak calculation.
bool GetViewCrosshair() const
Indicates whether the measurement cursor (crosshair) value should be shown in the results table.
double GetMaxDecay() const
Retrieves the maximal slope of the decaying phase.
double GetAPT0Real() const
Retrieves the extrapolated onset time point of an event in the reference channel.
void OnRemoveAnnotation(wxCommandEvent &WXUNUSED(event))
Removes an annotation at the current eventPos or a very close one to it.
double GetOuterLoRT() const
Retrieves the time point at which Lo% of the maximal amplitude have been reached.
void SetViewCursors(bool value)
Determines whether two additional rows showing the positions of start and end cursors should be shown...
void SetLatencyWindowMode(int value)
Sets the mode of the latency end cursor.
void SetFileMenu(wxMenu *menu)
Sets a pointer to the file menu attached to this document.
stf::latency_window_mode GetLatencyWindowMode() const
Retrieves the mode of the latency window.
void OnCalculatedThresholdExpertDetectEvents(double threshold, std::size_t filterOrder)
bool GetViewLatency() const
Indicates whether the latency should be shown in the results table.
double GetAPT50LeftReal() const
Retrieves the time point at which 50% of the max. amplitude have been reached from the left of the pe...
stf::latency_mode GetLatencyStartMode() const
Retrieves the mode of the latency start cursor.
virtual bool OnOpenDocument(const wxString &filename)
Override default file opening.
void OnImportAnnotations(wxCommandEvent &WXUNUSED(event))
Import all annotations of current doc.
stfnum::Table CurAsTable() const
Put the current trace into a text table.
void SetLatencyStartMode(stf::latency_mode value)
Sets the mode of the latency start cursor.
void SetViewSlopeRise(bool value)
Determines whether the maximal slope during the rising phase should be shown in the results table.
void SetStartFitAtPeak(bool value)
Sets the left decay cursor to the peak of the trace.
void OnExpertDetectEvents(wxCommandEvent &WXUNUSED(event))
detects events based on the expert scoring using simple filter
void UpdateSelectedButton()
Updates the status of the selection button.
std::vector< double > CalcRawDetectionTrace(std::size_t filterOrder, std::size_t startPoint, std::size_t endPoint)
bool SetSection(std::size_t section)
Sets the current section to the specified value.
void SetDirection(stfnum::direction value)
Sets the direction of peak calculations.
double GetTLoReal() const
Retrieves the time point at which Lo% of the maximal amplitude have been reached.
std::size_t GetMeasCursor() const
Retrieves the position of the measurement cursor (crosshair).
void SetFitEnd(int value)
Sets the position of the right fitting cursor.
void Remove()
Unselects the current section if previously selected.
void OnAddAnnotation(wxCommandEvent &WXUNUSED(event))
Adds an annotation at the current eventPos.
stf::SectionAttributes & GetCurrentSectionAttributesW()
double GetT50Y() const
Retrieves the y value at 50% of the maximal amplitude.
stfnum::baseline_method GetBaselineMethod() const
Retrieves the computation mode for baseline.
double GetRTLoHi() const
Retrieves the Lo to Hi% rise time.
double GetT0Real() const
Retrieves the extrapolated onset time point of an event in the active channel.
stfnum::Table CurResultsTable()
Put the current measurement results into a text table.
void SetViewBaseline(bool value)
Determines whether the baseline value should be shown in the results table.
void SetLatencyEnd(double value)
Sets the position of the right latency cursor.
double GetPeak() const
Retrieves the peak value.
void SetLatencyEndMode(int value)
Sets the mode of the latency end cursor.
double GetInnerRiseTime() const
Retrieves the inner rise time.
void InteractiveEraseEvents(wxCommandEvent &event)
Erases all events, independent of whether they are checked or not.
void SetPeakAtEnd(bool value)
Sets the right peak cursor to the end of a trace.
double GetT50RightReal() const
Retrieves the time point at which 50% of the maximal amplitude have been reached from the right of th...
stfnum::direction GetDirection() const
Retrieves the direction of peak calculations.
void SetLatencyWindowMode(stf::latency_window_mode value)
Sets the mode of the latency end cursor.
void SetViewSlopeDecay(bool value)
Determines whether the maximal slope during the decaying phase should be shown in the results table.
void Extract(wxCommandEvent &event)
Creates a new document from the checked events.
void SetPM(int value)
Sets the number of points used for averaging during peak calculation.
void SetViewT50(bool value)
Determines whether the half duration should be shown in the results table.
void correctRangeR(int &value)
double GetMaxDecayT() const
Retrieves the time point of the maximal slope during the decaying phase.
double GetMaxDecayY() const
Retrieves the y-value at the time point of the maximal slope during the decaying phase.
std::size_t GetFitBeg() const
Retrieves the position of the left fitting cursor.
double GetMaxRise() const
Retrieves the maximal slope of the rising phase.
void OnSwapChannels(wxCommandEvent &event)
Swaps active and inactive channel.
void SetLatencyStartMode(int value)
Sets the mode of the latency start cursor.
void SetViewPeakBase(bool value)
Determines whether the peak value (measured from baseline) should be shown in the results table.
double GetAPBase() const
Retrieves the baseline in the second channel.
bool GetViewOuterRiseTime() const
Indicates whether the outer rise time should be shown in the results table.
void Deleteselected(wxCommandEvent &event)
Unselects all sections.
void SetBaselineMethod(stfnum::baseline_method value)
Sets the method to compute the baseline.
bool LoadTDMS(const std::string &filename, Recording &ReturnData)
void SetBaseBeg(int value)
Sets the position of the left baseline cursor.
virtual bool OnCloseDocument()
Override default file closing.
void SetViewLatency(bool value)
Determines whether the latency should be shown in the results table.
double GetAPMaxRiseT() const
Retrieves the time point of the maximal slope of the rising phase in the second channel.
double GetT50LeftReal() const
Retrieves the time point at which 50% of the maximal amplitude have been reached from the left of the...
virtual void resize(std::size_t c_n_channels)
Resize the Recording to a new number of channels.
bool GetMeasRuler() const
Retrieves whether the measurement cursor (crosshair) is visible.
void SetFitBeg(int value)
Sets the position of the left fitting cursor.
int GetRTFactor() const
Retrieves lower factor (e.g 20) for the rise time calculation.
void CreateAverage(bool calcSD, bool align)
Creates an average trace from the selected sections.
double GetBase() const
Retrieves the baseline.
void ToggleSelect()
Toggles the selection status of the current section.
const stf::SectionAttributes & GetSectionAttributes(std::size_t nchannel, std::size_t nsection) const
void DeleteFit(std::size_t nchannel, std::size_t nsection)
Deletes the current fit, sets isFitted to false;.
#define StfDll
Defines dll export or import functions for Windows.
Function used for least-squares fitting.