Commit 93919426 authored by Jay Dubb's avatar Jay Dubb
Browse files

v1.31.3

-- Some improvements to and clean up of utility functions. Also allow ConfigFileClass file to have empty parameter values.
-- Add DataTree design to Design document and organize the whole thing into sections for more clarity.
-- Fix small issue with Registry FuncRegClass not having correct file paths for Archived user functions
parent eacbea8e
Loading
Loading
Loading
Loading
−3.67 KiB (35 KiB)

File changed.

No diff preview for this file type.

+274 KiB (1.58 MiB)

File changed.

No diff preview for this file type.

+12 −9
Original line number Diff line number Diff line
@@ -95,7 +95,7 @@ classdef FuncRegClass < matlab.mixin.Copyable
                    progressmsg = sprintf('Parsing %s', files{jj}(ii).name);
                    fprintf('%s\n', progressmsg);
                    waitbar_improved(kk/N, h, sprintf(progressmsg));
                    obj.AddEntry(files{jj}(ii).name);
                    obj.AddEntry(files{jj}(ii).name, jj);
                    kk = kk+1;
                end
            end
@@ -106,8 +106,11 @@ classdef FuncRegClass < matlab.mixin.Copyable
        

        % -------------------------------------------------------------------------------
        function err = AddEntry(obj, funcname)
        function err = AddEntry(obj, funcname, jj)
            err = 0;
            if nargin<3
                jj = 1;
            end
            idx = obj.GetIdx(funcname);
            if ~isempty(idx)
                q = menu('Function entry already exists in registry. Do you want to reload it?', 'YES','NO');
@@ -119,7 +122,7 @@ classdef FuncRegClass < matlab.mixin.Copyable
            if tmp.IsValid()
                idx = length(obj.entries)+1;
                obj.entries(idx) = FuncRegEntryClass(tmp);
                obj.userfuncfiles{idx} = [obj.userfuncdir{1}, funcname];
                obj.userfuncfiles{idx} = [obj.userfuncdir{jj}, funcname];
            else
                fprintf('  Discarding %s. Function is not valid registry entry.\n', tmp.name)
            end
+39 −14
Original line number Diff line number Diff line
@@ -1566,6 +1566,7 @@ end
Display(handles, hObject);



% --------------------------------------------------------------------
function checkboxExcludeStims_Callback(hObject, eventdata, handles)
global maingui
@@ -1592,6 +1593,7 @@ end
Display(handles, hObject);



% --------------------------------------------------------------------
function ExcludeTime_ButtonDownFcn(hObject, eventdata, handles)
global maingui
@@ -1625,6 +1627,7 @@ end
Display(handles, hObject);



% --------------------------------------------------------------------
function ExcludeStims_ButtonDownFcn(hObject, eventdata, handles)
global maingui
@@ -1652,6 +1655,7 @@ end
Display(handles, hObject);



% --------------------------------------------------------------------
function checkboxShowExcludedTimeManual_Callback(hObject, eventdata, handles)

@@ -1662,6 +1666,7 @@ end
Display(handles, hObject);



% --------------------------------------------------------------------
function checkboxShowExcludedTimeAuto_Callback(hObject, eventdata, handles)

@@ -1672,6 +1677,7 @@ end
Display(handles, hObject);



% --------------------------------------------------------------------
function checkboxShowExcludedTimeAutoByChannel_Callback(hObject, eventdata, handles)

@@ -1682,6 +1688,7 @@ end
Display(handles, hObject);



% --------------------------------------------------------------------
function menuItemExportHRF_Callback(hObject, eventdata, handles)
global maingui
@@ -1700,6 +1707,7 @@ end
maingui.dataTree.currElem.ExportHRF(procElemSelect);



% --------------------------------------------------------------------
function menuItemExportSubjHRFMean_Callback(hObject, eventdata, handles)
global maingui
@@ -1736,7 +1744,7 @@ cfg.Close();


% --------------------------------------------------------------------
function menuItemPowerSpectrum_Callback(hObject, eventdata, handles)
function menuItemPowerSpectrum_Callback(~, ~, ~)
% hObject    handle to menuItemPowerSpectrum (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
@@ -1781,7 +1789,7 @@ end


% -------------------------------------------------------------------------------
function togglebuttonMinimizeGUI_Callback(hObject, eventdata, handles)
function togglebuttonMinimizeGUI_Callback(hObject, ~, handles)
u0 = get(handles.MainGUI, 'units');
k = [1.0, 1.0, 0.8, 0.8];
p0 = get(handles.MainGUI, 'position');
@@ -1805,11 +1813,12 @@ end
pause(.2)
set(handles.MainGUI, 'position', p);
rePositionGuiWithinScreen(handles.MainGUI);
MainGUI_EnableDisableGUI(handles, 'on')



% -------------------------------------------------------------------------------
function pushbuttonResetExcludedTimeCh_Callback(hObject, eventdata, handles)
function pushbuttonResetExcludedTimeCh_Callback(hObject, ~, handles)
global maingui
if isa(maingui.dataTree.currElem, 'RunClass')
    ch = MenuBox('Are you sure you would like to re-enable all excluded channels, stims, and time points?',{'Yes','No'});
@@ -1829,8 +1838,10 @@ else
    errordlg('Select a run to reset its excluded channels and time points.','No run selected');
end



% --------------------------------------------------------------------
function menuItemSegmentSnirf_Callback(hObject, eventdata, handles)
function menuItemSegmentSnirf_Callback(~, ~, handles)
global maingui;
if maingui.dataTree.IsFlatFileDir()
    MessageBox('Segment Tool does not support flat file directories yet, please change to a deep directory style (using sub-directories for groups and subjects) to use the segment tool via Homer3');
@@ -1845,8 +1856,9 @@ end
DisplayGroupTree(handles);



% --------------------------------------------------------------------
function menuItemDownsampleSnirf_Callback(hObject, eventdata, handles)
function menuItemDownsampleSnirf_Callback(~, ~, handles)
global maingui;
if maingui.dataTree.IsFlatFileDir()
    MessageBox('Downsample Tool does not support flat file directories yet, please change to a deep directory style (using sub-directories for groups and subjects) to use the downsample tool via Homer3');
@@ -1860,16 +1872,20 @@ for iG = 1:length(maingui.dataTree.groups)
end
DisplayGroupTree(handles);



% --------------------------------------------------------------------
function menuItemExportProcessingStreamScript_Callback(hObject, eventdata, handles)
function menuItemExportProcessingStreamScript_Callback(~, ~, ~)
global maingui
fname = uiputfile('*.m', 'Export Processing Stream to Script (.m)', 'processing_stream.m');
if fname ~= 0
    exportProcessScript(fname, maingui.dataTree.currElem.procStream);
end



% --------------------------------------------------------------------
function panProbeCallback(hObject, eventdata, handles)
function panProbeCallback(hObject, ~, handles)
global maingui;
axes(handles.axesSDG)
xrange = xlim();
@@ -1894,8 +1910,9 @@ elseif get(hObject,'string')=='\/'
end



% --------------------------------------------------------------------
function zoomInCallback(hObject, eventdata, handles)
function zoomInCallback(~, ~, handles)
global maingui;
axes(handles.axesSDG)
axes(handles.axesSDG)
@@ -1909,8 +1926,10 @@ ylim( [yrange(1)+yd/10 yrange(2)-yd/10] );
maingui.axesSDG.xlim = [xrange(1)+xd/10 xrange(2)-xd/10];
maingui.axesSDG.ylim = [yrange(1)+yd/10 yrange(2)-yd/10];



% --------------------------------------------------------------------
function zoomOutCallback(hObject, eventdata, handles)
function zoomOutCallback(~, ~, handles)
global maingui;
axes(handles.axesSDG)
axes(handles.axesSDG)
@@ -1923,8 +1942,10 @@ ylim( [yrange(1)-yd/10 yrange(2)+yd/10] );
maingui.axesSDG.xlim = [xrange(1)-xd/10 xrange(2)+xd/10];
maingui.axesSDG.ylim = [yrange(1)-yd/10 yrange(2)+yd/10];



% --------------------------------------------------------------------
function resetProbeViewCallback(hObject, eventdata, handles)
function resetProbeViewCallback(~, ~, handles)
global maingui;
axes(handles.axesSDG)
bbox = maingui.dataTree.currElem.GetSdgBbox();
@@ -1933,13 +1954,16 @@ ylim( bbox(3:4) );
maingui.axesSDG.xlim = bbox(1:2);
maingui.axesSDG.ylim = bbox(3:4);



% --------------------------------------------------------------------
function menuItemAppConfigGUI_Callback(hObject, eventdata, handles)
function menuItemAppConfigGUI_Callback(~, ~, ~)
configSettingsGUI();



% ------------------------------------------
function callbacks = UnitTestInit(handles) %#ok<DEFNU,STOUT>
function callbacks = UnitTestInit(handles)
fields = propnames(handles);
for ii = 1:length(fields)
    callbackName = '';
@@ -1973,7 +1997,7 @@ callbacks.radiobuttonProcTypeRun = @uipanelProcessingType_SelectionChangeFcn;


% --------------------------------------------------------------------
function menuItemPowerSpectrum_Loglog_Callback(hObject, eventdata, handles)
function menuItemPowerSpectrum_Loglog_Callback(~, ~, ~) %#ok<*DEFNU>
% hObject    handle to menuItemPowerSpectrum (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
@@ -2014,3 +2038,4 @@ if n_channels > 0
else
    errordlg('Cannot calculate power spectra with no channels selected.', 'No channels selected'); 
end
+3 −0
Original line number Diff line number Diff line
@@ -374,6 +374,9 @@ classdef ConfigFileClass < FileClass
            end
            for ii=1:length(obj.sections)
                if strcmp(obj.sections(ii).name, section)
                    if isempty(obj.sections(ii).val)
                        return;
                    end
                    val = obj.sections(ii).val{1};
                end
            end
Loading