Stimfit @PACKAGE_VERSION@
Loading...
Searching...
No Matches
doc.h
Go to the documentation of this file.
1// This program is free software; you can redistribute it and/or
2// modify it under the terms of the GNU General Public License
3// as published by the Free Software Foundation; either version 2
4// of the License, or (at your option) any later version.
5
6// This program is distributed in the hope that it will be useful,
7// but WITHOUT ANY WARRANTY; without even the implied warranty of
8// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9// GNU General Public License for more details.
10
11// You should have received a copy of the GNU General Public License
12// along with this program; if not, write to the Free Software
13// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
14
20
21#ifndef _DOC_H
22#define _DOC_H
23
27
28#include "./../stf.h"
29
31
34class StfDll wxStfDoc: public wxDocument, public Recording
35{
36#ifndef FROM_PYTHON
37 DECLARE_DYNAMIC_CLASS(wxStfDoc)
38#endif
39private:
40 bool peakAtEnd, startFitAtPeak, initialized, progress;
41 Recording Average;
42 int InitCursors();
43 void PostInit();
44 bool ChannelSelDlg();
45 void WriteToReg();
46 bool outOfRange(std::size_t check) {
47 return (check >= cursec().size());
48 }
49 void Focus();
50 void OnNewfromselectedThisMenu( wxCommandEvent& ) { OnNewfromselectedThis( ); }
51 void Selectsome(wxCommandEvent& event);
52 void Unselectsome(wxCommandEvent& event);
53 void SelectTracesOfType(wxCommandEvent& event);
54 void UnselectTracesOfType(wxCommandEvent& event);
55 void ConcatenateMultiChannel(wxCommandEvent& event);
56 void OnAnalysisBatch( wxCommandEvent& event );
57 void OnAnalysisIntegrate( wxCommandEvent& event );
58 void OnAnalysisDifferentiate( wxCommandEvent& event );
59 //void OnSwapChannels( wxCommandEvent& event );
60 void Multiply(wxCommandEvent& event);
61 void SubtractBaseMenu( wxCommandEvent& ) { SubtractBase( ); }
62 void LFit(wxCommandEvent& event);
63 void LnTransform(wxCommandEvent& event);
64 void Filter(wxCommandEvent& event);
65 void P_over_N(wxCommandEvent& event);
66 void Plotextraction(stf::extraction_mode mode);
67 void Plotcriterion(wxCommandEvent& event);
68 void Plotcorrelation(wxCommandEvent& event);
69 void Plotdeconvolution(wxCommandEvent& event);
70 void MarkEvents(wxCommandEvent& event);
71 void Threshold(wxCommandEvent& event);
72 void Viewtable(wxCommandEvent& event);
73 void Fileinfo(wxCommandEvent& event);
74 Recording ReorderChannels();
75
76 wxMenu* doc_file_menu;
77
78 stf::latency_mode latencyStartMode, latencyEndMode;
79 stf::latency_window_mode latencyWindowMode;
80 stfnum::direction direction; //of peak detection: UP, DOWN or BOTH
81#ifdef WITH_PSLOPE
82 stf::pslope_mode_beg pslopeBegMode; // for left mode PSlope cursor
83 stf::pslope_mode_end pslopeEndMode; // for right mode PSlope cursor
84#endif
85 std::size_t baseBeg, baseEnd, peakBeg, peakEnd, fitBeg, fitEnd;
86 stfnum::baseline_method baselineMethod; // method for calculating baseline
87#ifdef WITH_PSLOPE
88 std::size_t PSlopeBeg, PSlopeEnd;
89 int DeltaT; // distance (number of points) from the first cursor
90 bool viewPSlope;
91#endif
92 std::size_t measCursor;
93 bool ShowRuler; // show a ruler throught the measurement cursor?
94 double latencyStartCursor,
95 latencyEndCursor,
96 latency, //time from latency cursor to beginning of event
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,
101#ifdef WITH_PSLOPE
102 PSlope,
103#endif
104 rtLoHi, InnerLoRT, InnerHiRT, OuterLoRT, OuterHiRT, halfDuration, slopeRatio, t0Real;
105 // cursor windows:
106 int pM; //peakMean, number of points used for averaging
107 int RTFactor; // Lower point for the rise-time calculation
108
109 std::size_t tLoIndex, tHiIndex, t50LeftIndex, t50RightIndex, APt50LeftIndex, APt50RightIndex, APtLoIndex, APtHiIndex;
110
111 bool fromBase, viewCrosshair,viewBaseline,viewBaseSD,viewThreshold, viewPeakzero,viewPeakbase,viewPeakthreshold,
112 viewRTLoHi, viewInnerRiseTime, viewOuterRiseTime,
113 viewT50,viewRD,viewSloperise,viewSlopedecay,viewLatency,
114 viewCursors;
115
116 XZoom xzoom;
117 std::vector<YZoom> yzoom;
118
119 std::vector< std::vector<stf::SectionAttributes> > sec_attr;
120public:
121
123
128
130
133
135
139 virtual bool OnOpenDocument(const wxString& filename);
140
142
146 virtual bool OnOpenPyDocument(const wxString& filename);
147
149
151 virtual bool SaveAs();
152
153#ifndef TEST_MINIMAL
155
158 virtual bool DoSaveDocument(const wxString& filename);
159#endif
161
164 virtual bool OnCloseDocument();
165
167
169 virtual bool OnNewDocument();
170
172
176 void SetData( const Recording& c_Data, const wxStfDoc* Sender, const wxString& title );
177
179
181 bool GetIsAverage() const { return !Average.get().empty(); }
182
184
186 bool GetStartFitAtPeak() const { return startFitAtPeak; }
187
189
191 bool GetPeakAtEnd() const { return peakAtEnd; }
192
194
199 bool IsInitialized() const { return initialized; }
200
202
204 void SetPeakAtEnd(bool value) { peakAtEnd=value; }
205
207
209 void SetStartFitAtPeak(bool value) { startFitAtPeak=value; }
210
212
214 const Recording& GetAverage() const { return Average; }
215
218
220
223 bool SetSection(std::size_t section);
224
226
229
231
234
236
239
242
244
248 void CreateAverage( bool calcSD, bool align );
249
250#if 0
252
254 void Userdef(std::size_t id);
255#endif
256
259
261 void Select();
262
264 void Remove();
265
267
270
272
275
277
279 void AddEvent( wxCommandEvent& event );
280
282
284 void OnAddAnnotation( wxCommandEvent& WXUNUSED(event) );
285
287
289 void OnRemoveAnnotation( wxCommandEvent& WXUNUSED(event) );
290
292
294 void OnEraseAllAnnotations( wxCommandEvent& WXUNUSED(event) );
295
297
299 void OnExportAnnotations( wxCommandEvent& WXUNUSED(event) );
300
302
304 void OnImportAnnotations( wxCommandEvent& WXUNUSED(event) );
305
307
309 void OnExpertDetectEvents( wxCommandEvent& WXUNUSED(event) );
310
311
313
316
318
321
323
325 void SetFileMenu( wxMenu* menu ) { doc_file_menu = menu; }
326
328
332 void Measure();
333
336
338
340 std::size_t GetMeasCursor() const { return measCursor; }
341
343
345 stfnum::baseline_method GetBaselineMethod() const { return baselineMethod; }
346
348
350 std::size_t GetBaseBeg() const { return baseBeg; }
351
353
355 std::size_t GetBaseEnd() const { return baseEnd; }
356
358
360 std::size_t GetPeakBeg() const { return peakBeg; }
361
363
365 std::size_t GetPeakEnd() const { return peakEnd; }
366
368
370 std::size_t GetFitBeg() const { return fitBeg; }
371
373
375 std::size_t GetFitEnd() const { return fitEnd; }
376
377#ifdef WITH_PSLOPE
379
381 std::size_t GetPSlopeBeg() const { return PSlopeBeg; }
382
384
386 std::size_t GetPSlopeEnd() const { return PSlopeEnd; }
387#endif // WITH_PSLOPE
388
390
392 int GetPM() const { return pM; }
393
394#ifdef WITH_PSLOPE
396
398 int GetDeltaT() const { return DeltaT; }
399#endif
400
402
406 double GetLatencyBeg() const { return latencyStartCursor; }
407
409
413 double GetLatencyEnd() const { return latencyEndCursor; }
414
416
418 double GetLatency() const { return latency; }
419
421
424 double GetTLoReal() const { return tLoReal; }
425
427
430 double GetTHiReal() const { return tHiReal; }
431
433
436 double GetInnerLoRT() const { return InnerLoRT; }
437
439
442 double GetInnerHiRT() const { return InnerHiRT; }
443
445
448 double GetOuterLoRT() const { return OuterLoRT; }
449
451
454 double GetOuterHiRT() const { return OuterHiRT; }
455
457
460 double GetT0Real() const { return t0Real; }
461
463
466 double GetT50LeftReal() const { return t50LeftReal; }
467
469
472 double GetT50RightReal() const { return t50RightReal; }
473
475
477 double GetT50Y() const { return t50Y; }
478
480
482 double GetMaxRise() const { return maxRise; }
483
485
487 double GetMaxDecay() const { return maxDecay; }
488
490
494 double GetAPMaxRiseT() const { return APMaxRiseT; }
495
497
500 double GetAPMaxT() const { return APMaxT; }
501
503
506 double GetAPT50LeftReal() const { return APt50LeftReal; }
507
509
512 double GetAPT0Real() const { return APt0Real; }
513
515
517 double GetMaxRiseT() const { return maxRiseT; }
518
520
522 double GetMaxRiseY() const { return maxRiseY; }
523
525
527 double GetMaxDecayT() const { return maxDecayT; }
528
530
532 double GetMaxDecayY() const { return maxDecayY; }
533
535
537 double GetMeasValue();
538
540
542 double GetPeak() const { return peak; }
543
545
547 double GetPeakTime() const { return maxT; }
548
550
552 double GetBase() const { return base; }
553
555
557 double GetAPBase() const { return APBase; }
558
560
562 double GetBaseSD() const { return baseSD; }
563
565
567 double GetThreshold() const { return threshold; }
568
570
572 double GetMaxT() const { return maxT; }
573
575
578 double GetThrT() const { return thrT; }
579
581
583 double GetRTLoHi() const { return rtLoHi; }
584
586
588 double GetInnerRiseTime() const { return (InnerHiRT-InnerLoRT); }
589
591
593 double GetOuterRiseTime() const { return (OuterHiRT-OuterLoRT); }
594
596
598 double GetHalfDuration() const { return halfDuration; }
599
600
602
604 double GetSlopeRatio() const { return slopeRatio; }
605
607
609 int GetRTFactor() const { return RTFactor; }
610
611#ifdef WITH_PSLOPE
613
615 double GetPSlope() const { return PSlope; }
616#endif
617
619
621 stf::latency_mode GetLatencyStartMode() const { return latencyStartMode; }
622
624
626 stf::latency_mode GetLatencyEndMode() const { return latencyEndMode; }
627
629
631 stf::latency_window_mode GetLatencyWindowMode() const { return latencyWindowMode; }
632
634
636 stfnum::direction GetDirection() const { return direction; }
637
638
639#ifdef WITH_PSLOPE
641
643 stf::pslope_mode_beg GetPSlopeBegMode() const { return pslopeBegMode; }
644
646
648 stf::pslope_mode_end GetPSlopeEndMode() const { return pslopeEndMode; }
649#endif // WITH_PSLOPE
650
652
654 bool GetFromBase() const { return fromBase; }
655
657
659 bool GetViewCrosshair() const { return viewCrosshair; }
660
662
664 bool GetViewBaseline() const { return viewBaseline; }
665
667
669 bool GetViewBaseSD() const { return viewBaseSD; }
670
672
674 bool GetViewThreshold() const { return viewThreshold; }
675
677
679 bool GetViewPeakZero() const { return viewPeakzero; }
680
682
684 bool GetViewPeakBase() const { return viewPeakbase; }
685
687
689 bool GetViewPeakThreshold() const { return viewPeakthreshold; }
690
692
694 bool GetViewRTLoHi() const { return viewRTLoHi; }
695
697
699 bool GetViewInnerRiseTime() const { return viewInnerRiseTime; }
700
702
704 bool GetViewOuterRiseTime() const { return viewOuterRiseTime; }
705
707
709 bool GetViewT50() const { return viewT50; }
710
712
714 bool GetViewRD() const { return viewRD; }
715
717
719 bool GetViewSlopeRise() const { return viewSloperise; }
720
722
724 bool GetViewSlopeDecay() const { return viewSlopedecay; }
725
727
729 bool GetViewLatency() const { return viewLatency; }
730
731#ifdef WITH_PSLOPE
733
735 bool GetViewPSlope() const { return viewPSlope; }
736
737#endif
739
741 bool GetViewCursors() const { return viewCursors; }
742
744
746 double GetSlopeForThreshold() const { return slopeForThreshold; }
747
749
751 const XZoom& GetXZoom() { return xzoom; }
752
754
756 XZoom& GetXZoomW() { return xzoom; }
757
759
761 const YZoom& GetYZoom(int ch) { return yzoom.at(ch); }
762
764
766 YZoom& GetYZoomW(int ch) { return yzoom.at(ch); }
767
769
771 void SetMeasCursor(int value);
772
774
776 void SetMeasRuler(bool value) { ShowRuler = value; }
777
779
781 bool GetMeasRuler() const { return ShowRuler;}
782
784
786 void SetBaselineMethod(stfnum::baseline_method value) { baselineMethod = value; }
787
789
791 void SetBaseBeg(int value);
792
794
796 void SetBaseEnd(int value);
797
799
801 void SetPeakBeg(int value);
802
804
806 void SetPeakEnd(int value);
807
809
811 void SetFitBeg(int value);
812
814
816 void SetFitEnd(int value);
817
819
823 void SetLatencyBeg(double value);
824
826
830 void SetLatencyEnd(double value);
831
833
835 void SetLatency(double value) { latency=value; }
836
837#ifdef WITH_PSLOPE
839
841 void SetPSlopeBeg(int value);
842
844
846 void SetPSlopeEnd(int value);
847
849
851 void SetPSlope(double value) { PSlope=value; }
852
854
856 void SetPSlopeBegMode(stf::pslope_mode_beg value) { pslopeBegMode=value; }
857
859
861 void SetPSlopeEndMode(stf::pslope_mode_end value) { pslopeEndMode=value; }
862
864
866 void SetDeltaT(int value) { DeltaT=value; }
867
868#endif // WITH_PSLOPE
869
871
873 void SetPM(int value) { pM=value; }
874
876
879 void SetRTFactor(int value);
880
882
884 void SetLatencyStartMode(stf::latency_mode value) { latencyStartMode=value; }
885
887
890 latencyEndMode=value;
891 }
892
894
897 latencyWindowMode=value;
898 }
899
901
903 void SetLatencyStartMode(int value);
904
906
908 void SetLatencyEndMode(int value);
909
911
913 void SetLatencyWindowMode(int value);
914
916
918 void SetDirection(stfnum::direction value) { direction=value; }
919
921
923 void SetFromBase(bool frombase) { fromBase = frombase; }
924
926
928 void SetViewCrosshair(bool value) { viewCrosshair=value; }
929
931
933 void SetViewBaseline(bool value) { viewBaseline=value; }
934
936
938 void SetViewBaseSD(bool value) { viewBaseSD=value; }
939
941
943 void SetViewThreshold(bool value) { viewThreshold=value; }
944
946
948 void SetViewPeakZero(bool value) { viewPeakzero=value; }
949
951
953 void SetViewPeakBase(bool value) { viewPeakbase=value; }
954
956
958 void SetViewPeakThreshold(bool value) { viewPeakthreshold=value; }
959
961
963 void SetViewRTLoHi(bool value) { viewRTLoHi=value; }
964
966
968 void SetViewInnerRiseTime(bool value) { viewInnerRiseTime=value; }
969
971
973 void SetViewOuterRiseTime(bool value) { viewOuterRiseTime=value; }
974
976
978 void SetViewT50(bool value) { viewT50=value; }
979
981
983 void SetViewRD(bool value) { viewRD=value; }
984
986
988 void SetViewSlopeRise(bool value) { viewSloperise=value; }
989
991
993 void SetViewSlopeDecay(bool value) { viewSlopedecay=value; }
994
996
998 void SetViewLatency(bool value) { viewLatency=value; }
999
1000#ifdef WITH_PSLOPE
1002
1004 void SetViewPSlope(bool value) { viewPSlope=value; }
1005#endif
1006
1008
1010 void SetViewCursors(bool value) { viewCursors=value; }
1011
1013
1015 void SetSlopeForThreshold(double value) { slopeForThreshold=value; }
1016
1019
1021
1027 void CopyCursors(const wxStfDoc& c_Recording);
1028
1030
1033 virtual void resize(std::size_t c_n_channels);
1034
1036
1040 virtual void InsertChannel(Channel& c_Channel, std::size_t pos);
1041
1042 const stf::SectionAttributes& GetSectionAttributes(std::size_t nchannel, std::size_t nsection) const;
1045
1047 void DeleteFit(std::size_t nchannel, std::size_t nsection);
1048
1050
1056 void SetIsFitted( std::size_t nchannel, std::size_t nsection,
1057 const Vector_double& bestFitP_, stfnum::storedFunc* fitFunc_,
1058 double chisqr, std::size_t fitBeg_, std::size_t fitEnd_ );
1059
1060
1062
1064 void SetIsIntegrated(std::size_t nchannel, std::size_t nsection, bool value,
1065 std::size_t begin, std::size_t end, const Vector_double& quad_p_);
1066
1068 void ClearEvents(std::size_t nchannel, std::size_t nsection);
1069
1070 void correctRangeR(int& value);
1071 void correctRangeR(std::size_t& value);
1072 bool LoadTDMS(const std::string& filename, Recording& ReturnData);
1073
1074 // calculates the Raw Detection Trace d(t) = d(t-1) + y(t) - 2 y(t-10) + y(t-20)
1075 std::vector<double> CalcRawDetectionTrace(std::size_t filterOrder, std::size_t startPoint, std::size_t endPoint);
1076 std::vector<int> CalcScoringTrace(std::vector<Annotation> expertAnnotations, std::size_t startPoint, std::size_t endPoint);
1077 double CalcAreaUnderCurve(std::vector<double> d, std::vector<int> c);
1078 std::pair<std::size_t, double> CalcMaxKappa(std::vector<double> &sortedRawDetectionTrace, std::vector<int> &sortedScoringTrace);
1079 std::vector<double> SortScoringTraceByRawDetection(std::vector<double> &rawDetectionTrace, std::vector<int> &scoringTrace);
1080 std::vector<stf::Event> DetectEvents(double threshold_, std::vector<double> &rawDetectionTrace);
1081 void OnCalculatedThresholdExpertDetectEvents(double threshold, std::size_t filterOrder);
1082
1083 DECLARE_EVENT_TABLE()
1084
1085};
1086
1088
1089#endif
1090
WORD TSTime TpMarker WORD size
Definition Son.h:337
A Channel contains several data Sections representing observations of the same physical quantity.
Definition channel.h:34
Handles x-scaling of traces.
Definition zoom.h:48
Handles y-scaling of traces.
Definition zoom.h:25
A table used for printing information.
Definition stfnum.h:152
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
Definition core.h:55
const Section & cursec() const
Retrieves the currently accessed section in the active channel (read-only)
Definition recording.h:174
Recording()
Default constuctor.
direction
The direction of peak calculations.
Definition stfnum.h:530
latency_mode
Latency cursor settings.
Definition stf.h:387
baseline_method
Methods for Baseline computation.
Definition stfnum.h:538
extraction_mode
Deconvolution.
Definition stf.h:424
latency_window_mode
Latency window settings.
Definition stf.h:397
double GetSlopeRatio() const
Retrieves ratio of the maximal slopes during the rising and decaying phase.
Definition doc.h:604
double GetHalfDuration() const
Retrieves the full width at half-maximal amplitude ("half duration").
Definition doc.h:598
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).
Definition doc.h:761
void SetFromBase(bool frombase)
Sets the reference for AP kinetics measurements.
Definition doc.h:923
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.
Definition doc.h:517
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.
Definition doc.h:430
std::pair< std::size_t, double > CalcMaxKappa(std::vector< double > &sortedRawDetectionTrace, std::vector< int > &sortedScoringTrace)
double GetOuterRiseTime() const
Retrieves the outer rise time.
Definition doc.h:593
void SetViewRD(bool value)
Determines whether the ratio of the maximal slopes during rise and decay should be shown in the resul...
Definition doc.h:983
virtual bool OnNewDocument()
Override default file creation.
double GetAPMaxT() const
Retrieves the time point of the peak in the second channel.
Definition doc.h:500
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.
Definition doc.h:572
bool GetViewT50() const
Indicates whether the half duration should be shown in the results table.
Definition doc.h:709
void SetViewPeakZero(bool value)
Determines whether the peak value (measured from zero) should be shown in the results table.
Definition doc.h:948
bool GetViewPeakZero() const
Indicates whether the peak value (measured from zero) should be shown in the results table.
Definition doc.h:679
std::size_t GetPeakBeg() const
Retrieves the position of the left peak cursor.
Definition doc.h:360
YZoom & GetYZoomW(int ch)
Returns the current zoom settings for this channel (read & write).
Definition doc.h:766
void Measure()
Measure everything using functions defined in measlib.h.
bool GetIsAverage() const
Indicates whether an average has been created.
Definition doc.h:181
stf::latency_mode GetLatencyEndMode() const
Retrieves the mode of the latency end cursor.
Definition doc.h:626
double GetInnerLoRT() const
Retrieves the time point at which Lo% of the maximal amplitude have been reached.
Definition doc.h:436
bool GetViewThreshold() const
Indicates whether the threshold should be shown in the results table.
Definition doc.h:674
void SetViewOuterRiseTime(bool value)
Determines whether the outer rise time should be shown in the results table.
Definition doc.h:973
void SetViewRTLoHi(bool value)
Determines whether the Lo to Hi% rise time should be shown in the results table.
Definition doc.h:963
bool IsInitialized() const
Indicates whether the the document is fully initialised.
Definition doc.h:199
void SetLatencyEndMode(stf::latency_mode value)
Sets the mode of the latency end cursor.
Definition doc.h:889
void SetViewThreshold(bool value)
Determines whether the threshold should be shown in the results table.
Definition doc.h:943
void OnExportAnnotations(wxCommandEvent &WXUNUSED(event))
Export all annotations of current doc.
const XZoom & GetXZoom()
Returns the current zoom settings for this channel (read-only).
Definition doc.h:751
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.
Definition doc.h:694
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.
Definition doc.h:191
void Selectall(wxCommandEvent &event)
Selects all sections.
double GetInnerHiRT() const
Retrieves the time point at which Hi% of the maximal amplitude have been reached.
Definition doc.h:442
std::size_t GetBaseBeg() const
Retrieves the position of the left baseline cursor.
Definition doc.h:350
void SetViewPeakThreshold(bool value)
Determines whether the peak value (measured from threshold) should be shown in the results table.
Definition doc.h:958
bool GetViewPeakThreshold() const
Indicates whether the peak value (measured from threshold) should be shown in the results table.
Definition doc.h:689
std::size_t GetBaseEnd() const
Retrieves the position of the right baseline cursor.
Definition doc.h:355
double GetOuterHiRT() const
Retrieves the time point at which Hi% of the maximal amplitude have been reached.
Definition doc.h:454
XZoom & GetXZoomW()
Returns the current zoom settings for this channel (read & write).
Definition doc.h:756
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.
Definition doc.h:968
void SetLatency(double value)
Sets the latency.
Definition doc.h:835
const Recording & GetAverage() const
Retrieves the average trace(s).
Definition doc.h:214
void SetViewBaseSD(bool value)
Determines whether the baseline's standard deviation should be shown in the results table.
Definition doc.h:938
bool GetViewPeakBase() const
Indicates whether the peak value (measured from baseline) should be shown in the results table.
Definition doc.h:684
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.
Definition doc.h:375
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.
Definition doc.h:365
void SetSlopeForThreshold(double value)
Sets the slope where the baseline should be set.
Definition doc.h:1015
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.
Definition doc.h:928
bool GetStartFitAtPeak() const
Indicates whether the left decay cursor should always be at the peak of the trace.
Definition doc.h:186
void correctRangeR(std::size_t &value)
bool GetFromBase() const
Indicates whether to use the baseline as a reference for AP kinetics.
Definition doc.h:654
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.
Definition doc.h:413
double GetPeakTime() const
Retrieves the peak time value.
Definition doc.h:547
double GetSlopeForThreshold() const
Returns the slope for threshold detection.
Definition doc.h:746
std::vector< int > CalcScoringTrace(std::vector< Annotation > expertAnnotations, std::size_t startPoint, std::size_t endPoint)
double GetLatency() const
Retrieves the latency.
Definition doc.h:418
double GetBaseSD() const
Retrieves the standard deviation of the baseline.
Definition doc.h:562
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.
Definition doc.h:522
bool GetViewRD() const
Indicates whether the ratio of the maximal slopes during rise and decay should be shown in the result...
Definition doc.h:714
bool GetViewSlopeRise() const
Indicates whether the maximal slope during the rising phase should be shown in the results table.
Definition doc.h:719
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.
Definition doc.h:724
void SetMeasRuler(bool value)
Sets whether the measurement cursor (crosshair) should be visible.
Definition doc.h:776
bool GetViewCursors() const
Indicates whether two additional rows showing the positions of start and end cursors should be shown ...
Definition doc.h:741
double GetThreshold() const
Retrieves the value at which the threshold slope is crossed.
Definition doc.h:567
double GetLatencyBeg() const
Retrieves the position of the left latency cursor.
Definition doc.h:406
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.
Definition doc.h:578
bool GetViewBaseline() const
Indicates whether the baseline value should be shown in the results table.
Definition doc.h:664
bool GetViewBaseSD() const
Indicates whether the baseline's standard deviation should be shown in the results table.
Definition doc.h:669
bool GetViewInnerRiseTime() const
Indicates whether the inner rise time should be shown in the results table.
Definition doc.h:699
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.
Definition doc.h:392
bool GetViewCrosshair() const
Indicates whether the measurement cursor (crosshair) value should be shown in the results table.
Definition doc.h:659
double GetMaxDecay() const
Retrieves the maximal slope of the decaying phase.
Definition doc.h:487
double GetAPT0Real() const
Retrieves the extrapolated onset time point of an event in the reference channel.
Definition doc.h:512
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.
Definition doc.h:448
void SetViewCursors(bool value)
Determines whether two additional rows showing the positions of start and end cursors should be shown...
Definition doc.h:1010
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.
Definition doc.h:325
stf::latency_window_mode GetLatencyWindowMode() const
Retrieves the mode of the latency window.
Definition doc.h:631
void OnCalculatedThresholdExpertDetectEvents(double threshold, std::size_t filterOrder)
bool GetViewLatency() const
Indicates whether the latency should be shown in the results table.
Definition doc.h:729
double GetAPT50LeftReal() const
Retrieves the time point at which 50% of the max. amplitude have been reached from the left of the pe...
Definition doc.h:506
stf::latency_mode GetLatencyStartMode() const
Retrieves the mode of the latency start cursor.
Definition doc.h:621
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.
Definition doc.h:884
void SetViewSlopeRise(bool value)
Determines whether the maximal slope during the rising phase should be shown in the results table.
Definition doc.h:988
void SetStartFitAtPeak(bool value)
Sets the left decay cursor to the peak of the trace.
Definition doc.h:209
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.
Definition doc.h:918
double GetTLoReal() const
Retrieves the time point at which Lo% of the maximal amplitude have been reached.
Definition doc.h:424
std::size_t GetMeasCursor() const
Retrieves the position of the measurement cursor (crosshair).
Definition doc.h:340
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.
Definition doc.h:477
stfnum::baseline_method GetBaselineMethod() const
Retrieves the computation mode for baseline.
Definition doc.h:345
double GetRTLoHi() const
Retrieves the Lo to Hi% rise time.
Definition doc.h:583
double GetT0Real() const
Retrieves the extrapolated onset time point of an event in the active channel.
Definition doc.h:460
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.
Definition doc.h:933
void SetLatencyEnd(double value)
Sets the position of the right latency cursor.
double GetPeak() const
Retrieves the peak value.
Definition doc.h:542
void SetLatencyEndMode(int value)
Sets the mode of the latency end cursor.
double GetInnerRiseTime() const
Retrieves the inner rise time.
Definition doc.h:588
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.
Definition doc.h:204
double GetT50RightReal() const
Retrieves the time point at which 50% of the maximal amplitude have been reached from the right of th...
Definition doc.h:472
stfnum::direction GetDirection() const
Retrieves the direction of peak calculations.
Definition doc.h:636
void SetLatencyWindowMode(stf::latency_window_mode value)
Sets the mode of the latency end cursor.
Definition doc.h:896
void SetViewSlopeDecay(bool value)
Determines whether the maximal slope during the decaying phase should be shown in the results table.
Definition doc.h:993
void Extract(wxCommandEvent &event)
Creates a new document from the checked events.
wxStfDoc()
Constructor.
void SetPM(int value)
Sets the number of points used for averaging during peak calculation.
Definition doc.h:873
void SetViewT50(bool value)
Determines whether the half duration should be shown in the results table.
Definition doc.h:978
void correctRangeR(int &value)
double GetMaxDecayT() const
Retrieves the time point of the maximal slope during the decaying phase.
Definition doc.h:527
double GetMaxDecayY() const
Retrieves the y-value at the time point of the maximal slope during the decaying phase.
Definition doc.h:532
std::size_t GetFitBeg() const
Retrieves the position of the left fitting cursor.
Definition doc.h:370
double GetMaxRise() const
Retrieves the maximal slope of the rising phase.
Definition doc.h:482
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.
Definition doc.h:953
double GetAPBase() const
Retrieves the baseline in the second channel.
Definition doc.h:557
bool GetViewOuterRiseTime() const
Indicates whether the outer rise time should be shown in the results table.
Definition doc.h:704
void Deleteselected(wxCommandEvent &event)
Unselects all sections.
void SetBaselineMethod(stfnum::baseline_method value)
Sets the method to compute the baseline.
Definition doc.h:786
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.
Definition doc.h:998
double GetAPMaxRiseT() const
Retrieves the time point of the maximal slope of the rising phase in the second channel.
Definition doc.h:494
~wxStfDoc()
Destructor.
double GetT50LeftReal() const
Retrieves the time point at which 50% of the maximal amplitude have been reached from the left of the...
Definition doc.h:466
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.
Definition doc.h:781
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.
Definition doc.h:609
void CreateAverage(bool calcSD, bool align)
Creates an average trace from the selected sections.
double GetBase() const
Retrieves the baseline.
Definition doc.h:552
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.
Definition stf.h:55
Function used for least-squares fitting.
Definition stfnum.h:270