Home > data-vis > gui_correlation_plots > gui_correlation_plots.m

gui_correlation_plots

PURPOSE ^

File Name: gui_correlation_plots.m

SYNOPSIS ^

function varargout = gui_correlation_plots(varargin)

DESCRIPTION ^

 File Name: gui_correlation_plots.m
 Created By: Jared Wentz, jjwentz@indiana.edu

 -------------------------------------------------------------------------

 This function creates a GUI that allows the user to generate correlation
 plots between existing events, and custom .csv files. 

 -------------------------------------------------------------------------
 To run the GUI, type the following into the command line:

 >> gui_correlation_plots

 -------------------------------------------------------------------------

 Program flow:
 1. User enters experiment/subject ID's, keyword, and/or args
 2. Calls list_variables on the experiment/subject ID's and keyword and 
    displays events in the event listbox
 3. Displays all .csv files in the multilong_metadata folder in listbox 
    below
 4. User selects events and places them in the y-axis listbox
    and/or the x-axis listbox, and selects the event variables. User can
    also enter their own custom .csv file and the corresponding column 
    numbers in the indicated text boxes.
 5. Plot button pulls data for each event in y-axis and x-axis listbox and 
    organizes it into a cell array
 6. gui_plot GUI is called to display correlation plots of the data 
    contained in the cell array

 -------------------------------------------------------------------------
 
 This function calls:
   list_subjects
   list_variables
   get_age_at_exp
   subjects
   get_chunks_v2
   get_data_type
   gui_plot
   get_csv_data_v2
   
 -------------------------------------------------------------------------

 Hard-coded Variables

   fileColumns - global hashmap that keeps track of column numbers for 
   each file

   fileData - global hashmap that stores .csv file data for each file

   fileHeaders - global hashmap that stores .csv file headers

   multiworkDir - multiwork metadata directory

   multiworkSubjects - array of subjects from experiments 70-73; must 
   be updated manually to include future experiments

   data - n x 3 cell array of event data where n is the # of x-axis; 1st
   column is x-axis data, 2nd column is y-axis data, 3rd is subjects
   
   events - # of y-axis events

   xaxis - cell array containing x-axis labels

   yaxis - cell array containing y-axis labels

 -------------------------------------------------------------------------

 Description of GUI Handles

   SubjectID - Edit Text that allows user to refine search based on 
   experiment and/or subject ID 
   -- e.g. 34,43
   
   DataType - Edit Text that allows user to refine search based on a
   based on a keyword 
   -- e.g. cevent 
   
   EnterArgs - Edit Text that allows user to refine search based on 
   arguments for get_chunks_v2
   -- e.g. cevent_name, cevent_eye_roi_child, cevent_values, [1 2 3]
               
   EventList - Listbox that displays the events based on input from
   SubjectID and DataType

   multilongCSVFiles - Listbox that displays the events for experiments 
   70-73 from the multilong metadata folder

   CSV_EnterFile - Edit Text that allows user to enter properly formated 
   .csv file; must contain full file path
   -- e.g. /scratch/sbf/test.csv
   
   ColumnValues - Edit Text that allows user to specify the column numbers 
   of the .csv file they want to analyze
   -- e.g. 2,3 would add the 2nd and 3rd column data to 
   -- NOTE: User can enter .csv file name in CSV_EnterFile, then tab to
      ColumnValues and enter column numbers, then press enter to add
      events to multilongCSVFiles. They can also enter .csv file name and
      press enter, then select the file in multilongCSVFiles and enter the
      column numbers. 

   YAxisEvents - Listbox that displays the selected y-axis events

   XAxisEvents - Listbox that displays the selected x-axis events
      
   x/y_btn - Push Buttons that add events from EventList to X/YAxisEvents

   csv_x/y_btn - Push Buttons that add events from multilongCSVFiles to
   X/YAxisEvents

   y_event_prop - Radio Button that allows user to select event measure
   they want to analyze

   y_event_custom - Edit Text that allows user to enter valid event
   measure

   Generate - Push Button that displays data in EventList and
   multilongCSVFiles; not visible 

   remove_btn
   clear_btn
   plot_btn - Push Button that calls gui_plot
   exit_btn

 -------------------------------------------------------------------------

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 % File Name: gui_correlation_plots.m
0002 % Created By: Jared Wentz, jjwentz@indiana.edu
0003 %
0004 % -------------------------------------------------------------------------
0005 %
0006 % This function creates a GUI that allows the user to generate correlation
0007 % plots between existing events, and custom .csv files.
0008 %
0009 % -------------------------------------------------------------------------
0010 % To run the GUI, type the following into the command line:
0011 %
0012 % >> gui_correlation_plots
0013 %
0014 % -------------------------------------------------------------------------
0015 %
0016 % Program flow:
0017 % 1. User enters experiment/subject ID's, keyword, and/or args
0018 % 2. Calls list_variables on the experiment/subject ID's and keyword and
0019 %    displays events in the event listbox
0020 % 3. Displays all .csv files in the multilong_metadata folder in listbox
0021 %    below
0022 % 4. User selects events and places them in the y-axis listbox
0023 %    and/or the x-axis listbox, and selects the event variables. User can
0024 %    also enter their own custom .csv file and the corresponding column
0025 %    numbers in the indicated text boxes.
0026 % 5. Plot button pulls data for each event in y-axis and x-axis listbox and
0027 %    organizes it into a cell array
0028 % 6. gui_plot GUI is called to display correlation plots of the data
0029 %    contained in the cell array
0030 %
0031 % -------------------------------------------------------------------------
0032 %
0033 % This function calls:
0034 %   list_subjects
0035 %   list_variables
0036 %   get_age_at_exp
0037 %   subjects
0038 %   get_chunks_v2
0039 %   get_data_type
0040 %   gui_plot
0041 %   get_csv_data_v2
0042 %
0043 % -------------------------------------------------------------------------
0044 %
0045 % Hard-coded Variables
0046 %
0047 %   fileColumns - global hashmap that keeps track of column numbers for
0048 %   each file
0049 %
0050 %   fileData - global hashmap that stores .csv file data for each file
0051 %
0052 %   fileHeaders - global hashmap that stores .csv file headers
0053 %
0054 %   multiworkDir - multiwork metadata directory
0055 %
0056 %   multiworkSubjects - array of subjects from experiments 70-73; must
0057 %   be updated manually to include future experiments
0058 %
0059 %   data - n x 3 cell array of event data where n is the # of x-axis; 1st
0060 %   column is x-axis data, 2nd column is y-axis data, 3rd is subjects
0061 %
0062 %   events - # of y-axis events
0063 %
0064 %   xaxis - cell array containing x-axis labels
0065 %
0066 %   yaxis - cell array containing y-axis labels
0067 %
0068 % -------------------------------------------------------------------------
0069 %
0070 % Description of GUI Handles
0071 %
0072 %   SubjectID - Edit Text that allows user to refine search based on
0073 %   experiment and/or subject ID
0074 %   -- e.g. 34,43
0075 %
0076 %   DataType - Edit Text that allows user to refine search based on a
0077 %   based on a keyword
0078 %   -- e.g. cevent
0079 %
0080 %   EnterArgs - Edit Text that allows user to refine search based on
0081 %   arguments for get_chunks_v2
0082 %   -- e.g. cevent_name, cevent_eye_roi_child, cevent_values, [1 2 3]
0083 %
0084 %   EventList - Listbox that displays the events based on input from
0085 %   SubjectID and DataType
0086 %
0087 %   multilongCSVFiles - Listbox that displays the events for experiments
0088 %   70-73 from the multilong metadata folder
0089 %
0090 %   CSV_EnterFile - Edit Text that allows user to enter properly formated
0091 %   .csv file; must contain full file path
0092 %   -- e.g. /scratch/sbf/test.csv
0093 %
0094 %   ColumnValues - Edit Text that allows user to specify the column numbers
0095 %   of the .csv file they want to analyze
0096 %   -- e.g. 2,3 would add the 2nd and 3rd column data to
0097 %   -- NOTE: User can enter .csv file name in CSV_EnterFile, then tab to
0098 %      ColumnValues and enter column numbers, then press enter to add
0099 %      events to multilongCSVFiles. They can also enter .csv file name and
0100 %      press enter, then select the file in multilongCSVFiles and enter the
0101 %      column numbers.
0102 %
0103 %   YAxisEvents - Listbox that displays the selected y-axis events
0104 %
0105 %   XAxisEvents - Listbox that displays the selected x-axis events
0106 %
0107 %   x/y_btn - Push Buttons that add events from EventList to X/YAxisEvents
0108 %
0109 %   csv_x/y_btn - Push Buttons that add events from multilongCSVFiles to
0110 %   X/YAxisEvents
0111 %
0112 %   y_event_prop - Radio Button that allows user to select event measure
0113 %   they want to analyze
0114 %
0115 %   y_event_custom - Edit Text that allows user to enter valid event
0116 %   measure
0117 %
0118 %   Generate - Push Button that displays data in EventList and
0119 %   multilongCSVFiles; not visible
0120 %
0121 %   remove_btn
0122 %   clear_btn
0123 %   plot_btn - Push Button that calls gui_plot
0124 %   exit_btn
0125 %
0126 % -------------------------------------------------------------------------
0127 
0128 function varargout = gui_correlation_plots(varargin)
0129 % GUI_CORRELATION_PLOTS MATLAB code for gui_correlation_plots.fig
0130 %      GUI_CORRELATION_PLOTS, by itself, creates a new GUI_CORRELATION_PLOTS or raises the existing
0131 %      singleton*.
0132 %
0133 %      H = GUI_CORRELATION_PLOTS returns the handle to a new GUI_CORRELATION_PLOTS or the handle to
0134 %      the existing singleton*.
0135 %
0136 %      GUI_CORRELATION_PLOTS('CALLBACK',hObject,eventData,handles,...) calls the local
0137 %      function named CALLBACK in GUI_CORRELATION_PLOTS.M with the given input arguments.
0138 %
0139 %      GUI_CORRELATION_PLOTS('Property','Value',...) creates a new GUI_CORRELATION_PLOTS or raises the
0140 %      existing singleton*.  Starting from the left, property value pairs are
0141 %      applied to the GUI before gui_correlation_plots_OpeningFcn gets called.  An
0142 %      unrecognized property name or invalid value makes property application
0143 %      stop.  All inputs are passed to gui_correlation_plots_OpeningFcn via varargin.
0144 %
0145 %      *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one
0146 %      instance to run (singleton)".
0147 %
0148 % See also: GUIDE, GUIDATA, GUIHANDLES
0149 
0150 % Edit the above text to modify the response to help gui_correlation_plots
0151 
0152 % Last Modified by GUIDE v2.5 04-May-2015 20:43:45
0153 
0154 % Begin initialization code - DO NOT EDIT
0155 gui_Singleton = 1;
0156 gui_State = struct('gui_Name',       mfilename, ...
0157                    'gui_Singleton',  gui_Singleton, ...
0158                    'gui_OpeningFcn', @gui_correlation_plots_OpeningFcn, ...
0159                    'gui_OutputFcn',  @gui_correlation_plots_OutputFcn, ...
0160                    'gui_LayoutFcn',  [] , ...
0161                    'gui_Callback',   []);
0162 if nargin && ischar(varargin{1})
0163     gui_State.gui_Callback = str2func(varargin{1});
0164 end
0165 
0166 if nargout
0167     [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
0168 else
0169     gui_mainfcn(gui_State, varargin{:});
0170 end
0171 % End initialization code - DO NOT EDIT
0172 
0173 
0174 % --- Executes just before gui_correlation_plots is made visible.
0175 function gui_correlation_plots_OpeningFcn(hObject, eventdata, handles, varargin)
0176 % This function has no output args, see OutputFcn.
0177 % hObject    handle to figure
0178 % eventdata  reserved - to be defined in a future version of MATLAB
0179 % handles    structure with handles and user data (see GUIDATA)
0180 % varargin   command line arguments to gui_correlation_plots (see VARARGIN)
0181 
0182 % Choose default command line output for gui_correlation_plots
0183 handles.output = hObject;
0184 
0185 if ~isempty(varargin)
0186     handles.exit_on_close = varargin{1};
0187 end
0188 
0189 % pull subjects from multiwork experiments
0190 global multiworkSubjects;
0191 a = list_subjects(70);
0192 b = list_subjects(71);
0193 c = list_subjects(72);
0194 d = list_subjects(73);
0195 multiworkSubjects = [a;b;c;d];
0196 
0197 % Update handles structure
0198 guidata(hObject, handles);
0199 
0200 % UIWAIT makes gui_correlation_plots wait for user response (see UIRESUME)
0201 % uiwait(handles.figure1);
0202 uicontrol(handles.SubjectID);
0203 
0204 
0205 % --- Outputs from this function are returned to the command line.
0206 function varargout = gui_correlation_plots_OutputFcn(hObject, eventdata, handles) 
0207 % varargout  cell array for returning output args (see VARARGOUT);
0208 % hObject    handle to figure
0209 % eventdata  reserved - to be defined in a future version of MATLAB
0210 % handles    structure with handles and user data (see GUIDATA)
0211 
0212 % Get default command line output from handles structure
0213 varargout{1} = handles.output;
0214 
0215 
0216 % --- Executes on button press in Generate.
0217 function Generate_Callback(hObject, eventdata, handles)
0218 % hObject    handle to Generate (see GCBO)
0219 % eventdata  reserved - to be defined in a future version of MATLAB
0220 % handles    structure with handles and user data (see GUIDATA)
0221 global fileColumns
0222 global fileData
0223 global fileHeaders
0224 
0225 fileColumns = containers.Map;
0226 fileData = containers.Map;
0227 fileHeaders = containers.Map;
0228 
0229 subjectIDS = get(handles.SubjectID, 'String'); 
0230 keyword = get(handles.DataType, 'String');
0231 set(handles.multilongCSVFiles,'Value',1);
0232 set(handles.multilongCSVFiles,'String','');
0233 set(handles.EventList,'Value',1);
0234 set(handles.EventList,'String','');
0235 
0236 subjectIDS = str2num(subjectIDS);
0237 
0238 try
0239     events = list_variables(subjectIDS,keyword);
0240     set(handles.EventList,'string',events);
0241     if isempty(events)
0242         h = msgbox('Event list is empty. Please recheck the subject ID list and/or the keyword');
0243     else
0244         multiworkDir = dir('/restore/multiwork/multilong_metadata/*.csv');
0245         csv_list = cell(length(multiworkDir),1);
0246         for i = 1:length(multiworkDir)
0247             csv_list{i} = multiworkDir(i).name;
0248         end
0249         set(handles.multilongCSVFiles,'string',csv_list);
0250     end
0251 catch ME
0252     h = msgbox(ME.message);
0253 end
0254 
0255 % --- Executes during object creation, after setting all properties.
0256 function edit1_CreateFcn(hObject, eventdata, handles)
0257 % hObject    handle to edit1 (see GCBO)
0258 % eventdata  reserved - to be defined in a future version of MATLAB
0259 % handles    empty - handles not created until after all CreateFcns called
0260 
0261 % Hint: edit controls usually have a white background on Windows.
0262 %       See ISPC and COMPUTER.
0263 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0264     set(hObject,'BackgroundColor','white');
0265 end
0266 
0267 
0268 % --- Executes during object creation, after setting all properties.
0269 function edit2_CreateFcn(hObject, eventdata, handles)
0270 % hObject    handle to edit2 (see GCBO)
0271 % eventdata  reserved - to be defined in a future version of MATLAB
0272 % handles    empty - handles not created until after all CreateFcns called
0273 
0274 % Hint: edit controls usually have a white background on Windows.
0275 %       See ISPC and COMPUTER.
0276 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0277     set(hObject,'BackgroundColor','white');
0278 end
0279 
0280 
0281 % --- Executes during object creation, after setting all properties.
0282 function EventList_CreateFcn(hObject, eventdata, handles)
0283 % hObject    handle to EventList (see GCBO)
0284 % eventdata  reserved - to be defined in a future version of MATLAB
0285 % handles    empty - handles not created until after all CreateFcns called
0286 
0287 % Hint: listbox controls usually have a white background on Windows.
0288 %       See ISPC and COMPUTER.
0289 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0290     set(hObject,'BackgroundColor','white');
0291 end
0292 
0293 
0294 function SubjectID_Callback(hObject, eventdata, handles)
0295 % hObject    handle to SubjectID (see GCBO)
0296 % eventdata  reserved - to be defined in a future version of MATLAB
0297 % handles    structure with handles and user data (see GUIDATA)
0298 
0299 % Hints: get(hObject,'String') returns contents of SubjectID as text
0300 %        str2double(get(hObject,'String')) returns contents of SubjectID as a double
0301 
0302 currChar = get(handles.figure1,'CurrentCharacter');
0303 if isequal(currChar,char(13)) %char(13) == enter key
0304    Generate_Callback(hObject, eventdata, handles);
0305 end
0306 
0307 % --- Executes during object creation, after setting all properties.
0308 function SubjectID_CreateFcn(hObject, eventdata, handles)
0309 % hObject    handle to SubjectID (see GCBO)
0310 % eventdata  reserved - to be defined in a future version of MATLAB
0311 % handles    empty - handles not created until after all CreateFcns called
0312 
0313 % Hint: edit controls usually have a white background on Windows.
0314 %       See ISPC and COMPUTER.
0315 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0316     set(hObject,'BackgroundColor','white');
0317 end
0318 
0319 
0320 function DataType_Callback(hObject, eventdata, handles)
0321 % hObject    handle to DataType (see GCBO)
0322 % eventdata  reserved - to be defined in a future version of MATLAB
0323 % handles    structure with handles and user data (see GUIDATA)
0324 
0325 % Hints: get(hObject,'String') returns contents of DataType as text
0326 %        str2double(get(hObject,'String')) returns contents of DataType as a double
0327 
0328 currChar = get(handles.figure1,'CurrentCharacter');
0329 if isequal(currChar,char(13)) %char(13) == enter key
0330    Generate_Callback(hObject, eventdata, handles);
0331 end
0332        
0333 
0334 % --- Executes during object creation, after setting all properties.
0335 function DataType_CreateFcn(hObject, eventdata, handles)
0336 % hObject    handle to DataType (see GCBO)
0337 % eventdata  reserved - to be defined in a future version of MATLAB
0338 % handles    empty - handles not created until after all CreateFcns called
0339 
0340 % Hint: edit controls usually have a white background on Windows.
0341 %       See ISPC and COMPUTER.
0342 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0343     set(hObject,'BackgroundColor','white');
0344 end
0345 
0346 
0347 % --- Executes on button press in exit_btn.
0348 function exit_btn_Callback(hObject, eventdata, handles)
0349 % hObject    handle to exit_btn (see GCBO)
0350 % eventdata  reserved - to be defined in a future version of MATLAB
0351 % handles    structure with handles and user data (see GUIDATA)
0352 figure1_CloseRequestFcn(hObject, eventdata, handles);
0353 
0354 % --- Executes on button press in clear_btn.
0355 function clear_btn_Callback(hObject, eventdata, handles)
0356 % hObject    handle to clear_btn (see GCBO)
0357 % eventdata  reserved - to be defined in a future version of MATLAB
0358 % handles    structure with handles and user data (see GUIDATA)
0359 set(handles.SubjectID,'String','');
0360 set(handles.DataType,'String','');
0361 set(handles.EnterArgs,'String','');
0362 set(handles.YAxisEvents,'String', '');
0363 set(handles.XAxisEvents,'String', '');
0364 set(handles.EventList,'Value',1);
0365 set(handles.EventList,'String','');
0366 set(handles.y_event_age,'Value',1);
0367 set(handles.x_event_age,'Value',1);
0368 set(handles.multilongCSVFiles,'Value',1);
0369 set(handles.y_cont_mean,'Value',1);
0370 set(handles.x_cont_mean,'Value',1);
0371 set(handles.multilongCSVFiles,'String','');
0372 set(handles.CSV_EnterFile,'String','');
0373 set(handles.ColumnValues,'String','');
0374 set(handles.x_event_custom,'String','');
0375 set(handles.y_event_custom,'String','');
0376 set(handles.x_cont_custom,'String','');
0377 set(handles.y_cont_custom,'String','');
0378 
0379 
0380 % --- Executes on button press in remove_btn.
0381 function remove_btn_Callback(hObject, eventdata, handles)
0382 % hObject    handle to remove_btn (see GCBO)
0383 % eventdata  reserved - to be defined in a future version of MATLAB
0384 % handles    structure with handles and user data (see GUIDATA)
0385 set(handles.YAxisEvents,'string','');
0386 set(handles.XAxisEvents,'string','');
0387 set(handles.y_event_age,'Value',1);
0388 set(handles.x_event_age,'Value',1);
0389 set(handles.y_cont_mean,'Value',1);
0390 set(handles.x_cont_mean,'Value',1);
0391 set(handles.x_event_custom,'String','');
0392 set(handles.y_event_custom,'String','');
0393 set(handles.x_cont_custom,'String','');
0394 set(handles.y_cont_custom,'String','');
0395 
0396 % --- Executes during object creation, after setting all properties.
0397 function YAxisEvents_CreateFcn(hObject, eventdata, handles)
0398 % hObject    handle to YAxisEvents (see GCBO)
0399 % eventdata  reserved - to be defined in a future version of MATLAB
0400 % handles    empty - handles not created until after all CreateFcns called
0401 
0402 % Hint: listbox controls usually have a white background on Windows.
0403 %       See ISPC and COMPUTER.
0404 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0405     set(hObject,'BackgroundColor','white');
0406 end
0407 
0408 
0409 % --- Executes on button press in plot_btn.
0410 function plot_btn_Callback(hObject, eventdata, handles)
0411 % hObject    handle to plot_btn (see GCBO)
0412 % eventdata  reserved - to be defined in a future version of MATLAB
0413 % handles    structure with handles and user data (see GUIDATA)
0414 
0415 global fileColumns;
0416 global fileData;
0417 global fileHeaders;
0418 
0419 h = msgbox('Generating correlation plots...');
0420 edithandle = findobj(h,'Style','pushbutton');
0421 delete(edithandle);
0422 
0423 args = struct();
0424 arguments = get(handles.EnterArgs,'String');
0425 if ~isempty(arguments)
0426     
0427     arguments = strtrim(arguments);
0428     arguments = strsplit(arguments,',');
0429     arguments = arrayfun(@(a) strtrim(a),arguments);
0430     keys = arguments(1:2:end);
0431     vals = arguments(2:2:end);
0432     for i = 1:length(keys)
0433         if ~isempty(str2num(vals{i}))
0434             vals{i} = str2num(vals{i});
0435         end
0436         args.(keys{i}) = vals{i};
0437     end
0438 end
0439     
0440 indEvents = get(handles.YAxisEvents,'string');
0441 depEvents = get(handles.XAxisEvents,'string');
0442 subjectList = str2num(get(handles.SubjectID,'string'));
0443 subjects = [];
0444 
0445 % create array of all entered subjects
0446 for i = 1:length(subjectList)
0447     if length(num2str(subjectList(i))) > 2
0448         subjects = vertcat(subjects, subjectList(i));
0449     else
0450         subjects = vertcat(subjects, list_subjects(subjectList(i)));
0451     end
0452 end
0453 
0454 xlen = length(depEvents);
0455 if xlen == 0
0456     xlen = xlen + 1;
0457 end
0458 ylen = length(indEvents);
0459 if ylen == 0
0460     ylen = ylen + 1;
0461 end
0462 data = cell(ylen*xlen, 3);
0463 xaxis = cell(ylen*xlen,1);
0464 yaxis = cell(ylen*xlen,1);
0465 
0466 eventXMeasure = get(get(handles.dep_event_variable,'SelectedObject'),'string');
0467 if strcmp(eventXMeasure,'Custom:')
0468     eventXMeasure = get(handles.x_event_custom,'String');
0469 end
0470 eventYMeasure = get(get(handles.ind_event_variable,'SelectedObject'),'string');
0471 if strcmp(eventYMeasure,'Custom:')
0472     eventYMeasure = get(handles.y_event_custom,'String');
0473 end
0474 contXMeasure = get(get(handles.dep_cont_variable,'SelectedObject'),'string');
0475 if strcmp(contXMeasure,'Custom:')
0476     contXMeasure = get(handles.x_cont_custom,'String');
0477 end
0478 contYMeasure = get(get(handles.ind_cont_variable,'SelectedObject'),'string');
0479 if strcmp(contYMeasure,'Custom:')
0480     contYMeasure = get(handles.y_cont_custom,'String');
0481 end
0482 
0483 xdata = cell(xlen,3);
0484 ydata = cell(ylen,3); 
0485 
0486 for i = 1:xlen
0487     if strcmp(eventXMeasure,'age')
0488         [x, ~, p] = get_age_at_exp(subjects);
0489         xsub = subjects(p);
0490         xlabel = 'Age';
0491     else
0492         if isempty(strfind(depEvents{i},'.csv'))
0493             
0494             try
0495                 [~,b,c,~] = get_chunks_v2(depEvents{i},subjects,args);
0496                 if strcmp(get_data_type(depEvents{i}), 'cont')
0497                     measure = contXMeasure;
0498                 else
0499                     measure = eventXMeasure;
0500                 end
0501                 xsub = unique(b.sub_list);
0502                 logs = arrayfun(@(a) ismember(b.sub_list, a), xsub, 'un', 0);
0503                 xlabel = horzcat(depEvents{i},': ', measure);
0504                 xlabel = strrep(xlabel,'_','\_');
0505                 x = cellfun(@(a) nanmean(c{1}.(measure)(a,:), 1), logs, 'un', 0);
0506                 x = vertcat(x{:});
0507             catch ME
0508                 h = msgbox(ME.message);
0509                 break;
0510             end
0511         else
0512             try
0513                 f = depEvents{i};
0514                 % we know this file will be of the form column#_filename.csv
0515                 b = strsplit(f,'_');
0516                 csvData = fileData(char(b(2)));
0517                 col = fileColumns(f);
0518             
0519                 if isKey(fileHeaders,char(b(2)))
0520                     heads = fileHeaders(char(b(2)));
0521                     xlabel = strcat(char(b(2)), {' '}, strjoin(heads(:,col)'));
0522                     xlabel = strrep(xlabel, ' ', '-');
0523                 else
0524                     xlabel = strrep(f,'_','-');
0525                 end
0526             
0527                 csvData = help(csvData, col);
0528                 x = csvData(:,2);
0529                 xsub = csvData(:,1);
0530             catch ME
0531                 h = msgbox(ME.message);
0532             end
0533         end
0534     end
0535     xdata{i,1} = x;
0536     xdata{i,2} = xsub;
0537     xdata{i,3} = xlabel;
0538 end
0539 
0540 for j = 1:ylen
0541     if strcmp(eventYMeasure,'age')
0542         [y, ~, p] = get_age_at_exp(subjects);
0543         ysub = subjects(p);
0544         ylabel = 'Age';
0545     else
0546         if isempty(strfind(indEvents{j},'.csv'))
0547             try
0548                 if strcmp(get_data_type(indEvents{j}),'cont')
0549                     measure = contYMeasure;
0550                 else
0551                     measure = eventYMeasure;
0552                 end
0553                 [~,b,c,~] = get_chunks_v2(indEvents{j},subjects,args);
0554                 ysub = unique(b.sub_list);
0555                 logs = arrayfun(@(a) ismember(b.sub_list, a), ysub, 'un', 0);
0556                 ylabel = horzcat(indEvents{j},': ', measure);
0557                 ylabel = strrep(ylabel,'_','\_');
0558                 y = cellfun(@(a) nanmean(c{1}.(measure)(a,:), 1), logs, 'un', 0);
0559                 y = vertcat(y{:});
0560             catch ME
0561                 h = msgbox(ME.message);
0562             end
0563         else
0564             try
0565                 f = indEvents{j};
0566                 b = strsplit(f,'_');
0567                 csvData = fileData(char(b(2)));
0568                 col = fileColumns(f);
0569             
0570                 if isKey(fileHeaders,char(b(2)))
0571                     heads = fileHeaders(char(b(2)));
0572                     ylabel = strcat(char(b(2)), {' '}, strjoin(heads(:,col)'));
0573                     ylabel = strrep(ylabel, ' ', '-');
0574                 else
0575                     ylabel = strrep(f,'_','-');
0576                 end
0577         
0578                 csvData = help(csvData,col);
0579                 y = csvData(:,2);
0580                 ysub = csvData(:,1);
0581             catch ME
0582                 h = msgbox(ME.message);
0583                 break;
0584             end
0585         end
0586     end
0587     ydata{j,1} = y;
0588     ydata{j,2} = ysub;
0589     ydata{j,3} = ylabel;
0590 end
0591 
0592 k = 1;
0593 
0594 for i = 1:xlen
0595     x = xdata{i,1};
0596     xsub = xdata{i,2};
0597     xlabel = xdata{i,3};
0598     for j = 1:ylen
0599         y = ydata{j,1};
0600         ysub = ydata{j,2};
0601         ylabel = ydata{j,3};
0602         % here we filter the data based upon common subjects; we only plot
0603         % two events that have data for the same subjects
0604         xlog = ismember(xsub,ysub);
0605         ylog = ismember(ysub,xsub);
0606         data{k,1} = x(xlog);
0607         data{k,2} = y(ylog);
0608         data{k,3} = ysub(ylog);
0609         xaxis{k} = xlabel;
0610         yaxis{k} = ylabel;
0611         k = k+1;
0612     end
0613 end
0614 
0615 if exist('h','var')
0616     delete(h);
0617     clear('h');
0618 end
0619 
0620 gui_plot(data, xaxis, yaxis);
0621 
0622 function D = help(csv_data,col)
0623 global f;
0624 global multiworkSubjects;
0625 
0626 f = containers.Map;
0627 % check if the .csv file is a multilong file; help2 checks for NaN data
0628 if csv_data(1,1) < 100
0629    arrayfun(@(x,y) help2(x,y), csv_data(:,1), csv_data(:,col));
0630    M = [];
0631    for i = 1:length(multiworkSubjects)
0632        z = num2str(mod(multiworkSubjects(i), 100));
0633        if isKey(f,z)
0634            M = vertcat(M,[multiworkSubjects(i),f(z)]);
0635        end
0636    end
0637    D = M;
0638 else
0639    missing = arrayfun(@(a) ~isnan(a),csv_data(:,col));
0640    csv_data = [csv_data(missing,1), csv_data(missing,col)];
0641    D = csv_data;
0642 end
0643 
0644 function help2(a,b)
0645 global f
0646 if isnumeric(b)
0647     f(num2str(a)) = b;
0648 end
0649 
0650 % --- Executes during object creation, after setting all properties.
0651 function XAxisEvents_CreateFcn(hObject, eventdata, handles)
0652 % hObject    handle to XAxisEvents (see GCBO)
0653 % eventdata  reserved - to be defined in a future version of MATLAB
0654 % handles    empty - handles not created until after all CreateFcns called
0655 
0656 % Hint: listbox controls usually have a white background on Windows.
0657 %       See ISPC and COMPUTER.
0658 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0659     set(hObject,'BackgroundColor','white');
0660 end
0661 
0662 % --- Executes on button press in y_btn.
0663 function y_btn_Callback(hObject, eventdata, handles)
0664 % hObject    handle to y_btn (see GCBO)
0665 % eventdata  reserved - to be defined in a future version of MATLAB
0666 % handles    structure with handles and user data (see GUIDATA)
0667 allEvents = get(handles.EventList, 'string');
0668 if ~isempty(allEvents)
0669     selectedIndexes = get(handles.EventList, 'value');
0670     allEvents = allEvents(selectedIndexes);
0671     alreadySelected = get(handles.YAxisEvents, 'string');
0672     repeats = ~ismember(allEvents,alreadySelected);
0673     events = vertcat(alreadySelected, allEvents(repeats));
0674     set(handles.YAxisEvents,'string',events);
0675     set(handles.y_event_prop,'Value',1);
0676     
0677 end
0678     
0679 
0680 % --- Executes on button press in x_btn.
0681 function x_btn_Callback(hObject, eventdata, handles)
0682 % hObject    handle to x_btn (see GCBO)
0683 % eventdata  reserved - to be defined in a future version of MATLAB
0684 % handles    structure with handles and user data (see GUIDATA)
0685 allEvents = get(handles.EventList, 'string');
0686 if ~isempty(allEvents)
0687     selectedIndexes = get(handles.EventList, 'value');
0688     allEvents = allEvents(selectedIndexes);
0689     alreadySelected = get(handles.XAxisEvents, 'string');
0690     repeats = ~ismember(allEvents,alreadySelected);
0691     events = vertcat(alreadySelected, allEvents(repeats));
0692     set(handles.XAxisEvents,'string',events);
0693     set(handles.x_event_prop,'Value',1);
0694 end
0695 
0696 
0697 % --- Executes on selection change in multilongCSVFiles.
0698 function multilongCSVFiles_Callback(hObject, eventdata, handles)
0699 % hObject    handle to multilongCSVFiles (see GCBO)
0700 % eventdata  reserved - to be defined in a future version of MATLAB
0701 % handles    structure with handles and user data (see GUIDATA)
0702 
0703 % Hints: contents = cellstr(get(hObject,'String')) returns multilongCSVFiles contents as cell array
0704 %        contents{get(hObject,'Value')} returns selected item from multilongCSVFiles
0705 
0706 
0707 % --- Executes during object creation, after setting all properties.
0708 function multilongCSVFiles_CreateFcn(hObject, eventdata, handles)
0709 % hObject    handle to multilongCSVFiles (see GCBO)
0710 % eventdata  reserved - to be defined in a future version of MATLAB
0711 % handles    empty - handles not created until after all CreateFcns called
0712 
0713 % Hint: listbox controls usually have a white background on Windows.
0714 %       See ISPC and COMPUTER.
0715 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0716     set(hObject,'BackgroundColor','white');
0717 end
0718 
0719 
0720 
0721 function CSV_EnterFile_Callback(hObject, eventdata, handles)
0722 % hObject    handle to CSV_EnterFile (see GCBO)
0723 % eventdata  reserved - to be defined in a future version of MATLAB
0724 % handles    structure with handles and user data (see GUIDATA)
0725 
0726 % Hints: get(hObject,'String') returns contents of CSV_EnterFile as text
0727 %        str2double(get(hObject,'String')) returns contents of CSV_EnterFile as a double
0728 
0729 currChar = get(handles.figure1,'CurrentCharacter');
0730 if isequal(currChar,char(13)) %char(13) == enter key
0731    file = get(handles.CSV_EnterFile,'String');
0732    % star indicates user input file
0733    f = horzcat('*', file);
0734    csv_events = get(handles.multilongCSVFiles,'String');
0735    csv_events = vertcat(csv_events,f);
0736    set(handles.multilongCSVFiles,'String',csv_events);
0737    set(handles.CSV_EnterFile,'String',''); 
0738 end
0739 
0740 
0741 % --- Executes during object creation, after setting all properties.
0742 function CSV_EnterFile_CreateFcn(hObject, eventdata, handles)
0743 % hObject    handle to CSV_EnterFile (see GCBO)
0744 % eventdata  reserved - to be defined in a future version of MATLAB
0745 % handles    empty - handles not created until after all CreateFcns called
0746 
0747 % Hint: edit controls usually have a white background on Windows.
0748 %       See ISPC and COMPUTER.
0749 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0750     set(hObject,'BackgroundColor','white');
0751 end
0752 
0753 
0754 % --- If Enable == 'on', executes on mouse press in 5 pixel border.
0755 % --- Otherwise, executes on mouse press in 5 pixel border or over CSV_EnterFile.
0756 function CSV_EnterFile_ButtonDownFcn(hObject, eventdata, handles)
0757 % hObject    handle to CSV_EnterFile (see GCBO)
0758 % eventdata  reserved - to be defined in a future version of MATLAB
0759 % handles    structure with handles and user data (see GUIDATA)
0760 set(handles.CSV_EnterFile,'string','');
0761 
0762 
0763 % --- Executes on button press in csv_y_btn.
0764 function csv_y_btn_Callback(hObject, eventdata, handles)
0765 % hObject    handle to csv_y_btn (see GCBO)
0766 % eventdata  reserved - to be defined in a future version of MATLAB
0767 % handles    structure with handles and user data (see GUIDATA)
0768 allEvents = get(handles.multilongCSVFiles,'string');
0769 if ~isempty(allEvents)
0770     selectedIndexes = get(handles.multilongCSVFiles,'value');
0771     allEvents = allEvents(selectedIndexes);
0772     alreadySelected = get(handles.YAxisEvents,'string');
0773     repeats = ~ismember(allEvents,alreadySelected);
0774     events = vertcat(alreadySelected, allEvents(repeats));
0775     set(handles.YAxisEvents,'string',events);
0776     set(handles.y_event_prop,'Value',1);
0777 end
0778 
0779 % --- Executes on button press in csv_x_btn.
0780 function csv_x_btn_Callback(hObject, eventdata, handles)
0781 % hObject    handle to csv_x_btn (see GCBO)
0782 % eventdata  reserved - to be defined in a future version of MATLAB
0783 % handles    structure with handles and user data (see GUIDATA)
0784 allEvents = get(handles.multilongCSVFiles,'string');
0785 if ~isempty(allEvents)
0786     selectedIndexes = get(handles.multilongCSVFiles,'value');
0787     allEvents = allEvents(selectedIndexes);
0788     alreadySelected = get(handles.XAxisEvents,'string');
0789     repeats = ~ismember(allEvents,alreadySelected);
0790     events = vertcat(alreadySelected, allEvents(repeats));
0791     set(handles.XAxisEvents,'string',events);
0792     set(handles.x_event_prop,'Value',1);
0793 end
0794 
0795 
0796 function edit1_Callback(hObject, eventdata, handles)
0797 % hObject    handle to edit1 (see GCBO)
0798 % eventdata  reserved - to be defined in a future version of MATLAB
0799 % handles    structure with handles and user data (see GUIDATA)
0800 
0801 % Hints: get(hObject,'String') returns contents of edit1 as text
0802 %        str2double(get(hObject,'String')) returns contents of edit1 as a double
0803 
0804 
0805 function edit2_Callback(hObject, eventdata, handles)
0806 % hObject    handle to edit2 (see GCBO)
0807 % eventdata  reserved - to be defined in a future version of MATLAB
0808 % handles    structure with handles and user data (see GUIDATA)
0809 
0810 % Hints: get(hObject,'String') returns contents of edit2 as text
0811 %        str2double(get(hObject,'String')) returns contents of edit2 as a double
0812 
0813 
0814 % --- Executes on selection change in EventList.
0815 function EventList_Callback(hObject, eventdata, handles)
0816 % hObject    handle to EventList (see GCBO)
0817 % eventdata  reserved - to be defined in a future version of MATLAB
0818 % handles    structure with handles and user data (see GUIDATA)
0819 
0820 % Hints: contents = cellstr(get(hObject,'String')) returns EventList contents as cell array
0821 %        contents{get(hObject,'Value')} returns selected item from EventList
0822 
0823 
0824 % --- Executes on key press with focus on edit1 and none of its controls.
0825 function edit1_KeyPressFcn(hObject, eventdata, handles)
0826 % hObject    handle to edit1 (see GCBO)
0827 % eventdata  structure with the following fields (see UICONTROL)
0828 %    Key: name of the key that was pressed, in lower case
0829 %    Character: character interpretation of the key(s) that was pressed
0830 %    Modifier: name(s) of the modifier key(s) (i.e., control, shift) pressed
0831 % handles    structure with handles and user data (see GUIDATA)
0832 
0833 
0834 % --- Executes on selection change in YAxisEvents.
0835 function YAxisEvents_Callback(hObject, eventdata, handles)
0836 % hObject    handle to YAxisEvents (see GCBO)
0837 % eventdata  reserved - to be defined in a future version of MATLAB
0838 % handles    structure with handles and user data (see GUIDATA)
0839 
0840 % Hints: contents = cellstr(get(hObject,'String')) returns YAxisEvents contents as cell array
0841 %        contents{get(hObject,'Value')} returns selected item from YAxisEvents
0842 
0843 
0844 % --- Executes on button press in cbAge.
0845 function cbAge_Callback(hObject, eventdata, handles)
0846 % hObject    handle to cbAge (see GCBO)
0847 % eventdata  reserved - to be defined in a future version of MATLAB
0848 % handles    structure with handles and user data (see GUIDATA)
0849 
0850 % Hint: get(hObject,'Value') returns toggle state of cbAge
0851 
0852 
0853 % --- Executes on selection change in XAxisEvents.
0854 function XAxisEvents_Callback(hObject, eventdata, handles)
0855 % hObject    handle to XAxisEvents (see GCBO)
0856 % eventdata  reserved - to be defined in a future version of MATLAB
0857 % handles    structure with handles and user data (see GUIDATA)
0858 
0859 % Hints: contents = cellstr(get(hObject,'String')) returns XAxisEvents contents as cell array
0860 %        contents{get(hObject,'Value')} returns selected item from XAxisEvents
0861 
0862 
0863 function ColumnValues_Callback(hObject, eventdata, handles)
0864 % hObject    handle to ColumnValues (see GCBO)
0865 % eventdata  reserved - to be defined in a future version of MATLAB
0866 % handles    structure with handles and user data (see GUIDATA)
0867 
0868 % Hints: get(hObject,'String') returns contents of ColumnValues as text
0869 %        str2double(get(hObject,'String')) returns contents of ColumnValues as a double
0870 
0871 global fileColumns;
0872 global fileData;
0873 global fileHeaders;
0874 
0875 currChar = get(handles.figure1,'CurrentCharacter');
0876 if isequal(currChar,char(13))
0877    file = get(handles.CSV_EnterFile,'String');
0878    columns = get(handles.ColumnValues,'String');
0879    columns = str2num(columns);
0880    if ~isempty(columns)    
0881        if ~isempty(file)
0882            csvEvents = get(handles.multilongCSVFiles,'String');
0883            csvEvents = vertcat(csvEvents,strcat('*',file));
0884            [a,b] = get_csv_data_v2(char(file));
0885            % here a are the data and b are the headers
0886            fileData(file) = a;
0887            if ~isempty(b)
0888                b = arrayfun(@(x) strtrim(x), b);
0889                fileHeaders(file) = b;
0890            end
0891            for i = 1:length(columns)
0892                f = strcat('column',num2str(columns(i)),'_', file);
0893                csvEvents = vertcat(csvEvents,f);
0894                set(handles.multilongCSVFiles,'String',csvEvents);
0895                fileColumns(f) = columns(i);
0896            end
0897        else
0898            selected = get(handles.multilongCSVFiles,'Value');
0899            csvEvents = get(handles.multilongCSVFiles,'String');
0900            selected = csvEvents(selected);
0901            for i = 1:length(selected)
0902                file = char(selected(i));
0903                if strfind(file,'*')
0904                   file = file(2:end);
0905                   p = file;
0906                else
0907                   p = strcat('/restore/multiwork/multilong_metadata/',file);
0908                end
0909                [a,b] = get_csv_data_v2(p);
0910                fileData(file) = a;
0911                if ~isempty(b)
0912                    b = arrayfun(@(x) strtrim(x), b);
0913                    fileHeaders(file) = b;
0914                end
0915                for j = 1:length(columns)
0916                    if strfind(file,'*')
0917                        f = strcat('column',num2str(columns(j)),'_',file(2:end));
0918                    else
0919                        f = strcat('column',num2str(columns(j)),'_',file);
0920                    end
0921                    csvEvents = vertcat(csvEvents,f);
0922                    set(handles.multilongCSVFiles,'String',csvEvents);
0923                    fileColumns(char(f)) = columns(i);
0924                end
0925            end 
0926        end
0927    end
0928    set(handles.CSV_EnterFile,'String','');
0929    set(handles.ColumnValues,'String','');
0930 end
0931    
0932 
0933 % --- Executes during object creation, after setting all properties.
0934 function ColumnValues_CreateFcn(hObject, eventdata, handles)
0935 % hObject    handle to ColumnValues (see GCBO)
0936 % eventdata  reserved - to be defined in a future version of MATLAB
0937 % handles    empty - handles not created until after all CreateFcns called
0938 
0939 % Hint: edit controls usually have a white background on Windows.
0940 %       See ISPC and COMPUTER.
0941 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0942     set(hObject,'BackgroundColor','white');
0943 end
0944 
0945 
0946 % --- Executes on button press in view_csv_btn.
0947 function view_csv_btn_Callback(hObject, eventdata, handles)
0948 % hObject    handle to view_csv_btn (see GCBO)
0949 % eventdata  reserved - to be defined in a future version of MATLAB
0950 % handles    structure with handles and user data (see GUIDATA)
0951 file = get(handles.CSV_EnterFile,'String');
0952 if ~isempty(file)
0953     open(file);
0954 end
0955     
0956 
0957 
0958 % --- Executes when user attempts to close figure1.
0959 function figure1_CloseRequestFcn(hObject, eventdata, handles)
0960 % hObject    handle to figure1 (see GCBO)
0961 % eventdata  reserved - to be defined in a future version of MATLAB
0962 % handles    structure with handles and user data (see GUIDATA)
0963 
0964 % Hint: delete(hObject) closes the figure
0965 delete(hObject);
0966 if isfield(handles,'exit_on_close')
0967     if handles.exit_on_close == 1
0968         exit;
0969     end
0970 else
0971     clear all;
0972     close all;
0973 end
0974 
0975 
0976 
0977 function EnterArgs_Callback(hObject, eventdata, handles)
0978 % hObject    handle to EnterArgs (see GCBO)
0979 % eventdata  reserved - to be defined in a future version of MATLAB
0980 % handles    structure with handles and user data (see GUIDATA)
0981 
0982 % Hints: get(hObject,'String') returns contents of EnterArgs as text
0983 %        str2double(get(hObject,'String')) returns contents of EnterArgs as a double
0984 currChar = get(handles.figure1,'CurrentCharacter');
0985 if isequal(currChar,char(13)) %char(13) == enter key
0986    Generate_Callback(hObject, eventdata, handles);
0987 end
0988 
0989 
0990 % --- Executes during object creation, after setting all properties.
0991 function EnterArgs_CreateFcn(hObject, eventdata, handles)
0992 % hObject    handle to EnterArgs (see GCBO)
0993 % eventdata  reserved - to be defined in a future version of MATLAB
0994 % handles    empty - handles not created until after all CreateFcns called
0995 
0996 % Hint: edit controls usually have a white background on Windows.
0997 %       See ISPC and COMPUTER.
0998 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0999     set(hObject,'BackgroundColor','white');
1000 end
1001 
1002 
1003 
1004 function x_cont_custom_Callback(hObject, eventdata, handles)
1005 % hObject    handle to x_cont_custom (see GCBO)
1006 % eventdata  reserved - to be defined in a future version of MATLAB
1007 % handles    structure with handles and user data (see GUIDATA)
1008 
1009 % Hints: get(hObject,'String') returns contents of x_cont_custom as text
1010 %        str2double(get(hObject,'String')) returns contents of x_cont_custom as a double
1011 
1012 
1013 % --- Executes during object creation, after setting all properties.
1014 function x_cont_custom_CreateFcn(hObject, eventdata, handles)
1015 % hObject    handle to x_cont_custom (see GCBO)
1016 % eventdata  reserved - to be defined in a future version of MATLAB
1017 % handles    empty - handles not created until after all CreateFcns called
1018 
1019 % Hint: edit controls usually have a white background on Windows.
1020 %       See ISPC and COMPUTER.
1021 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
1022     set(hObject,'BackgroundColor','white');
1023 end
1024 
1025 
1026 
1027 function y_cont_custom_Callback(hObject, eventdata, handles)
1028 % hObject    handle to y_cont_custom (see GCBO)
1029 % eventdata  reserved - to be defined in a future version of MATLAB
1030 % handles    structure with handles and user data (see GUIDATA)
1031 
1032 % Hints: get(hObject,'String') returns contents of y_cont_custom as text
1033 %        str2double(get(hObject,'String')) returns contents of y_cont_custom as a double
1034 
1035 
1036 % --- Executes during object creation, after setting all properties.
1037 function y_cont_custom_CreateFcn(hObject, eventdata, handles)
1038 % hObject    handle to y_cont_custom (see GCBO)
1039 % eventdata  reserved - to be defined in a future version of MATLAB
1040 % handles    empty - handles not created until after all CreateFcns called
1041 
1042 % Hint: edit controls usually have a white background on Windows.
1043 %       See ISPC and COMPUTER.
1044 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
1045     set(hObject,'BackgroundColor','white');
1046 end
1047 
1048 
1049 
1050 function x_event_custom_Callback(hObject, eventdata, handles)
1051 % hObject    handle to x_event_custom (see GCBO)
1052 % eventdata  reserved - to be defined in a future version of MATLAB
1053 % handles    structure with handles and user data (see GUIDATA)
1054 
1055 % Hints: get(hObject,'String') returns contents of x_event_custom as text
1056 %        str2double(get(hObject,'String')) returns contents of x_event_custom as a double
1057 
1058 
1059 % --- Executes during object creation, after setting all properties.
1060 function x_event_custom_CreateFcn(hObject, eventdata, handles)
1061 % hObject    handle to x_event_custom (see GCBO)
1062 % eventdata  reserved - to be defined in a future version of MATLAB
1063 % handles    empty - handles not created until after all CreateFcns called
1064 
1065 % Hint: edit controls usually have a white background on Windows.
1066 %       See ISPC and COMPUTER.
1067 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
1068     set(hObject,'BackgroundColor','white');
1069 end
1070 
1071 
1072 
1073 function y_event_custom_Callback(hObject, eventdata, handles)
1074 % hObject    handle to y_event_custom (see GCBO)
1075 % eventdata  reserved - to be defined in a future version of MATLAB
1076 % handles    structure with handles and user data (see GUIDATA)
1077 
1078 % Hints: get(hObject,'String') returns contents of y_event_custom as text
1079 %        str2double(get(hObject,'String')) returns contents of y_event_custom as a double
1080 
1081 
1082 % --- Executes during object creation, after setting all properties.
1083 function y_event_custom_CreateFcn(hObject, eventdata, handles)
1084 % hObject    handle to y_event_custom (see GCBO)
1085 % eventdata  reserved - to be defined in a future version of MATLAB
1086 % handles    empty - handles not created until after all CreateFcns called
1087 
1088 % Hint: edit controls usually have a white background on Windows.
1089 %       See ISPC and COMPUTER.
1090 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
1091     set(hObject,'BackgroundColor','white');
1092 end
1093 
1094 
1095 % --- Executes on button press in help_btn1.
1096 function help_btn1_Callback(hObject, eventdata, handles)
1097 % hObject    handle to help_btn1 (see GCBO)
1098 % eventdata  reserved - to be defined in a future version of MATLAB
1099 % handles    structure with handles and user data (see GUIDATA)
1100 figure();
1101 [I,map] = imread('/scratch/jjwentz/Help1.png','png');
1102 imshow(I,map)
1103 
1104 % --- Executes on button press in help_btn2.
1105 function help_btn2_Callback(hObject, eventdata, handles)
1106 % hObject    handle to help_btn2 (see GCBO)
1107 % eventdata  reserved - to be defined in a future version of MATLAB
1108 % handles    structure with handles and user data (see GUIDATA)
1109 figure()
1110 [I,map] = imread('/scratch/jjwentz/Help2.png','png');
1111 imshow(I,map)

Generated on Wed 24-May-2017 00:00:56 by m2html © 2005