From 3cd9661100acbe5d1759f19c0f78b7def9f14b12 Mon Sep 17 00:00:00 2001 From: "Jared Saletin, PhD" Date: Thu, 15 Jan 2015 16:07:11 -0500 Subject: [PATCH] reduced main file --- Hume-1.0a/{ => coreFunctions}/parseTag.m | 0 Hume-1.0a/{ => coreFunctions}/plotSleepData.m | 0 Hume-1.0a/gui/sleepScoring.fig | Bin 0 -> 29964 bytes Hume-1.0a/gui/sleepScoring.m | 1219 +++++++++++++++++ Hume-1.0a/hume.fig | Bin 29810 -> 0 bytes Hume-1.0a/hume.m | 1165 +--------------- 6 files changed, 1221 insertions(+), 1163 deletions(-) rename Hume-1.0a/{ => coreFunctions}/parseTag.m (100%) rename Hume-1.0a/{ => coreFunctions}/plotSleepData.m (100%) create mode 100644 Hume-1.0a/gui/sleepScoring.fig create mode 100644 Hume-1.0a/gui/sleepScoring.m delete mode 100644 Hume-1.0a/hume.fig diff --git a/Hume-1.0a/parseTag.m b/Hume-1.0a/coreFunctions/parseTag.m similarity index 100% rename from Hume-1.0a/parseTag.m rename to Hume-1.0a/coreFunctions/parseTag.m diff --git a/Hume-1.0a/plotSleepData.m b/Hume-1.0a/coreFunctions/plotSleepData.m similarity index 100% rename from Hume-1.0a/plotSleepData.m rename to Hume-1.0a/coreFunctions/plotSleepData.m diff --git a/Hume-1.0a/gui/sleepScoring.fig b/Hume-1.0a/gui/sleepScoring.fig new file mode 100644 index 0000000000000000000000000000000000000000..b6923943175900aef00c4df2eefc2aaf5cec4162 GIT binary patch literal 29964 zcma&MWl$W!`aMhngaiTvcMt9m+#y(Sg1bxbpo{F{8a%iKw*bMN4ess^i!8qQvgkj* zdvDeI_3aN+-BUH)Pxs6-~cijw>I~%wxV`%7N*v+^Q8V_?o7?iN6pPI%*7-8iJzK>>)+`AZ?kkm`fq!s zsDk~kx9W<7~zw${@QBrz4@NE@!?8<;Db13pmn?zBZUFKAg_DB$y zN&Kn(f=Fe~@~3K)3PH*KS2vLfl50b?L?0N-P^43kaMZDd)bVMwD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00001 diff --git a/Hume-1.0a/gui/sleepScoring.m b/Hume-1.0a/gui/sleepScoring.m new file mode 100644 index 0000000..5d6fcf7 --- /dev/null +++ b/Hume-1.0a/gui/sleepScoring.m @@ -0,0 +1,1219 @@ +function varargout = sleepScoring(varargin) +% Húmë (formally sleepSMG) ? Open-source MATLAB Sleep Scoring Toolbox +% +% User-feedback welcomed: jared_saletin@brown.edu +% +% AUTHORSHIP: +% +% Jared M. Saletin, PhD (1, 2) and Stephanie M. Greer, PhD (2) E-Mails: +% jared_saletin@brown.edu , smgreer@gmail.com +% +% (1) Department of Psychiatry and Human Behavior, Alpert Medical +% School of Brown University +% +% (2) Depeartment of Psychology / Helen Wills Neuroscience Institute, +% University of California at Berkeley +% +% Copyright (c) 2015 Jared M. Saletin, PhD and Stephanie M. Greer, PhD +% +% DESCRIPTION: +% +% Húmë (formally sleepSMG) is an open-source MATLAB toolbox for +% processing and analyzing polysomnographic sleep recordings including: +% sleep staging, plotting, sleep statistics, data management, and event +% marking routines. Húmë is open-source and licensed under version 3 of +% the GNU Genral Public License (see below). +% +% Húmë is deisnged to be compatable with, and makes extensive use of, +% existing signal processing tools provided both in MATLAB and through +% the EEGLAB toolbox (http://sccn.ucsd.edu/eeglab/). A working +% distribution of EEGLAB is included with Húmë in accordance with the GNU +% General Public License version 2 provided with EEGLAB. EEGLAB is +% copyrighted to Arnaud Delorme and Scott Makeig, Salk Institute. The +% original EEGLAB license is included with this software. +% +% LICENSE AND USE: +% +% This program is free software: you can redistribute it and/or modify it +% under the terms of the GNU General Public License as published by the +% Free Software Foundation, either version 3 of the License, or (at your +% option) any later version. +% +% This program is distributed in the hope that it will be useful, but +% WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +% General Public License for more details. +% +% You should have received a copy of the GNU General Public License along +% with this program. If not, see . +% +% Húmë is intended for research purposes only. Any commercial or medical +% use of this software is prohibited. The authors accept no +% responsibility for its use in this manner. +%% + +% Begin initialization code - DO NOT EDIT +gui_Singleton = 1; +gui_State = struct('gui_Name', mfilename, ... + 'gui_Singleton', gui_Singleton, ... + 'gui_OpeningFcn', @sleepScoring_OpeningFcn, ... + 'gui_OutputFcn', @sleepScoring_OutputFcn, ... + 'gui_LayoutFcn', [] , ... + 'gui_Callback', []); +if nargin && ischar(varargin{1}) + gui_State.gui_Callback = str2func(varargin{1}); +end + +if nargout + [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:}); +else + gui_mainfcn(gui_State, varargin{:}); +end +% End initialization code - DO NOT EDIT + + +% --- Executes just before sleepScoring is made visible. +function sleepScoring_OpeningFcn(hObject, eventdata, handles, varargin) +% This function has no output args, see OutputFcn. +% hObject handle to figure +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) +% varargin command line arguments to sleepScoring (see VARARGIN) + +% Set Montage List based on montage directory + +sleepPath = which('hume'); + +montageNames = dir(fullfile(fileparts(sleepPath), 'montages')); +montages = []; +for i = 1:length(montageNames) + if(strfind(montageNames(i).name, '_Montage.m')) + montages{length(montages) + 1} = montageNames(i).name(1:(end - 2)); + end +end +set(handles.plotSleepIN, 'String', montages) + +eval(['handles.CurrMontage = ',montages{1}, ';']); + +% Set Notes list based on notes directory +noteNames = dir(fullfile(fileparts(sleepPath), 'noteReader')); +notes = {'Notes'}; +for i = 1:length(noteNames) + if(strfind(noteNames(i).name, '_LoadNotes.m')) + notes{length(notes) + 1} = noteNames(i).name(1:(end - 2)); + end +end +set(handles.twinNotes, 'String', notes) + +% Choose default command line output for sleepScoring +handles.output = hObject; +fprintf(1,'\n\nWelcome to Húmë! Happy Scoring!\n\n'); + +% Update handles structure +guidata(hObject, handles); + +% UIWAIT makes sleepScoring wait for user response (see UIRESUME) +% uiwait(handles.figure1); + + +% --- Outputs from this function are returned to the command line. +function varargout = sleepScoring_OutputFcn(hObject, eventdata, handles) +% varargout cell array for returning output args (see VARARGOUT); +% hObject handle to figure +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) + +% Get default command line output from handles structure +varargout{1} = handles.output; + + +%% Key Board short cuts for scoring + buttons + +function figure1_KeyPressFcn(hObject, eventdata, handles) + +if isfield(handles,'stageData') + + cStr = get(hObject, 'CurrentCharacter'); + c = str2num(cStr); + if(~isempty(c) && c >= 0 && c <=6) + handles = updateStage(handles, c); + guidata(hObject, handles); + arrowRightB_Callback(handles.arrowRightB, [], handles); + elseif(strcmp(cStr, '.')) + handles = updateStage(handles, 7); + guidata(hObject, handles); + arrowRightB_Callback(handles.arrowRightB, [], handles); + elseif(c == 7) + arrowLeftB_Callback(handles.arrowLeftB, [], handles); + elseif(c == 9) + + arrowRightB_Callback(handles.arrowRightB, [], handles); + end +end + +% --- Executes on button press in wakeB. +function wakeB_Callback(hObject, eventdata, handles) +% hObject handle to wakeB (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) +handles = updateStage(handles, 0); +guidata(hObject, handles); +arrowRightB_Callback(handles.arrowRightB, [], handles); + +% --- Executes on button press in stage1B. +function stage1B_Callback(hObject, eventdata, handles) +% hObject handle to stage1B (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) +handles = updateStage(handles, 1); +guidata(hObject, handles); +arrowRightB_Callback(handles.arrowRightB, [], handles); + +% --- Executes on button press in stage2B. +function stage2B_Callback(hObject, eventdata, handles) +% hObject handle to stage2B (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) +handles = updateStage(handles, 2); +guidata(hObject, handles); +arrowRightB_Callback(handles.arrowRightB, [], handles); + +% --- Executes on button press in stage3B. +function stage3B_Callback(hObject, eventdata, handles) +% hObject handle to stage3B (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) +handles = updateStage(handles, 3); +guidata(hObject, handles); +arrowRightB_Callback(handles.arrowRightB, [], handles); + +% --- Executes on button press in stage4B. +function stage4B_Callback(hObject, eventdata, handles) +% hObject handle to stage4B (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) +handles = updateStage(handles, 4); +guidata(hObject, handles); +arrowRightB_Callback(handles.arrowRightB, [], handles); + +% --- Executes on button press in remB. +function remB_Callback(hObject, eventdata, handles) +% hObject handle to remB (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) +handles = updateStage(handles, 5); +guidata(hObject, handles); +arrowRightB_Callback(handles.arrowRightB, [], handles); + +% --- Executes on button press in mtB. +function mtB_Callback(hObject, eventdata, handles) +% hObject handle to mtB (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) +handles = updateStage(handles, 6); +guidata(hObject, handles); +arrowRightB_Callback(handles.arrowRightB, [], handles); + +%% Navigation Buttons + +function axes2_ButtonDownFcn(hObject, eventdata, handles) +pt = get(hObject, 'currentPoint'); + +winSize = str2num(get(handles.winIN, 'String')); +srate = handles.EEG.srate; +ptX = floor(pt(1)*(60*60/winSize))*winSize*srate; +jumpto(handles, ptX) + +function jumpto(handles, ptX) +winSize = str2num(get(handles.winIN, 'String')); +srate = handles.EEG.srate; + +newX = [ptX+1, ptX + winSize*srate]; +range = newX(1):newX(2); +handles = plotSleepData(handles, range); +updateStage(handles, []); + + +% --- Executes on button press in arrowLeftB. +function arrowLeftB_Callback(hObject, eventdata, handles) +% hObject handle to arrowLeftB (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) +winSize = str2num(get(handles.winIN, 'String')); +srate = handles.EEG.srate; +curX = xlim(handles.axes1); +newX = [curX(1) - winSize*srate, curX(1) - 1]; + +range = newX(1):newX(2); + +handles = plotSleepData(handles, range); +updateStage(handles, []); + +% --- Executes on button press in arrowRightB. +function arrowRightB_Callback(hObject, eventdata, handles) +% hObject handle to arrowRightB (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) +winSize = str2num(get(handles.winIN, 'String')); +srate = handles.EEG.srate; +curX = xlim(handles.axes1); +newX = [curX(2) + 1, curX(2) + winSize*srate]; +range = newX(1):newX(2); + +handles = plotSleepData(handles, range); +updateStage(handles, []); + +%% + + +function fileIN_Callback(hObject, eventdata, handles) +% hObject handle to fileIN (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) + +% Hints: get(hObject,'String') returns contents of fileIN as text +% str2double(get(hObject,'String')) returns contents of fileIN as a +% double + +% --- Executes during object creation, after setting all properties. +function fileIN_CreateFcn(hObject, eventdata, handles) +% hObject handle to fileIN (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles empty - handles not created until after all CreateFcns called + +% Hint: edit controls usually have a white background on Windows. +% See ISPC and COMPUTER. +if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) + set(hObject,'BackgroundColor','white'); +end + +%% Load +% --- Executes on button press in loadB. +function loadB_Callback(hObject, eventdata, handles) +% hObject handle to loadB (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) +%get EEG data +set(handles.sleepSetPan, 'Visible', 'off') +filename = get(handles.fileIN, 'String'); + +if(strcmp(filename((end - 3):end), '.mat')) + load(filename); +elseif(strcmp(filename((end - 3):end), '.edf') || strcmp(filename((end - 3):end), '.EDF')) + EEG = pop_biosig(filename); +elseif(strcmp(filename((end - 3):end), '.set')) + EEG = pop_loadset(filename); +else + display('CAN NOT OPEN FILE: don''t recognise file ending') +end + +handles.EEG = EEG; + +%look for stage data +filename = get(handles.stageFileIN, 'String'); +if(exist(filename)) + stageData = loadStaging(handles, filename); +else + stageData = []; + stageData.srate = EEG.srate; +end + +if(strcmp(get(handles.twinNotesS, 'Enable'), 'on')) + + if(exist(get(handles.twinNotesS, 'String'))) + file = get(handles.twinNotesS, 'String'); + + noteFCN = get(handles.twinNotes, 'String'); + boxInd = get(handles.twinNotes, 'Value'); + eval(['stageData = ', noteFCN{boxInd}, '(stageData, file);']); + + stageData = loadStaging(handles, stageData); + else + fprinf('Can''t use twin notes file because it doesn''t exist') + end +end + +set(handles.sleepSetPan, 'Visible', 'on') +handles.stageData = stageData; +guidata(hObject, handles) + + +% --- Executes on button press in startB. +function startB_Callback(hObject, eventdata, handles) +% hObject handle to startB (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) +set(handles.setupPan, 'Visible', 'off') +set(handles.sleepSetPan, 'Visible', 'off') +handles.hideChans = {}; +handles.scaleChans = {'C3-A2' 'C4-A1'}; +handles.curScale = 150; +handles.showComp = 0; +guidata(hObject, handles) + +[stagePath, stageName, stageEXT]=fileparts(get(handles.stageFileIN,'String')); +[eegPath, eegName, eegEXT]=fileparts(get(handles.fileIN,'String')); +set(handles.figure1,'Name',sprintf('Húmë Scoring: [PSG File: %s, Score File: %s]',[eegName,eegEXT], [stageName,stageEXT])); +handles = initStaging(handles); +guidata(hObject, handles); +runPlot(handles) +updateStage(handles, []); + + + +function stageData = loadStaging(handles, stageFile) +if(~isstruct(stageFile)) + load(stageFile) +else + stageData = stageFile; +end +if(isfield(stageData, 'win')) + set(handles.winIN, 'String', num2str(stageData.win)) + set(handles.winIN, 'Enable', 'off') +end +if(isfield(stageData, 'lightsON')) + set(handles.lightsonIN, 'String', datestr(stageData.lightsON, 'HHMMSS.FFF')) +end +if(isfield(stageData, 'lightsOFF')) + set(handles.lightsoffIN, 'String', datestr(stageData.lightsOFF, 'HHMMSS.FFF')) +end +if(isfield(stageData, 'recStart')) + set(handles.recStartIN, 'String', datestr(stageData.recStart, 'HHMMSS.FFF')) +end +if(isfield(stageData, 'Notes')) + set(handles.notesIN, 'String', stageData.Notes) +end + + +function runPlot(handles) +winSize = str2num(get(handles.winIN, 'String')); +srate = handles.EEG.srate; + +range = 1:(winSize*srate); +handles = plotSleepData(handles, range); + + +function handles = initStaging(handles) +winSize = str2num(get(handles.winIN, 'String')); +srate = handles.stageData.srate; + +%set stage info to user input +handles.stageData.win = str2num(get(handles.winIN, 'String')); + +handles.stageData.recStart = datenum(get(handles.recStartIN, 'String'), 'HHMMSS.FFF'); +handles.stageData.lightsON = datenum(get(handles.lightsonIN, 'String'), 'HHMMSS.FFF'); +%Add a day to the time if it looks like lights on happened before the +%record start. +if(~(handles.stageData.recStart < handles.stageData.lightsON)) + handles.stageData.lightsON = handles.stageData.lightsON + 1; +end +handles.stageData.lightsOFF = datenum(get(handles.lightsoffIN, 'String'), 'HHMMSS.FFF'); +%Add a day to the time if it looks like lights on happened before the +%record start. +if(~(handles.stageData.recStart < handles.stageData.lightsOFF)) + handles.stageData.lightsOFF = handles.stageData.lightsOFF + 1; +end + +handles.stageData.srate = srate; + +if(~isfield(handles.stageData, 'stages')) + handles.stageData.stages = ones(ceil(size(handles.EEG.data, 2)/(winSize*srate)), 1)*7; + handles.stageData.onsets = zeros(ceil(size(handles.EEG.data, 2)/(winSize*srate)), 1); + handles.stagePlot = zeros(ceil(size(handles.EEG.data, 2)/(winSize*srate)), 1); +else + + handles.stagePlot = zeros(size(handles.stageData.stages, 1), 1); + for i = 1:size(handles.stageData.stages, 1) + stageCode = handles.stageData.stages(i, 1); + end +end +handles.stageData.stageTime = (0:(size(handles.stageData.stages, 1) - 1))./(60/winSize); + +if(isfield(handles, 'compStage')) + tmp = ones(size(handles.stageData.stages))*7; + tmp(1:length(handles.compStage)) = handles.compStage; + handles.compStage = tmp; +end + + +function handles = updateStage(handles, stageCode) + + +winSize = handles.stageData.win; +srate = handles.stageData.srate; + +curWin = xlim(handles.axes1); +ind = floor(curWin(2)/(winSize*handles.EEG.srate)); + +rstart = handles.stageData.recStart + (floor(curWin(1)/handles.EEG.srate)/86400); +set(handles.timeS, 'String', sprintf('Time: %s Epoch: %d', datestr(rstart, 'HH:MM:SS'), ind)); + +onT = etime(datevec(handles.stageData.lightsON), datevec(handles.stageData.recStart))/60; +offT = etime(datevec(handles.stageData.lightsOFF), datevec(handles.stageData.recStart))/60; + +if(~isempty(stageCode)) + handles.stageData.stages(ind, 1) = stageCode; + handles.stageData.onsets(ind, 1) = curWin(1); +else + stageCode = handles.stageData.stages(ind, 1); + %stageCodeC = handles.stageData.stages(ind, 1); +end +stageCodeC = -1; + +hold(handles.axes2, 'off') +curT = handles.stageData.stageTime(ind)./60; +plot(handles.axes2, [curT, curT], [0, 7], 'k'); +hold(handles.axes2, 'on') +plot(handles.axes2, [onT, onT]./60, [0, 7], 'r', 'LineWidth', 2); +plot(handles.axes2, [offT, offT]./60, [0, 7], 'g', 'LineWidth', 2); + +% plotmap = [7 4 3 2 1 5 6 0]; +plotmap = [6 5 4 3 2 1 7 0]; +%stageColors = [0 0 0; 102 255 255; 0 158 225; 102 102 255; 128 0 255; 255 0 0; 100 100 100; 0 0 0]./255; +stageColors = [0 0 0; 102 255 255; 0 158 225; 102 102 255; 128 0 255; 255 0 0; 100 100 100; 200 200 200]./255; + +stageNames = {'wake'; 'stage1'; 'stage2'; 'stage3'; 'stage4'; 'rem'; 'mt'}; + +for i = 0:7; + curInds = find(handles.stageData.stages == i); + + plot(handles.axes2, handles.stageData.stageTime(curInds)./60, ones(length(curInds), 1)*plotmap(i + 1), '.', 'MarkerSize', 20, 'Color', stageColors(i+1, :)); + % plot(handles.axes2, [handles.stageData.stageTime(curInds(c)), handles.stageData.stageTime(curInds(c))], [plotmap(i+1)-.5, plotmap(i+1)+.5], 'Color', stageColors(i+1, :), 'LineWidth', .1); + % + % % if(isfield(handles, 'compStage') && handles.showComp) + % % compInds = find(handles.compStage == i & handles.stageData.stages ~= 7); + % % plot(handles.axes2, handles.stageData.stageTime(compInds), ones(length(compInds), 1)*plotmap(i + 1), 'o', 'MarkerSize', 7, 'Color', stageColors(i+1, :)*.5); + % % stageCodeC = handles.compStage(ind, 1); + + connectData(curInds) = plotmap(i + 1); + + + % end + if(i < 7) + b = eval(['handles.', stageNames{i + 1}, 'B']); + curX = xlim(handles.axes2); + if(i == stageCode) + set(b, 'BackgroundColor', stageColors(i + 1, :)); + if stageCode == 0 + set(b,'ForegroundColor', [1 1 1]); + end + plot(handles.axes2, 1/60, plotmap(i + 1), '<', 'Color', stageColors(i + 1, :), 'MarkerSize', 7, 'LineWidth', 3) + else + set(b, 'BackgroundColor', [1 1 1]); + set(b,'ForegroundColor', [0 0 0]); + end + if(i == stageCodeC && (stageCode < 7) && handles.showComp) + %set(b, 'BackgroundColor', stageColors(i + 1, :)*.5); + plot(handles.axes2, curX(2)/100, plotmap(i + 1), '<', 'Color', stageColors(i + 1, :), 'MarkerSize', 7, 'LineWidth', 3) + end + end +end + +plot(handles.axes2, handles.stageData.stageTime./60, connectData, 'k') +set(handles.axes2, 'Xlim', handles.stageData.stageTime([1, end])./60, 'Ylim', [0, 7], 'YTick', 0:7, 'YTickLabel', {'ANOM'; 'REM'; 'Stage4'; 'Stage3'; 'Stage2'; 'Stage1'; 'Wake'; 'MT'}) +set(handles.axes2, 'ButtonDownFcn', 'sleepScoring(''axes2_ButtonDownFcn'',gcbo,[],guidata(gcbo))') +guidata(handles.axes2, handles) + +handles.stageData.Notes = get(handles.notesIN, 'String'); +stageData = handles.stageData; +%save(get(handles.stageFileIN, 'String'), 'stageData'); + + + +function stageFileIN_Callback(hObject, eventdata, handles) +% hObject handle to stageFileIN (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) + +% Hints: get(hObject,'String') returns contents of stageFileIN as text +% str2double(get(hObject,'String')) returns contents of stageFileIN as a double + + +% --- Executes during object creation, after setting all properties. +function stageFileIN_CreateFcn(hObject, eventdata, handles) +% hObject handle to stageFileIN (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles empty - handles not created until after all CreateFcns called + +% Hint: edit controls usually have a white background on Windows. +% See ISPC and COMPUTER. +if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) + set(hObject,'BackgroundColor','white'); +end + +%% record info text inputs + +function recStartIN_Callback(hObject, eventdata, handles) + +% --- Executes during object creation, after setting all properties. +function recStartIN_CreateFcn(hObject, eventdata, handles) +% hObject handle to recStartIN (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles empty - handles not created until after all CreateFcns called + +% Hint: edit controls usually have a white background on Windows. +% See ISPC and COMPUTER. +if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) + set(hObject,'BackgroundColor','white'); +end + +function lightsonIN_Callback(hObject, eventdata, handles) +% --- Executes during object creation, after setting all properties. +function lightsonIN_CreateFcn(hObject, eventdata, handles) + +if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) + set(hObject,'BackgroundColor','white'); +end + + +function lightsoffIN_Callback(hObject, eventdata, handles) +% --- Executes during object creation, after setting all properties. + +function lightsoffIN_CreateFcn(hObject, eventdata, handles) +if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) + set(hObject,'BackgroundColor','white'); +end + + +function winIN_Callback(hObject, eventdata, handles) + +% --- Executes during object creation, after setting all properties. +function winIN_CreateFcn(hObject, eventdata, handles) +% hObject handle to winIN (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles empty - handles not created until after all CreateFcns called + +% Hint: edit controls usually have a white background on Windows. +% See ISPC and COMPUTER. +if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) + set(hObject,'BackgroundColor','white'); +end + + +%% entering Notes + + +function notesIN_Callback(hObject, eventdata, handles) +% hObject handle to notesIN (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) + +% Hints: get(hObject,'String') returns contents of notesIN as text +% str2double(get(hObject,'String')) returns contents of notesIN as a double + + +% --- Executes during object creation, after setting all properties. +function notesIN_CreateFcn(hObject, eventdata, handles) +% hObject handle to notesIN (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles empty - handles not created until after all CreateFcns called + +% Hint: edit controls usually have a white background on Windows. +% See ISPC and COMPUTER. +if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) + set(hObject,'BackgroundColor','white'); +end + + +% --- Executes on button press in closeNotesB. +function closeNotesB_Callback(hObject, eventdata, handles) +% hObject handle to closeNotesB (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) +set(handles.notePan, 'Visible', 'off') +handles.stageData.Notes = get(handles.notesIN, 'String'); + +if(length(fields(handles.stageData)) >= 9) + stageData = handles.stageData; + %save(get(handles.stageFileIN, 'String'), 'stageData'); +end + + +%% Marking cursur +function txt = cursorInfoUpdate(~, cursorData, handles) +chanScale = str2double(parseTag(get(cursorData.Target, 'Tag'), 'scale')); +chan = chanScale/150; + +position = cursorData.Position; +timeP = cursorData.Position(1)/handles.EEG.srate; +amp = (cursorData.Position(2) - chanScale); +if(isempty(amp)) + txt = sprintf(get(cursorData.Target, 'Tag')); +else + txt = sprintf('Amp: %.1f\nT: %.3f', (amp*-1)/(150/str2num(handles.CurrMontage.scale{chan})), timeP); +end + +function markStr_Callback(hObject, eventdata, handles) +% hObject handle to markStr (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) + +% Hints: get(hObject,'String') returns contents of markStr as text +% str2double(get(hObject,'String')) returns contents of markStr as a double +%handles.cursor = datacursormode(gcf); + + + +% --- Executes during object creation, after setting all properties. +function markStr_CreateFcn(hObject, eventdata, handles) +% hObject handle to markStr (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles empty - handles not created until after all CreateFcns called + +% Hint: edit controls usually have a white background on Windows. +% See ISPC and COMPUTER. +if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) + set(hObject,'BackgroundColor','white'); +end + +% --- Executes on button press in setMark. +function setMark_Callback(hObject, eventdata, handles) +% hObject handle to setMark (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) +cursorData = getCursorInfo(handles.cursor); +label = get(handles.markStr, 'String'); +cursTag = str2double(parseTag(get(cursorData.Target, 'Tag'), 'scale')); + +scales = handles.CurrMontage.scale; + +eventData = {label, cursorData.Position(1), ... + ceil(cursorData.Position(1)/handles.stageData.srate/handles.stageData.win), ... + (cursorData.Position(2) - cursTag)*-1/(150/str2num(scales{cursTag/150}));} + +if ~isfield(handles.stageData, 'MarkedEvents') + handles.stageData.MarkedEvents = eventData; +else + handles.stageData.MarkedEvents = [handles.stageData.MarkedEvents; eventData]; +end + +guidata(hObject, handles) +if(length(fields(handles.stageData)) >= 9) + stageData = handles.stageData; + %save(get(handles.stageFileIN, 'String'), 'stageData'); +end + +curX = xlim(handles.axes1); +range = curX(1):curX(2); +handles = plotSleepData(handles, range); + +% --- Executes on button press in delMark. +function delMark_Callback(hObject, eventdata, handles) +% hObject handle to delMark (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) + +cursorData = getCursorInfo(handles.cursor); +label = get(cursorData.Target, 'Tag'); + +index = find(and(strcmp(handles.stageData.MarkedEvents(:,1),label),[handles.stageData.MarkedEvents{:,2}]'==cursorData.Position(1))); +handles.stageData.MarkedEvents(index,:)=[]; + +curX = xlim(handles.axes1); +range = curX(1):curX(2); +handles = plotSleepData(handles, range); +guidata(hObject, handles); + + +% --- Executes on button press in slopeB. +function slopeB_Callback(hObject, eventdata, handles) +% hObject handle to slopeB (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) + +cursorData = getCursorInfo(handles.cursor); +chan = str2double(parseTag(get(cursorData.Target, 'Tag'), 'chan')); +midPt = cursorData.Position(1); + +slopeData = handles.EEG.data(chan, (midPt - .25*handles.EEG.srate):(midPt + .25*handles.EEG.srate)); +xData = ((midPt - .25*handles.EEG.srate):(midPt + .25*handles.EEG.srate))/handles.EEG.srate; +slp = polyfit(xData', slopeData',1); + +set(handles.optText, 'String', sprintf('%.2f', slp(1))) + +%% Notes + +function twinNotes_Callback(hObject, eventdata, handles) +items = get(hObject, 'String'); +val = get(hObject, 'Value'); + +if(strcmp(items{val}, 'Notes')) + set(handles.twinNotesS, 'enable', 'off') + set(handles.browse_note_B, 'enable', 'off') +else + set(handles.twinNotesS, 'enable', 'on') + set(handles.browse_note_B, 'enable', 'on') +end + + +function twinNotesS_Callback(hObject, eventdata, handles) +% hObject handle to twinNotesS (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) + +% Hints: get(hObject,'String') returns contents of twinNotesS as text +% str2double(get(hObject,'String')) returns contents of twinNotesS as a double + + +% --- Executes during object creation, after setting all properties. +function twinNotesS_CreateFcn(hObject, eventdata, handles) +% hObject handle to twinNotesS (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles empty - handles not created until after all CreateFcns called + +% Hint: edit controls usually have a white background on Windows. +% See ISPC and COMPUTER. +if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) + set(hObject,'BackgroundColor','white'); +end + +%% browse files + +% --- Executes on button press in browse_slp_B. +function browse_slp_B_Callback(hObject, eventdata, handles) +% hObject handle to browse_slp_B (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) +[fileName, filePath] = uigetfile({'*.mat','MAT-files (*.mat)'; '*.edf','EDF-files (*.edf)'; '*.set', 'EEGLAB (*.set)'; '*.*', 'All Files (*.*)'}, 'Sleep Data File'); +set(handles.fileIN, 'String', fullfile(filePath,fileName)); + +% --- Executes on button press in browse_stg_B. +function browse_stg_B_Callback(hObject, eventdata, handles) +% hObject handle to browse_stg_B (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) +[fileName, filePath] = uigetfile({'*.mat','MAT-files (*.mat)'; '*.*', 'All Files (*.*)'}, 'Sleep Stage File'); +set(handles.stageFileIN, 'String', fullfile(filePath,fileName)); + +% --- Executes on button press in browse_note_B. +function browse_note_B_Callback(hObject, eventdata, handles) +% hObject handle to browse_note_B (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) +[fileName, filePath] = uigetfile({'*.txt','text files (*.txt)'; '*.*', 'All Files (*.*)'}, 'Sleep Notes File'); +set(handles.twinNotesS, 'String', fullfile(filePath,fileName)); + +%% Menu Items + +% -------------------------------------------------------------------- +function start_m_Callback(hObject, eventdata, handles) +% hObject handle to start_m (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) + + +% -------------------------------------------------------------------- +function chan_m_Callback(hObject, eventdata, handles) +% hObject handle to chan_m (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) + + +% -------------------------------------------------------------------- +function montage_m_Callback(hObject, eventdata, handles) +% hObject handle to montage_m (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) + + +% -------------------------------------------------------------------- +function sleepStats_m_Callback(hObject, eventdata, handles) +% hObject handle to sleepStats_m (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) + + + +% -------------------------------------------------------------------- +function mark_m_Callback(hObject, eventdata, handles) +% hObject handle to mark_m (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) + + +% -------------------------------------------------------------------- +function starMark_m_Callback(hObject, eventdata, handles) +% hObject handle to starMark_m (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) +mark_t_ClickedCallback(handles.mark_t, eventdata, handles) + + +% -------------------------------------------------------------------- +function clearEvents_m_Callback(hObject, eventdata, handles) +% hObject handle to clearEvents_m (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) +% --- Executes on button press in eventClear. +out = inputdlg('Enter event name to clear (e.g. REM):'); +if(~isempty(out)) + event = out{1}; +else + event = ''; +end + +if(isfield(handles.stageData, 'events') && ~isempty(event)) + if(isfield(handles.stageData.events, event)) + handles.stageData.events = rmfield(handles.stageData.events, event); + guidata(hObject, handles) + curX = xlim(handles.axes1); + range = curX(1):curX(2); + handles = plotSleepData(handles, range); + + if(length(fields(handles.stageData)) >= 9) + stageData = handles.stageData; + %save(get(handles.stageFileIN, 'String'), 'stageData'); + end + else + errordlg(['There are no evets called: ', event]); + end +else + errordlg('There are no events in this dataset'); +end + + + +% -------------------------------------------------------------------- +function runStats_m_Callback(hObject, eventdata, handles) +% hObject handle to runStats_m (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) +% --- Executes on button press in statsB.if(~isempty(out)) +sleepStats_woInput(handles.stageData, get(handles.stageFileIN, {'String'})); + +% -------------------------------------------------------------------- +function hideChan_m_Callback(hObject, eventdata, handles) +% hObject handle to hideChan_m (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) +out = inputdlg('Enter the channel to hide (e.g. EMG1):'); +if(~isempty(out)) + chan = out{1}; + handles.hideChans{end + 1} = chan; + guidata(hObject, handles) + curX = xlim(handles.axes1); + range = curX(1):curX(2); + handles = plotSleepData(handles, range); +end + + +% -------------------------------------------------------------------- +function showChan_m_Callback(hObject, eventdata, handles) +% hObject handle to showChan_m (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) +out = inputdlg('Enter the channel to show (e.g. EMG1):'); +if(~isempty(out)) + chan = out{1}; + handles.hideChans(find(strcmp(handles.hideChans, chan))) = []; + guidata(hObject, handles) + curX = xlim(handles.axes1); + range = curX(1):curX(2); + handles = plotSleepData(handles, range); +end + +% -------------------------------------------------------------------- +function nweData_m_Callback(hObject, eventdata, handles) +% hObject handle to nweData_m (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) +set(handles.setupPan, 'Visible', 'on') + +% -------------------------------------------------------------------- +function compScores_m_Callback(hObject, eventdata, handles) +% hObject handle to compScores_m (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) + +% -------------------------------------------------------------------- +function loadComp_Callback(hObject, eventdata, handles) +% hObject handle to loadComp (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) +[fileName, filePath] = uigetfile({'*.mat','MAT-files (*.mat)'; '*.*', 'All Files (*.*)'}, 'Sleep Stage File for Comparison'); +compStage = load(fullfile(filePath,fileName)); +compStages = compStage.stageData.stages; +if(length(compStages) < length(handles.stageData.stages)) + tmp = ones(size(handles.stageData.stages))*7; + tmp(1:length(compStages)) = compStages; + compStages = tmp; +elseif(length(compStages) > length(handles.stageData.stages)) + compStages = compStages(1:length(handles.stageData.stages)); +end +handles.compStage = compStages; +handles.second_stageData = compStage; +handles.showComp = 0; +guidata(hObject, handles) + +% -------------------------------------------------------------------- +function showCompHyp_m_Callback(hObject, eventdata, handles) +% hObject handle to showCompHyp_m (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) +if(~isfield(handles, 'compStage')) + loadComp_Callback(handles.loadComp, eventData, handles); +end +handles.showComp = 1; +guidata(hObject, handles) + +% -------------------------------------------------------------------- +function hideCompHyp_m_Callback(hObject, eventdata, handles) +% hObject handle to hideCompHyp_m (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) +handles.showComp = 0; +guidata(hObject, handles) + +%% Tool Bar Functions +% -------------------------------------------------------------------- +function lightsOff_t_ClickedCallback(hObject, eventdata, handles) +% hObject handle to lightsOff_t (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) +winSize = str2num(get(handles.winIN, 'String')); +srate = handles.EEG.srate; +pt = etime(datevec(handles.stageData.lightsOFF), datevec(handles.stageData.recStart))/60; +ptX = floor(pt(1)*(60/winSize))*winSize*srate; +jumpto(handles, ptX) + +% -------------------------------------------------------------------- +function lightsOn_t_ClickedCallback(hObject, eventdata, handles) +% hObject handle to lightsOn_t (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) +winSize = str2num(get(handles.winIN, 'String')); +srate = handles.EEG.srate; +pt = etime(datevec(handles.stageData.lightsON), datevec(handles.stageData.recStart))/60; +ptX = floor(pt(1)*(60/winSize))*winSize*srate; +jumpto(handles, ptX) + +% -------------------------------------------------------------------- +function jumpTo_ClickedCallback(hObject, eventdata, handles) +% hObject handle to jumpTo (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) +out = inputdlg('Enter Epoch #:'); +if(~isempty(out)) + epoch = out{1}; +else + epoch = ''; +end +if(~isempty(epoch)) + winSize = str2num(get(handles.winIN, 'String')); + srate = handles.EEG.srate; + jumpto(handles, (str2double(epoch) - 1)*winSize*srate) +end + + +% -------------------------------------------------------------------- +function notes_t_ClickedCallback(hObject, eventdata, handles) +% hObject handle to notes_t (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) + +if(strcmp(get(handles.notePan, 'Visible'),'on')) + set(handles.notePan, 'Visible', 'off') +else + set(handles.notePan, 'Visible', 'on') +end + + +% -------------------------------------------------------------------- +function mark_t_ClickedCallback(hObject, eventdata, handles) +% hObject handle to mark_t (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) +% --- Executes on button press in markB. +if(strcmp(get(handles.markStr, 'Enable'), 'on')) + set(handles.markStr, 'Enable', 'off') + set(handles.setMark, 'Enable', 'off') + set(handles.delMark, 'Enable', 'off') + set(handles.slopeB, 'Enable', 'off') +else + set(handles.markStr, 'Enable', 'on') + set(handles.setMark, 'Enable', 'on') + set(handles.delMark, 'Enable', 'on') + set(handles.slopeB, 'Enable', 'on') +end + +datacursormode('toggle'); +handles.cursor=datacursormode(gcf); +set(handles.cursor, 'UpdateFcn', {@cursorInfoUpdate,handles}) +guidata(hObject, handles); + + +% --- Executes on selection change in plotSleepIN. +function plotSleepIN_Callback(hObject, eventdata, handles) +% hObject handle to plotSleepIN (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) + +% Hints: contents = get(hObject,'String') returns plotSleepIN contents as cell array +% contents{get(hObject,'Value')} returns selected item from plotSleepIN +curX = xlim(handles.axes1); +range = curX(1):curX(2); + +plotFCN = get(handles.plotSleepIN, 'String'); +boxInd = get(handles.plotSleepIN, 'Value'); + +eval(['handles.CurrMontage = ',plotFCN{boxInd}, '(handles);']); + +handles = plotSleepData(handles, range); +guidata(hObject, handles); + + +% --- Executes during object creation, after setting all properties. +function plotSleepIN_CreateFcn(hObject, eventdata, handles) +% hObject handle to plotSleepIN (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles empty - handles not created until after all CreateFcns called + +% Hint: popupmenu controls usually have a white background on Windows. +% See ISPC and COMPUTER. +if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) + set(hObject,'BackgroundColor','white'); +end + + +% -------------------------------------------------------------------- +function info_m_Callback(hObject, eventdata, handles) +% hObject handle to info_m (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) + + +% -------------------------------------------------------------------- +function aInfo_m_Callback(hObject, eventdata, handles) +% hObject handle to aInfo_m (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) +msg = sprintf(['Program Authors: Jared M. Saletin, PhD & Stephanie M. Greer, PhD \n\n',... + 'In association with:\n\n', ... + 'Sleep for Science Research Laboratory (PI: Mary A. Carskadon, PhD)\n', ... + 'Department of Psychiatry and Human Behavior\n', ... + 'Alpert Medical School of Brown University\n\n', ... + 'Sleep and Neuroimaging Laboratory (PI: Matthew P. Walker, PhD)\n', ... + 'Helen Wills Neuroscience Institute\n', ... + 'Department of Psychology \n', ... + 'University of California Berkeley\n\n', ... + 'Contact: jared_saletin@brown.edu\n', ... + 'https://sourceforge.net/projects/sleepsmg']); +msgbox(msg, 'Author Info'); + + +% -------------------------------------------------------------------- +function hKeysInfo_m_Callback(hObject, eventdata, handles) +% hObject handle to hKeysInfo_m (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) +msg = sprintf(['To use keyborad for scoring first click anywhere on the window that does not contain an object.\n\n',... + 'Short Cuts:\n', ... + '0 - Stage Wake\n', ... + '1 - Stage 1 \n', ... + '2 - Stage 2\n', ... + '3 - Stage 3\n', ... + '3 - Stage 4\n', ... + '5 - Stage REM\n', ... + '6 - Movement Time\n', ... + '. - Mark epoch as anomolous/unscored\n', ... + '7 - scroll to the left\n', ... + '9 - scroll to the right\n\n', ... + 'CTRL-o - Import/Open New Dataset\n', ... + 'CTRL-s - Save Dataset\n', ... + 'CTRL-r - Perform Sleep Statistics\n', ... + 'CTRL-e - Toggle Event Mode On/Off\n', ... + '*The keyboard short cuts will not work when event marking mode is turned on.']); +msgbox(msg, 'Hot Keys'); + + +% -------------------------------------------------------------------- +function saveData_m_Callback(hObject, eventdata, handles) +% hObject handle to saveData_m (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) +stageData=handles.stageData; +save(get(handles.stageFileIN, 'String'), 'stageData'); +msgbox('Save Complete'); + + +% -------------------------------------------------------------------- +function editMontage_Callback(hObject, eventdata, handles) +% hObject handle to editMontage (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) +if isfield(handles,'EEG') + [output mont] = sleepMontageEditor(handles); + + handles.CurrMontage.colors = mont.colors; + handles.CurrMontage.electrodes = mont.electrodes; + handles.CurrMontage.bigGridMat = mont.bigGridMat; + handles.CurrMontage.hideChans = mont.hideChans; + handles.CurrMontage.scaleChans = mont.scaleChans; + handles.CurrMontage.scale = mont.scale; + + curX = xlim(handles.axes1); + range = curX(1):curX(2); + + handles = plotSleepData(handles, range); + guidata(hObject, handles); + +else + errordlg('No EEG file loaded, please load data and re-open Montage Editor', 'Húmë Montage Editor'); + +end + + + +% -------------------------------------------------------------------- +function runStatsWOinput_2_Callback(hObject, eventdata, handles) +% hObject handle to runStatsWOinput_2 (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) +sleepStats; + + +% -------------------------------------------------------------------- +function createMontage_Callback(hObject, eventdata, handles) +% hObject handle to createMontage (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) +sleepMontageCreator; + + +% -------------------------------------------------------------------- +function runReliability_Callback(hObject, eventdata, handles) +% hObject handle to runReliability (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) +sleepReliability; + + +% -------------------------------------------------------------------- +function editMontage_ClickedCallback(hObject, eventdata, handles) +% hObject handle to editMontage (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) +editMontage_Callback(hObject,eventdata, handles); + + +% -------------------------------------------------------------------- +function runStats_ClickedCallback(hObject, eventdata, handles) +% hObject handle to runStats (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) +sleepStats_woInput(handles.stageData, get(handles.stageFileIN, {'String'})); + + +% -------------------------------------------------------------------- +function saveData_ClickedCallback(hObject, eventdata, handles) +% hObject handle to saveData (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) +saveData_m_Callback(hObject, eventdata, handles); + +% -------------------------------------------------------------------- +function openData_ClickedCallback(hObject, eventdata, handles) +% hObject handle to openData (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) +set(handles.setupPan, 'Visible', 'on') diff --git a/Hume-1.0a/hume.fig b/Hume-1.0a/hume.fig deleted file mode 100644 index e1ecf603577d8f6aecd8ecc7487263d4dda8c8f9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 29810 zcma%hWmFu|(k+4D1h)ithv2RWZh_$LF2Nmw1p>i?%itO;xVyUqhrxow00YdxFwD!n zcYXig`O&M-IbCaY^*XzE)vi*P)lrj`qZQnHX|IPjLF5arTP{@0`R5&h`GQGl#Mxk$x5GWpY`%a9jbRMciwIEQWT=P?vyngIK zpi8_af4#XbDoR9VIGkS&*@I!sOeU|85JR^(_G{otcp*lSc1yF49L9I-X@C2bE@zfj zVY*jUn$&$EP2ipG0C(S`p6ni^ucj5+g`X|VQu`yRQZ-&rx|vOuopww+e2a8iebxCF zre$U@qM-fptr6-FgGP&m*f%WsswMG1gH3(Zi%`0#gdY6>U=`%lXP!_ zOcV4!V81$k+*hW*&18<9m^h$b@Iof>N)L!~XC@-Q@qGy`(pao)UMCjOM(7B+&^((1 zeV^5qRb^COo_m{zbGR`VdVYk)1y;R3rfxaq$I~pg08XND&!j;aX}a(~SgX?v_GtX4 zSnp9gILa|baMG%O?s}0(pw3#wf!F$fARCN;!0d=4fkPf?|yn~fOT(luSog} zG`CHAp($%TsDRcRg(WEZwxQSj^D9wh4JJa&qu{e+u;xAt!5hp|e0(`B;-)ZKHQJ-)Z-HnqyWB8e zmtB`%S6)|N*IL(IH(U=Xx$b|V-r$0kH&RpH5!k{(uB=-kzPYH2UpMK9W4iQ~C$m_7t6)3*8#v}IM_ z+zahukBSzO9xMGiA2*6sK+?nJ=rE68>s@^?z5cgH5kSLbFS z{HtjMfiFQ#))lhHQPmrtIkR~6J8_D}%tFVTDzyih0KPEl(+gUoT{pJtakt88mdkKi zo=GVIvRG+!ycIzy1JA~OmFf9U&K?%}A8BMi#2b*LwX>JI+4-T$ipGJqk<86YO(Rru zM1(}SPR3-mpL1&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>v;zHP*@jmseiP;$8+D) z^E6Z^^I;BO@n~_6^S-kuD^xF2H|G*=6xS25AK=LZ)doET^QDZY^qhg{fb_upW}{|3 zFZW-1o`)KN^uYpO*B*N^LmwD^EABDcH}d3!8vND6^81bY^;qv)dvZgK|LS7}#@C#8 zPtosdJk;Vtj3RpM_U(4h&>w2(YF$E)qI=Fk^oH_iXoT0k*Y1xQhiO!$zX-sHNbn?K zUmg*wH%9v314D?}_}2ZeWR5kMGtmRi=#s7>W$p|I$Mv zUFXBaF0g#>T|)?{T1DP4uNywH2^-LE{v;moF?>^A>FP)_cyP9^w?5f~Oq0KukI7kv zKkU)k#0~w?Z*-|Zr1@-@ZE&tDv%+BGp?Q8qjr|d2)FfR$*A7bqh zeza8a45;wpoJA)~0_3J5>8{UNue)19PIQq+hpM$}i2J7KGb;*rA%{Qq125D7{s80X WCmkXVd=9ujr7@pAbsWhd`+oqHu4zU9 diff --git a/Hume-1.0a/hume.m b/Hume-1.0a/hume.m index be8c2bc..1744d5d 100644 --- a/Hume-1.0a/hume.m +++ b/Hume-1.0a/hume.m @@ -1,4 +1,4 @@ -function varargout = hume(varargin) +function hume % Húmë (formally sleepSMG) ? Open-source MATLAB Sleep Scoring Toolbox % % User-feedback welcomed: jared_saletin@brown.edu @@ -51,34 +51,6 @@ % use of this software is prohibited. The authors accept no % responsibility for its use in this manner. %% - -% Begin initialization code - DO NOT EDIT -gui_Singleton = 1; -gui_State = struct('gui_Name', mfilename, ... - 'gui_Singleton', gui_Singleton, ... - 'gui_OpeningFcn', @hume_OpeningFcn, ... - 'gui_OutputFcn', @hume_OutputFcn, ... - 'gui_LayoutFcn', [] , ... - 'gui_Callback', []); -if nargin && ischar(varargin{1}) - gui_State.gui_Callback = str2func(varargin{1}); -end - -if nargout - [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:}); -else - gui_mainfcn(gui_State, varargin{:}); -end -% End initialization code - DO NOT EDIT - - -% --- Executes just before hume is made visible. -function hume_OpeningFcn(hObject, eventdata, handles, varargin) -% This function has no output args, see OutputFcn. -% hObject handle to figure -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) -% varargin command line arguments to hume (see VARARGIN) handles.version = '1.0a'; sleepPath = which('hume'); @@ -105,1137 +77,4 @@ function hume_OpeningFcn(hObject, eventdata, handles, varargin) eeglab; end -% Set Montage List based on montage directory -montageNames = dir(fullfile(fileparts(sleepPath), 'montages')); -montages = []; -for i = 1:length(montageNames) - if(strfind(montageNames(i).name, '_Montage.m')) - montages{length(montages) + 1} = montageNames(i).name(1:(end - 2)); - end -end -set(handles.plotSleepIN, 'String', montages) - -eval(['handles.CurrMontage = ',montages{1}, ';']); - -% Set Notes list based on notes directory -noteNames = dir(fullfile(fileparts(sleepPath), 'noteReader')); -notes = {'Notes'}; -for i = 1:length(noteNames) - if(strfind(noteNames(i).name, '_LoadNotes.m')) - notes{length(notes) + 1} = noteNames(i).name(1:(end - 2)); - end -end -set(handles.twinNotes, 'String', notes) - -% Choose default command line output for hume -handles.output = hObject; -fprintf(1,'\n\nWelcome to Húmë! Happy Scoring!\n\n'); - -% Update handles structure -guidata(hObject, handles); - -% UIWAIT makes hume wait for user response (see UIRESUME) -% uiwait(handles.figure1); - - -% --- Outputs from this function are returned to the command line. -function varargout = hume_OutputFcn(hObject, eventdata, handles) -% varargout cell array for returning output args (see VARARGOUT); -% hObject handle to figure -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) - -% Get default command line output from handles structure -varargout{1} = handles.output; - - -%% Key Board short cuts for scoring + buttons - -function figure1_KeyPressFcn(hObject, eventdata, handles) - -if isfield(handles,'stageData') - - cStr = get(hObject, 'CurrentCharacter'); - c = str2num(cStr); - if(~isempty(c) && c >= 0 && c <=6) - handles = updateStage(handles, c); - guidata(hObject, handles); - arrowRightB_Callback(handles.arrowRightB, [], handles); - elseif(strcmp(cStr, '.')) - handles = updateStage(handles, 7); - guidata(hObject, handles); - arrowRightB_Callback(handles.arrowRightB, [], handles); - elseif(c == 7) - arrowLeftB_Callback(handles.arrowLeftB, [], handles); - elseif(c == 9) - - arrowRightB_Callback(handles.arrowRightB, [], handles); - end -end - -% --- Executes on button press in wakeB. -function wakeB_Callback(hObject, eventdata, handles) -% hObject handle to wakeB (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) -handles = updateStage(handles, 0); -guidata(hObject, handles); -arrowRightB_Callback(handles.arrowRightB, [], handles); - -% --- Executes on button press in stage1B. -function stage1B_Callback(hObject, eventdata, handles) -% hObject handle to stage1B (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) -handles = updateStage(handles, 1); -guidata(hObject, handles); -arrowRightB_Callback(handles.arrowRightB, [], handles); - -% --- Executes on button press in stage2B. -function stage2B_Callback(hObject, eventdata, handles) -% hObject handle to stage2B (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) -handles = updateStage(handles, 2); -guidata(hObject, handles); -arrowRightB_Callback(handles.arrowRightB, [], handles); - -% --- Executes on button press in stage3B. -function stage3B_Callback(hObject, eventdata, handles) -% hObject handle to stage3B (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) -handles = updateStage(handles, 3); -guidata(hObject, handles); -arrowRightB_Callback(handles.arrowRightB, [], handles); - -% --- Executes on button press in stage4B. -function stage4B_Callback(hObject, eventdata, handles) -% hObject handle to stage4B (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) -handles = updateStage(handles, 4); -guidata(hObject, handles); -arrowRightB_Callback(handles.arrowRightB, [], handles); - -% --- Executes on button press in remB. -function remB_Callback(hObject, eventdata, handles) -% hObject handle to remB (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) -handles = updateStage(handles, 5); -guidata(hObject, handles); -arrowRightB_Callback(handles.arrowRightB, [], handles); - -% --- Executes on button press in mtB. -function mtB_Callback(hObject, eventdata, handles) -% hObject handle to mtB (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) -handles = updateStage(handles, 6); -guidata(hObject, handles); -arrowRightB_Callback(handles.arrowRightB, [], handles); - -%% Navigation Buttons - -function axes2_ButtonDownFcn(hObject, eventdata, handles) -pt = get(hObject, 'currentPoint'); - -winSize = str2num(get(handles.winIN, 'String')); -srate = handles.EEG.srate; -ptX = floor(pt(1)*(60*60/winSize))*winSize*srate; -jumpto(handles, ptX) - -function jumpto(handles, ptX) -winSize = str2num(get(handles.winIN, 'String')); -srate = handles.EEG.srate; - -newX = [ptX+1, ptX + winSize*srate]; -range = newX(1):newX(2); -handles = plotSleepData(handles, range); -updateStage(handles, []); - - -% --- Executes on button press in arrowLeftB. -function arrowLeftB_Callback(hObject, eventdata, handles) -% hObject handle to arrowLeftB (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) -winSize = str2num(get(handles.winIN, 'String')); -srate = handles.EEG.srate; -curX = xlim(handles.axes1); -newX = [curX(1) - winSize*srate, curX(1) - 1]; - -range = newX(1):newX(2); - -handles = plotSleepData(handles, range); -updateStage(handles, []); - -% --- Executes on button press in arrowRightB. -function arrowRightB_Callback(hObject, eventdata, handles) -% hObject handle to arrowRightB (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) -winSize = str2num(get(handles.winIN, 'String')); -srate = handles.EEG.srate; -curX = xlim(handles.axes1); -newX = [curX(2) + 1, curX(2) + winSize*srate]; -range = newX(1):newX(2); - -handles = plotSleepData(handles, range); -updateStage(handles, []); - -%% - - -function fileIN_Callback(hObject, eventdata, handles) -% hObject handle to fileIN (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) - -% Hints: get(hObject,'String') returns contents of fileIN as text -% str2double(get(hObject,'String')) returns contents of fileIN as a -% double - -% --- Executes during object creation, after setting all properties. -function fileIN_CreateFcn(hObject, eventdata, handles) -% hObject handle to fileIN (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles empty - handles not created until after all CreateFcns called - -% Hint: edit controls usually have a white background on Windows. -% See ISPC and COMPUTER. -if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) - set(hObject,'BackgroundColor','white'); -end - -%% Load -% --- Executes on button press in loadB. -function loadB_Callback(hObject, eventdata, handles) -% hObject handle to loadB (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) -%get EEG data -set(handles.sleepSetPan, 'Visible', 'off') -filename = get(handles.fileIN, 'String'); - -if(strcmp(filename((end - 3):end), '.mat')) - load(filename); -elseif(strcmp(filename((end - 3):end), '.edf') || strcmp(filename((end - 3):end), '.EDF')) - EEG = pop_biosig(filename); -elseif(strcmp(filename((end - 3):end), '.set')) - EEG = pop_loadset(filename); -else - display('CAN NOT OPEN FILE: don''t recognise file ending') -end - -handles.EEG = EEG; - -%look for stage data -filename = get(handles.stageFileIN, 'String'); -if(exist(filename)) - stageData = loadStaging(handles, filename); -else - stageData = []; - stageData.srate = EEG.srate; -end - -if(strcmp(get(handles.twinNotesS, 'Enable'), 'on')) - - if(exist(get(handles.twinNotesS, 'String'))) - file = get(handles.twinNotesS, 'String'); - - noteFCN = get(handles.twinNotes, 'String'); - boxInd = get(handles.twinNotes, 'Value'); - eval(['stageData = ', noteFCN{boxInd}, '(stageData, file);']); - - stageData = loadStaging(handles, stageData); - else - fprinf('Can''t use twin notes file because it doesn''t exist') - end -end - -set(handles.sleepSetPan, 'Visible', 'on') -handles.stageData = stageData; -guidata(hObject, handles) - - -% --- Executes on button press in startB. -function startB_Callback(hObject, eventdata, handles) -% hObject handle to startB (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) -set(handles.setupPan, 'Visible', 'off') -set(handles.sleepSetPan, 'Visible', 'off') -handles.hideChans = {}; -handles.scaleChans = {'C3-A2' 'C4-A1'}; -handles.curScale = 150; -handles.showComp = 0; -guidata(hObject, handles) - -[stagePath, stageName, stageEXT]=fileparts(get(handles.stageFileIN,'String')); -[eegPath, eegName, eegEXT]=fileparts(get(handles.fileIN,'String')); -set(handles.figure1,'Name',sprintf('Húmë Scoring: [PSG File: %s, Score File: %s]',[eegName,eegEXT], [stageName,stageEXT])); -handles = initStaging(handles); -guidata(hObject, handles); -runPlot(handles) -updateStage(handles, []); - - - -function stageData = loadStaging(handles, stageFile) -if(~isstruct(stageFile)) - load(stageFile) -else - stageData = stageFile; -end -if(isfield(stageData, 'win')) - set(handles.winIN, 'String', num2str(stageData.win)) - set(handles.winIN, 'Enable', 'off') -end -if(isfield(stageData, 'lightsON')) - set(handles.lightsonIN, 'String', datestr(stageData.lightsON, 'HHMMSS.FFF')) -end -if(isfield(stageData, 'lightsOFF')) - set(handles.lightsoffIN, 'String', datestr(stageData.lightsOFF, 'HHMMSS.FFF')) -end -if(isfield(stageData, 'recStart')) - set(handles.recStartIN, 'String', datestr(stageData.recStart, 'HHMMSS.FFF')) -end -if(isfield(stageData, 'Notes')) - set(handles.notesIN, 'String', stageData.Notes) -end - - -function runPlot(handles) -winSize = str2num(get(handles.winIN, 'String')); -srate = handles.EEG.srate; - -range = 1:(winSize*srate); -handles = plotSleepData(handles, range); - - -function handles = initStaging(handles) -winSize = str2num(get(handles.winIN, 'String')); -srate = handles.stageData.srate; - -%set stage info to user input -handles.stageData.win = str2num(get(handles.winIN, 'String')); - -handles.stageData.recStart = datenum(get(handles.recStartIN, 'String'), 'HHMMSS.FFF'); -handles.stageData.lightsON = datenum(get(handles.lightsonIN, 'String'), 'HHMMSS.FFF'); -%Add a day to the time if it looks like lights on happened before the -%record start. -if(~(handles.stageData.recStart < handles.stageData.lightsON)) - handles.stageData.lightsON = handles.stageData.lightsON + 1; -end -handles.stageData.lightsOFF = datenum(get(handles.lightsoffIN, 'String'), 'HHMMSS.FFF'); -%Add a day to the time if it looks like lights on happened before the -%record start. -if(~(handles.stageData.recStart < handles.stageData.lightsOFF)) - handles.stageData.lightsOFF = handles.stageData.lightsOFF + 1; -end - -handles.stageData.srate = srate; - -if(~isfield(handles.stageData, 'stages')) - handles.stageData.stages = ones(ceil(size(handles.EEG.data, 2)/(winSize*srate)), 1)*7; - handles.stageData.onsets = zeros(ceil(size(handles.EEG.data, 2)/(winSize*srate)), 1); - handles.stagePlot = zeros(ceil(size(handles.EEG.data, 2)/(winSize*srate)), 1); -else - - handles.stagePlot = zeros(size(handles.stageData.stages, 1), 1); - for i = 1:size(handles.stageData.stages, 1) - stageCode = handles.stageData.stages(i, 1); - end -end -handles.stageData.stageTime = (0:(size(handles.stageData.stages, 1) - 1))./(60/winSize); - -if(isfield(handles, 'compStage')) - tmp = ones(size(handles.stageData.stages))*7; - tmp(1:length(handles.compStage)) = handles.compStage; - handles.compStage = tmp; -end - - -function handles = updateStage(handles, stageCode) - - -winSize = handles.stageData.win; -srate = handles.stageData.srate; - -curWin = xlim(handles.axes1); -ind = floor(curWin(2)/(winSize*handles.EEG.srate)); - -rstart = handles.stageData.recStart + (floor(curWin(1)/handles.EEG.srate)/86400); -set(handles.timeS, 'String', sprintf('Time: %s Epoch: %d', datestr(rstart, 'HH:MM:SS'), ind)); - -onT = etime(datevec(handles.stageData.lightsON), datevec(handles.stageData.recStart))/60; -offT = etime(datevec(handles.stageData.lightsOFF), datevec(handles.stageData.recStart))/60; - -if(~isempty(stageCode)) - handles.stageData.stages(ind, 1) = stageCode; - handles.stageData.onsets(ind, 1) = curWin(1); -else - stageCode = handles.stageData.stages(ind, 1); - %stageCodeC = handles.stageData.stages(ind, 1); -end -stageCodeC = -1; - -hold(handles.axes2, 'off') -curT = handles.stageData.stageTime(ind)./60; -plot(handles.axes2, [curT, curT], [0, 7], 'k'); -hold(handles.axes2, 'on') -plot(handles.axes2, [onT, onT]./60, [0, 7], 'r', 'LineWidth', 2); -plot(handles.axes2, [offT, offT]./60, [0, 7], 'g', 'LineWidth', 2); - -% plotmap = [7 4 3 2 1 5 6 0]; -plotmap = [6 5 4 3 2 1 7 0]; -%stageColors = [0 0 0; 102 255 255; 0 158 225; 102 102 255; 128 0 255; 255 0 0; 100 100 100; 0 0 0]./255; -stageColors = [0 0 0; 102 255 255; 0 158 225; 102 102 255; 128 0 255; 255 0 0; 100 100 100; 200 200 200]./255; - -stageNames = {'wake'; 'stage1'; 'stage2'; 'stage3'; 'stage4'; 'rem'; 'mt'}; - -for i = 0:7; - curInds = find(handles.stageData.stages == i); - - plot(handles.axes2, handles.stageData.stageTime(curInds)./60, ones(length(curInds), 1)*plotmap(i + 1), '.', 'MarkerSize', 20, 'Color', stageColors(i+1, :)); - % plot(handles.axes2, [handles.stageData.stageTime(curInds(c)), handles.stageData.stageTime(curInds(c))], [plotmap(i+1)-.5, plotmap(i+1)+.5], 'Color', stageColors(i+1, :), 'LineWidth', .1); - % - % % if(isfield(handles, 'compStage') && handles.showComp) - % % compInds = find(handles.compStage == i & handles.stageData.stages ~= 7); - % % plot(handles.axes2, handles.stageData.stageTime(compInds), ones(length(compInds), 1)*plotmap(i + 1), 'o', 'MarkerSize', 7, 'Color', stageColors(i+1, :)*.5); - % % stageCodeC = handles.compStage(ind, 1); - - connectData(curInds) = plotmap(i + 1); - - - % end - if(i < 7) - b = eval(['handles.', stageNames{i + 1}, 'B']); - curX = xlim(handles.axes2); - if(i == stageCode) - set(b, 'BackgroundColor', stageColors(i + 1, :)); - if stageCode == 0 - set(b,'ForegroundColor', [1 1 1]); - end - plot(handles.axes2, 1/60, plotmap(i + 1), '<', 'Color', stageColors(i + 1, :), 'MarkerSize', 7, 'LineWidth', 3) - else - set(b, 'BackgroundColor', [1 1 1]); - set(b,'ForegroundColor', [0 0 0]); - end - if(i == stageCodeC && (stageCode < 7) && handles.showComp) - %set(b, 'BackgroundColor', stageColors(i + 1, :)*.5); - plot(handles.axes2, curX(2)/100, plotmap(i + 1), '<', 'Color', stageColors(i + 1, :), 'MarkerSize', 7, 'LineWidth', 3) - end - end -end - -plot(handles.axes2, handles.stageData.stageTime./60, connectData, 'k') -set(handles.axes2, 'Xlim', handles.stageData.stageTime([1, end])./60, 'Ylim', [0, 7], 'YTick', 0:7, 'YTickLabel', {'ANOM'; 'REM'; 'Stage4'; 'Stage3'; 'Stage2'; 'Stage1'; 'Wake'; 'MT'}) -set(handles.axes2, 'ButtonDownFcn', 'hume(''axes2_ButtonDownFcn'',gcbo,[],guidata(gcbo))') -guidata(handles.axes2, handles) - -handles.stageData.Notes = get(handles.notesIN, 'String'); -stageData = handles.stageData; -%save(get(handles.stageFileIN, 'String'), 'stageData'); - - - -function stageFileIN_Callback(hObject, eventdata, handles) -% hObject handle to stageFileIN (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) - -% Hints: get(hObject,'String') returns contents of stageFileIN as text -% str2double(get(hObject,'String')) returns contents of stageFileIN as a double - - -% --- Executes during object creation, after setting all properties. -function stageFileIN_CreateFcn(hObject, eventdata, handles) -% hObject handle to stageFileIN (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles empty - handles not created until after all CreateFcns called - -% Hint: edit controls usually have a white background on Windows. -% See ISPC and COMPUTER. -if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) - set(hObject,'BackgroundColor','white'); -end - -%% record info text inputs - -function recStartIN_Callback(hObject, eventdata, handles) - -% --- Executes during object creation, after setting all properties. -function recStartIN_CreateFcn(hObject, eventdata, handles) -% hObject handle to recStartIN (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles empty - handles not created until after all CreateFcns called - -% Hint: edit controls usually have a white background on Windows. -% See ISPC and COMPUTER. -if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) - set(hObject,'BackgroundColor','white'); -end - -function lightsonIN_Callback(hObject, eventdata, handles) -% --- Executes during object creation, after setting all properties. -function lightsonIN_CreateFcn(hObject, eventdata, handles) - -if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) - set(hObject,'BackgroundColor','white'); -end - - -function lightsoffIN_Callback(hObject, eventdata, handles) -% --- Executes during object creation, after setting all properties. - -function lightsoffIN_CreateFcn(hObject, eventdata, handles) -if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) - set(hObject,'BackgroundColor','white'); -end - - -function winIN_Callback(hObject, eventdata, handles) - -% --- Executes during object creation, after setting all properties. -function winIN_CreateFcn(hObject, eventdata, handles) -% hObject handle to winIN (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles empty - handles not created until after all CreateFcns called - -% Hint: edit controls usually have a white background on Windows. -% See ISPC and COMPUTER. -if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) - set(hObject,'BackgroundColor','white'); -end - - -%% entering Notes - - -function notesIN_Callback(hObject, eventdata, handles) -% hObject handle to notesIN (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) - -% Hints: get(hObject,'String') returns contents of notesIN as text -% str2double(get(hObject,'String')) returns contents of notesIN as a double - - -% --- Executes during object creation, after setting all properties. -function notesIN_CreateFcn(hObject, eventdata, handles) -% hObject handle to notesIN (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles empty - handles not created until after all CreateFcns called - -% Hint: edit controls usually have a white background on Windows. -% See ISPC and COMPUTER. -if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) - set(hObject,'BackgroundColor','white'); -end - - -% --- Executes on button press in closeNotesB. -function closeNotesB_Callback(hObject, eventdata, handles) -% hObject handle to closeNotesB (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) -set(handles.notePan, 'Visible', 'off') -handles.stageData.Notes = get(handles.notesIN, 'String'); - -if(length(fields(handles.stageData)) >= 9) - stageData = handles.stageData; - %save(get(handles.stageFileIN, 'String'), 'stageData'); -end - - -%% Marking cursur -function txt = cursorInfoUpdate(~, cursorData, handles) -chanScale = str2double(parseTag(get(cursorData.Target, 'Tag'), 'scale')); -chan = chanScale/150; - -position = cursorData.Position; -timeP = cursorData.Position(1)/handles.EEG.srate; -amp = (cursorData.Position(2) - chanScale); -if(isempty(amp)) - txt = sprintf(get(cursorData.Target, 'Tag')); -else - txt = sprintf('Amp: %.1f\nT: %.3f', (amp*-1)/(150/str2num(handles.CurrMontage.scale{chan})), timeP); -end - -function markStr_Callback(hObject, eventdata, handles) -% hObject handle to markStr (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) - -% Hints: get(hObject,'String') returns contents of markStr as text -% str2double(get(hObject,'String')) returns contents of markStr as a double -%handles.cursor = datacursormode(gcf); - - - -% --- Executes during object creation, after setting all properties. -function markStr_CreateFcn(hObject, eventdata, handles) -% hObject handle to markStr (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles empty - handles not created until after all CreateFcns called - -% Hint: edit controls usually have a white background on Windows. -% See ISPC and COMPUTER. -if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) - set(hObject,'BackgroundColor','white'); -end - -% --- Executes on button press in setMark. -function setMark_Callback(hObject, eventdata, handles) -% hObject handle to setMark (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) -cursorData = getCursorInfo(handles.cursor); -label = get(handles.markStr, 'String'); -cursTag = str2double(parseTag(get(cursorData.Target, 'Tag'), 'scale')); - -scales = handles.CurrMontage.scale; - -eventData = {label, cursorData.Position(1), ... - ceil(cursorData.Position(1)/handles.stageData.srate/handles.stageData.win), ... - (cursorData.Position(2) - cursTag)*-1/(150/str2num(scales{cursTag/150}));} - -if ~isfield(handles.stageData, 'MarkedEvents') - handles.stageData.MarkedEvents = eventData; -else - handles.stageData.MarkedEvents = [handles.stageData.MarkedEvents; eventData]; -end - -guidata(hObject, handles) -if(length(fields(handles.stageData)) >= 9) - stageData = handles.stageData; - %save(get(handles.stageFileIN, 'String'), 'stageData'); -end - -curX = xlim(handles.axes1); -range = curX(1):curX(2); -handles = plotSleepData(handles, range); - -% --- Executes on button press in delMark. -function delMark_Callback(hObject, eventdata, handles) -% hObject handle to delMark (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) - -cursorData = getCursorInfo(handles.cursor); -label = get(cursorData.Target, 'Tag'); - -index = find(and(strcmp(handles.stageData.MarkedEvents(:,1),label),[handles.stageData.MarkedEvents{:,2}]'==cursorData.Position(1))); -handles.stageData.MarkedEvents(index,:)=[]; - -curX = xlim(handles.axes1); -range = curX(1):curX(2); -handles = plotSleepData(handles, range); -guidata(hObject, handles); - - -% --- Executes on button press in slopeB. -function slopeB_Callback(hObject, eventdata, handles) -% hObject handle to slopeB (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) - -cursorData = getCursorInfo(handles.cursor); -chan = str2double(parseTag(get(cursorData.Target, 'Tag'), 'chan')); -midPt = cursorData.Position(1); - -slopeData = handles.EEG.data(chan, (midPt - .25*handles.EEG.srate):(midPt + .25*handles.EEG.srate)); -xData = ((midPt - .25*handles.EEG.srate):(midPt + .25*handles.EEG.srate))/handles.EEG.srate; -slp = polyfit(xData', slopeData',1); - -set(handles.optText, 'String', sprintf('%.2f', slp(1))) - -%% Notes - -function twinNotes_Callback(hObject, eventdata, handles) -items = get(hObject, 'String'); -val = get(hObject, 'Value'); - -if(strcmp(items{val}, 'Notes')) - set(handles.twinNotesS, 'enable', 'off') - set(handles.browse_note_B, 'enable', 'off') -else - set(handles.twinNotesS, 'enable', 'on') - set(handles.browse_note_B, 'enable', 'on') -end - - -function twinNotesS_Callback(hObject, eventdata, handles) -% hObject handle to twinNotesS (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) - -% Hints: get(hObject,'String') returns contents of twinNotesS as text -% str2double(get(hObject,'String')) returns contents of twinNotesS as a double - - -% --- Executes during object creation, after setting all properties. -function twinNotesS_CreateFcn(hObject, eventdata, handles) -% hObject handle to twinNotesS (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles empty - handles not created until after all CreateFcns called - -% Hint: edit controls usually have a white background on Windows. -% See ISPC and COMPUTER. -if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) - set(hObject,'BackgroundColor','white'); -end - -%% browse files - -% --- Executes on button press in browse_slp_B. -function browse_slp_B_Callback(hObject, eventdata, handles) -% hObject handle to browse_slp_B (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) -[fileName, filePath] = uigetfile({'*.mat','MAT-files (*.mat)'; '*.edf','EDF-files (*.edf)'; '*.set', 'EEGLAB (*.set)'; '*.*', 'All Files (*.*)'}, 'Sleep Data File'); -set(handles.fileIN, 'String', fullfile(filePath,fileName)); - -% --- Executes on button press in browse_stg_B. -function browse_stg_B_Callback(hObject, eventdata, handles) -% hObject handle to browse_stg_B (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) -[fileName, filePath] = uigetfile({'*.mat','MAT-files (*.mat)'; '*.*', 'All Files (*.*)'}, 'Sleep Stage File'); -set(handles.stageFileIN, 'String', fullfile(filePath,fileName)); - -% --- Executes on button press in browse_note_B. -function browse_note_B_Callback(hObject, eventdata, handles) -% hObject handle to browse_note_B (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) -[fileName, filePath] = uigetfile({'*.txt','text files (*.txt)'; '*.*', 'All Files (*.*)'}, 'Sleep Notes File'); -set(handles.twinNotesS, 'String', fullfile(filePath,fileName)); - -%% Menu Items - -% -------------------------------------------------------------------- -function start_m_Callback(hObject, eventdata, handles) -% hObject handle to start_m (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) - - -% -------------------------------------------------------------------- -function chan_m_Callback(hObject, eventdata, handles) -% hObject handle to chan_m (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) - - -% -------------------------------------------------------------------- -function montage_m_Callback(hObject, eventdata, handles) -% hObject handle to montage_m (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) - - -% -------------------------------------------------------------------- -function sleepStats_m_Callback(hObject, eventdata, handles) -% hObject handle to sleepStats_m (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) - - - -% -------------------------------------------------------------------- -function mark_m_Callback(hObject, eventdata, handles) -% hObject handle to mark_m (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) - - -% -------------------------------------------------------------------- -function starMark_m_Callback(hObject, eventdata, handles) -% hObject handle to starMark_m (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) -mark_t_ClickedCallback(handles.mark_t, eventdata, handles) - - -% -------------------------------------------------------------------- -function clearEvents_m_Callback(hObject, eventdata, handles) -% hObject handle to clearEvents_m (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) -% --- Executes on button press in eventClear. -out = inputdlg('Enter event name to clear (e.g. REM):'); -if(~isempty(out)) - event = out{1}; -else - event = ''; -end - -if(isfield(handles.stageData, 'events') && ~isempty(event)) - if(isfield(handles.stageData.events, event)) - handles.stageData.events = rmfield(handles.stageData.events, event); - guidata(hObject, handles) - curX = xlim(handles.axes1); - range = curX(1):curX(2); - handles = plotSleepData(handles, range); - - if(length(fields(handles.stageData)) >= 9) - stageData = handles.stageData; - %save(get(handles.stageFileIN, 'String'), 'stageData'); - end - else - errordlg(['There are no evets called: ', event]); - end -else - errordlg('There are no events in this dataset'); -end - - - -% -------------------------------------------------------------------- -function runStats_m_Callback(hObject, eventdata, handles) -% hObject handle to runStats_m (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) -% --- Executes on button press in statsB.if(~isempty(out)) -sleepStats_woInput(handles.stageData, get(handles.stageFileIN, {'String'})); - -% -------------------------------------------------------------------- -function hideChan_m_Callback(hObject, eventdata, handles) -% hObject handle to hideChan_m (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) -out = inputdlg('Enter the channel to hide (e.g. EMG1):'); -if(~isempty(out)) - chan = out{1}; - handles.hideChans{end + 1} = chan; - guidata(hObject, handles) - curX = xlim(handles.axes1); - range = curX(1):curX(2); - handles = plotSleepData(handles, range); -end - - -% -------------------------------------------------------------------- -function showChan_m_Callback(hObject, eventdata, handles) -% hObject handle to showChan_m (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) -out = inputdlg('Enter the channel to show (e.g. EMG1):'); -if(~isempty(out)) - chan = out{1}; - handles.hideChans(find(strcmp(handles.hideChans, chan))) = []; - guidata(hObject, handles) - curX = xlim(handles.axes1); - range = curX(1):curX(2); - handles = plotSleepData(handles, range); -end - -% -------------------------------------------------------------------- -function nweData_m_Callback(hObject, eventdata, handles) -% hObject handle to nweData_m (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) -set(handles.setupPan, 'Visible', 'on') - -% -------------------------------------------------------------------- -function compScores_m_Callback(hObject, eventdata, handles) -% hObject handle to compScores_m (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) - -% -------------------------------------------------------------------- -function loadComp_Callback(hObject, eventdata, handles) -% hObject handle to loadComp (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) -[fileName, filePath] = uigetfile({'*.mat','MAT-files (*.mat)'; '*.*', 'All Files (*.*)'}, 'Sleep Stage File for Comparison'); -compStage = load(fullfile(filePath,fileName)); -compStages = compStage.stageData.stages; -if(length(compStages) < length(handles.stageData.stages)) - tmp = ones(size(handles.stageData.stages))*7; - tmp(1:length(compStages)) = compStages; - compStages = tmp; -elseif(length(compStages) > length(handles.stageData.stages)) - compStages = compStages(1:length(handles.stageData.stages)); -end -handles.compStage = compStages; -handles.second_stageData = compStage; -handles.showComp = 0; -guidata(hObject, handles) - -% -------------------------------------------------------------------- -function showCompHyp_m_Callback(hObject, eventdata, handles) -% hObject handle to showCompHyp_m (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) -if(~isfield(handles, 'compStage')) - loadComp_Callback(handles.loadComp, eventData, handles); -end -handles.showComp = 1; -guidata(hObject, handles) - -% -------------------------------------------------------------------- -function hideCompHyp_m_Callback(hObject, eventdata, handles) -% hObject handle to hideCompHyp_m (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) -handles.showComp = 0; -guidata(hObject, handles) - -%% Tool Bar Functions -% -------------------------------------------------------------------- -function lightsOff_t_ClickedCallback(hObject, eventdata, handles) -% hObject handle to lightsOff_t (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) -winSize = str2num(get(handles.winIN, 'String')); -srate = handles.EEG.srate; -pt = etime(datevec(handles.stageData.lightsOFF), datevec(handles.stageData.recStart))/60; -ptX = floor(pt(1)*(60/winSize))*winSize*srate; -jumpto(handles, ptX) - -% -------------------------------------------------------------------- -function lightsOn_t_ClickedCallback(hObject, eventdata, handles) -% hObject handle to lightsOn_t (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) -winSize = str2num(get(handles.winIN, 'String')); -srate = handles.EEG.srate; -pt = etime(datevec(handles.stageData.lightsON), datevec(handles.stageData.recStart))/60; -ptX = floor(pt(1)*(60/winSize))*winSize*srate; -jumpto(handles, ptX) - -% -------------------------------------------------------------------- -function jumpTo_ClickedCallback(hObject, eventdata, handles) -% hObject handle to jumpTo (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) -out = inputdlg('Enter Epoch #:'); -if(~isempty(out)) - epoch = out{1}; -else - epoch = ''; -end -if(~isempty(epoch)) - winSize = str2num(get(handles.winIN, 'String')); - srate = handles.EEG.srate; - jumpto(handles, (str2double(epoch) - 1)*winSize*srate) -end - - -% -------------------------------------------------------------------- -function notes_t_ClickedCallback(hObject, eventdata, handles) -% hObject handle to notes_t (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) - -if(strcmp(get(handles.notePan, 'Visible'),'on')) - set(handles.notePan, 'Visible', 'off') -else - set(handles.notePan, 'Visible', 'on') -end - - -% -------------------------------------------------------------------- -function mark_t_ClickedCallback(hObject, eventdata, handles) -% hObject handle to mark_t (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) -% --- Executes on button press in markB. -if(strcmp(get(handles.markStr, 'Enable'), 'on')) - set(handles.markStr, 'Enable', 'off') - set(handles.setMark, 'Enable', 'off') - set(handles.delMark, 'Enable', 'off') - set(handles.slopeB, 'Enable', 'off') -else - set(handles.markStr, 'Enable', 'on') - set(handles.setMark, 'Enable', 'on') - set(handles.delMark, 'Enable', 'on') - set(handles.slopeB, 'Enable', 'on') -end - -datacursormode('toggle'); -handles.cursor=datacursormode(gcf); -set(handles.cursor, 'UpdateFcn', {@cursorInfoUpdate,handles}) -guidata(hObject, handles); - - -% --- Executes on selection change in plotSleepIN. -function plotSleepIN_Callback(hObject, eventdata, handles) -% hObject handle to plotSleepIN (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) - -% Hints: contents = get(hObject,'String') returns plotSleepIN contents as cell array -% contents{get(hObject,'Value')} returns selected item from plotSleepIN -curX = xlim(handles.axes1); -range = curX(1):curX(2); - -plotFCN = get(handles.plotSleepIN, 'String'); -boxInd = get(handles.plotSleepIN, 'Value'); - -eval(['handles.CurrMontage = ',plotFCN{boxInd}, '(handles);']); - -handles = plotSleepData(handles, range); -guidata(hObject, handles); - - -% --- Executes during object creation, after setting all properties. -function plotSleepIN_CreateFcn(hObject, eventdata, handles) -% hObject handle to plotSleepIN (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles empty - handles not created until after all CreateFcns called - -% Hint: popupmenu controls usually have a white background on Windows. -% See ISPC and COMPUTER. -if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) - set(hObject,'BackgroundColor','white'); -end - - -% -------------------------------------------------------------------- -function info_m_Callback(hObject, eventdata, handles) -% hObject handle to info_m (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) - - -% -------------------------------------------------------------------- -function aInfo_m_Callback(hObject, eventdata, handles) -% hObject handle to aInfo_m (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) -msg = sprintf(['Program Authors: Jared M. Saletin, PhD & Stephanie M. Greer, PhD \n\n',... - 'In association with:\n\n', ... - 'Sleep for Science Research Laboratory (PI: Mary A. Carskadon, PhD)\n', ... - 'Department of Psychiatry and Human Behavior\n', ... - 'Alpert Medical School of Brown University\n\n', ... - 'Sleep and Neuroimaging Laboratory (PI: Matthew P. Walker, PhD)\n', ... - 'Helen Wills Neuroscience Institute\n', ... - 'Department of Psychology \n', ... - 'University of California Berkeley\n\n', ... - 'Contact: jared_saletin@brown.edu\n', ... - 'https://sourceforge.net/projects/sleepsmg']); -msgbox(msg, 'Author Info'); - - -% -------------------------------------------------------------------- -function hKeysInfo_m_Callback(hObject, eventdata, handles) -% hObject handle to hKeysInfo_m (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) -msg = sprintf(['To use keyborad for scoring first click anywhere on the window that does not contain an object.\n\n',... - 'Short Cuts:\n', ... - '0 - Stage Wake\n', ... - '1 - Stage 1 \n', ... - '2 - Stage 2\n', ... - '3 - Stage 3\n', ... - '3 - Stage 4\n', ... - '5 - Stage REM\n', ... - '6 - Movement Time\n', ... - '. - Mark epoch as anomolous/unscored\n', ... - '7 - scroll to the left\n', ... - '9 - scroll to the right\n\n', ... - 'CTRL-o - Import/Open New Dataset\n', ... - 'CTRL-s - Save Dataset\n', ... - 'CTRL-r - Perform Sleep Statistics\n', ... - 'CTRL-e - Toggle Event Mode On/Off\n', ... - '*The keyboard short cuts will not work when event marking mode is turned on.']); -msgbox(msg, 'Hot Keys'); - - -% -------------------------------------------------------------------- -function saveData_m_Callback(hObject, eventdata, handles) -% hObject handle to saveData_m (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) -stageData=handles.stageData; -save(get(handles.stageFileIN, 'String'), 'stageData'); -msgbox('Save Complete'); - - -% -------------------------------------------------------------------- -function editMontage_Callback(hObject, eventdata, handles) -% hObject handle to editMontage (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) -if isfield(handles,'EEG') - [output mont] = sleepMontageEditor(handles); - - handles.CurrMontage.colors = mont.colors; - handles.CurrMontage.electrodes = mont.electrodes; - handles.CurrMontage.bigGridMat = mont.bigGridMat; - handles.CurrMontage.hideChans = mont.hideChans; - handles.CurrMontage.scaleChans = mont.scaleChans; - handles.CurrMontage.scale = mont.scale; - - curX = xlim(handles.axes1); - range = curX(1):curX(2); - - handles = plotSleepData(handles, range); - guidata(hObject, handles); - -else - errordlg('No EEG file loaded, please load data and re-open Montage Editor', 'Húmë Montage Editor'); - -end - - - -% -------------------------------------------------------------------- -function runStatsWOinput_2_Callback(hObject, eventdata, handles) -% hObject handle to runStatsWOinput_2 (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) -sleepStats; - - -% -------------------------------------------------------------------- -function createMontage_Callback(hObject, eventdata, handles) -% hObject handle to createMontage (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) -sleepMontageCreator; - - -% -------------------------------------------------------------------- -function runReliability_Callback(hObject, eventdata, handles) -% hObject handle to runReliability (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) -sleepReliability; - - -% -------------------------------------------------------------------- -function editMontage_ClickedCallback(hObject, eventdata, handles) -% hObject handle to editMontage (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) -editMontage_Callback(hObject,eventdata, handles); - - -% -------------------------------------------------------------------- -function runStats_ClickedCallback(hObject, eventdata, handles) -% hObject handle to runStats (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) -sleepStats_woInput(handles.stageData, get(handles.stageFileIN, {'String'})); - - -% -------------------------------------------------------------------- -function saveData_ClickedCallback(hObject, eventdata, handles) -% hObject handle to saveData (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) -saveData_m_Callback(hObject, eventdata, handles); - -% -------------------------------------------------------------------- -function openData_ClickedCallback(hObject, eventdata, handles) -% hObject handle to openData (see GCBO) -% eventdata reserved - to be defined in a future version of MATLAB -% handles structure with handles and user data (see GUIDATA) -set(handles.setupPan, 'Visible', 'on') +sleepScoring \ No newline at end of file