4 %> @image html Screenshot-uip_peakdetector.png
6 %> <p><b>Minimum peak altitude</b> - Minimum distance between the zero line and the peak top. See
peakdetector::minaltitude</p>
7 %> <p><b>Minimum peak height</b> - Minimum distance between the highest mountain foot (left or right) and the peak top. See
peakdetector::minheight</p>
8 %> <p><b>Altitude and height are given
as fractions</b> -
if checked, the two above options will be used to multiply the
9 %> maximum value of the curve to
get the actual minima expressed in the same units
as the curve;
if not checked, it will
10 %> be assumed that the two parameters above are already expressed in the same units
as the curve. See
peakdetector::flag_perc</p>
11 %> <p><b>Minimum horizontal distance between two adjacent peaks (in points)</b>. Prevents detecting peaks that are too close to each other. See
peakdetector::mindist</p>
12 %> <p><b>Maximum number of peaks</b> -
if specified (i.e.,
if > 0), peaks will be sorted in descending order of altitude
14 %> <p><b>Use absolute value of curve</b> -
if checked, the absolute value of the curve will be taken before peak
15 %> detection. If not checked, negative parts of the signal are made into
"lakes", i.e., replaced by zeroes. See
peakdetector::flag_abs</p>
20 function varargout = uip_peakdetector(varargin)
21 % Last Modified by GUIDE v2.5 12-Jul-2012 19:31:26
23 % Begin initialization code - DO NOT EDIT
25 gui_State =
struct(
'gui_Name', mfilename, ...
26 'gui_Singleton', gui_Singleton, ...
27 'gui_OpeningFcn', @uip_peakdetector_OpeningFcn, ...
28 'gui_OutputFcn', @uip_peakdetector_OutputFcn, ...
29 'gui_LayoutFcn', [] , ...
31 if nargin && ischar(varargin{1})
32 gui_State.gui_Callback = str2func(varargin{1});
36 [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
38 gui_mainfcn(gui_State, varargin{:});
40 % End initialization code - DO NOT EDIT
43 % --- Executes just before uip_peakdetector is made visible.
44 function uip_peakdetector_OpeningFcn(hObject, eventdata, handles, varargin)
45 handles.output.flag_ok = 0;
46 guidata(hObject, handles);
49 % --- Outputs from this function are returned to the command clae.
50 function varargout = uip_peakdetector_OutputFcn(hObject, eventdata, handles)
52 uiwait(handles.figure1);
53 handles = guidata(hObject);
54 varargout{1} = handles.output;
59 varargout{1} = output;
62 function editReg_Callback(hObject, eventdata, handles)
64 % --- Executes during
object creation, after setting all properties.
65 function editReg_CreateFcn(hObject, eventdata, handles)
66 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
67 set(hObject,'BackgroundColor','white');
70 % --- Executes on button press in pushbuttonOk.
71 function pushbuttonOk_Callback(hObject, eventdata, handles) %
#ok<*INUSL>
73 handles.output.params = {...
74 'flag_perc', int2str(
get(handles.checkbox_flag_perc,
'Value')), ...
75 'flag_abs', int2str(
get(handles.checkbox_flag_abs,
'Value')), ...
76 'minaltitude', num2str(eval(
get(handles.edit_minaltitude,
'String'))), ...
77 'minheight', num2str(eval(
get(handles.edit_minheight,
'String'))), ...
78 'mindist_units', num2str(eval(
get(handles.edit_mindist_units,
'String'))), ...
79 'no_max', num2str(eval(
get(handles.edit_no_max,
'String'))) ...
81 handles.output.flag_ok = 1;
82 guidata(hObject, handles);
89 % --- Executes on button press in checkbox_flag_group.
90 function checkbox_flag_group_Callback(hObject, eventdata, handles) %#ok<*INUSD,*DEFNU>
92 % --- Executes on button press in checkbox_flag_perclass.
93 function checkbox_flag_perclass_Callback(hObject, eventdata, handles)
95 function edit_randomseed_Callback(hObject, eventdata, handles)
97 % --- Executes during
object creation, after setting all properties.
98 function edit_randomseed_CreateFcn(hObject, eventdata, handles)
99 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
100 set(hObject,'BackgroundColor','white');
103 % --- Executes on button press in checkbox_flag_perc.
104 function checkbox_flag_perc_Callback(hObject, eventdata, handles)
106 function edit_no_reps_Callback(hObject, eventdata, handles)
108 % --- Executes during
object creation, after setting all properties.
109 function edit_no_reps_CreateFcn(hObject, eventdata, handles)
110 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
111 set(hObject,'BackgroundColor','white');
114 function edit_minaltitude_Callback(hObject, eventdata, handles)
116 % --- Executes during
object creation, after setting all properties.
117 function edit_minaltitude_CreateFcn(hObject, eventdata, handles)
118 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
119 set(hObject,'BackgroundColor','white');
122 function edit_minheight_Callback(hObject, eventdata, handles)
124 % --- Executes during
object creation, after setting all properties.
125 function edit_minheight_CreateFcn(hObject, eventdata, handles)
126 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
127 set(hObject,'BackgroundColor','white');
131 % --- Executes on button press in checkbox_flag_abs.
132 function checkbox_flag_abs_Callback(hObject, eventdata, handles)
135 function edit_mindist_units_Callback(hObject, eventdata, handles)
137 % --- Executes during
object creation, after setting all properties.
138 function edit_mindist_units_CreateFcn(hObject, eventdata, handles)
139 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
140 set(hObject,'BackgroundColor','white');
145 function edit_no_max_Callback(hObject, eventdata, handles)
147 % --- Executes during
object creation, after setting all properties.
148 function edit_no_max_CreateFcn(hObject, eventdata, handles)
149 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
150 set(hObject,'BackgroundColor','white');
Property mindist
Minimum distance between peaks, expressed in number of points.
Property minheight
=0. Minimum vertical distance between peak and closest trough
function gui_set_position(in hObject)
Property no_max
=Inf. Maximum number of peaks to be returned. If used, peak are returned in ranked order of height...
Analysis Session (AS) base class.
function irerrordlg(in errorstring, in dlgname)
Property minaltitude
=0. Minimum vertical distance between peak and zero