Unverified Commit a6798fa1 authored by Christian Arthur's avatar Christian Arthur Committed by GitHub
Browse files

Main GUI Updates (#57)



* Updated DesignNotes.ppt

* Update 1
Added Zoom and Pan functionality to axesSDG (probe display) on the MainGUI with additional buttons in the GUI

* Update 1.1
Minor Zoom adjustments

* Update 1
- Revert Clear Axes update to fix probe plot refresh issue (causing other errors)
- Adjusted units to appear for subject and group data

* Mini Fix
- DisplayAxesSDG.m file sync

* Condition - Unit Problem Fix
- Fix mistake on relating ppf with conditions

* Display Update
- Homer3 display to stay bold (continuous line) if only one wavelength is selected

* Power Spectrum Plot Update
- Updated menu to enable double log plots (dB vs x in logarithmic scale)

* Fix Copy Plot Display
- Fixed issue where the channels in MainGUI are deleted from generating a copy plot
- Fixed issue where the channel and SD handles are rewritten to that of the copy plot

* Mini Fix
- Adjust SD handle assignment when copying plot to a new figure

* Update hmrG_SubjAvg.m

FIX; When a subject had nan values on a channel/sbj, the group result ended being nan, even though the rest of the sbjs are good. Homer2 was unconsciously dealing with this issue by pruning outliers from group with a preset threshold. Since we do not have that feature in homer3, the issue came up. Issue is fixed now by identifying those channels with nan and removing them from group averaging.

* Update hmrR_MotionCorrectSplineSG.m

Help of the function is modified to include the proper citation and more details on the parameters.

* Session level GLM

Adding hmrS_GLM which gets all run level data from a single subject and concatenates them. The new design matrix has HRF regressors common to all runs but have separate regressors for the rest of the model (e.g. drift, short separation).

* Update hmrS_GLM.m

Fix on contrast estimation from the concatenated GLM.

* Update hmrS_GLM.m

Updating the help of the function

* tstats for iRML

Adding tstats per condition and per contrast for the iterative restricted maximum likelihood method from Barker, BOE, 2013.

* Stim GUI interface changes (#47)

* prevented ArgClass Extract from indexing into empty list

* FuncCallClass GetInputs and GetOutputs convenience function for returning strings

* GetProcInputs method returns all properties of ProcInputClass for use with proc stream checking

* Processing stream is only run if Check returns zero, else an error msg is raised

* Changed uses of properties to propnames in ProcInputClass GetProcInputs

* Added removal and addition of stim data columns and interface in StimEditGUI; added dialog box for setting amp, duration, and values for new stims

* Added rename column interface

* GUI updates: column interface changed, rename condition moved to menubar -> tools

* Tooltip to manual edit, exit condition for value entry prompt

* Generate filters with butter interface, error checking

* Logic to prevent button presses when no conditions are present

* Removed rename cond and add/delete/rename column GUI options because they result in undefined behavior

* User function improvements (#53)

* prevented ArgClass Extract from indexing into empty list

* FuncCallClass GetInputs and GetOutputs convenience function for returning strings

* GetProcInputs method returns all properties of ProcInputClass for use with proc stream checking

* Processing stream is only run if Check returns zero, else an error msg is raised

* Changed uses of properties to propnames in ProcInputClass GetProcInputs

* tCCAaux_inx is a list again as variable length parameters are supported

* Standardized tIncMan, mlActAuto in code

* Properly generate the tIncCh matrix if it is not provided

* Include mlActAuto and tIncAuto in PCA motion correction

* recurse updated to work with new function inputs

* mlActMan and mlActAuto both used for wavelet correction

* OD2Conc wavelength restriction removed

* Phase out old GLM for new stim GLM, suppress a line in errchk

* Prevent stim amps getter from crashing on empty data

* Removed registry from PR

* Update Power Spectrum Tool
- Adjust method to obtain time series data
- Enable tool for run class only

* Deleted Log and .dat files

* Clean Up
- Adjusted SubjClass.m, hmrR_GLM.m to sync with the development branch
- Deleted the previously pulled hmrS_GLM.m (from a reverted merge)

* Mini Fix
- Pushed wrong copy of hmrR_GLM.m, fixed issue

Co-authored-by: default avatarMeryem Ayse Yucel <49535526+mayucel@users.noreply.github.com>
Co-authored-by: default avatarstephen scott tucker <sstucker@bu.edu>
parent 2774c2ad
Loading
Loading
Loading
Loading

Homer3.log

deleted100644 → 0
+0 −50
Original line number Diff line number Diff line

March 24, 2021, 13:27:41
Running Homer3 v1.31.2, R2019b

============
SYSTEM INFO:
============
Platform Arch  : PCWIN64
RAM Total      : 17.1 GB
RAM Free       : 6.3 GB
HD Space Total : 482.8 GB
HD Space Free  : 180.8 GB

Opened application config file C:/Users/mayucel/Documents/PROJECTS/CODES/Homer3_Meryem_fork/Homer3/AppSettings.cfg

MainGUI: March 24, 2021, 13:27:43 -  Will load group folder #1 - C:/Users/mayucel/Documents/PROJECTS/FNIRS TEST DATA/mci/Subj1/

Current GroupClass version 1.2
DataTreeClass.FindAndLoadGroups: Found 2 data files in 1 folders
Current GroupClass version 1.2

Added group Subj1 to dataTree.
   Added subject run1_seq1 to group Subj1.
     Added run run1_seq1.snirf to subject run1_seq1.
   Added subject run2_seq2 to group Subj1.
     Added run run2_seq2.snirf to subject run2_seq2.

Loaded acquisition data in 2.2 seconds

Saved group data, version 1.2 exists
Loaded data set in 3.6 seconds
Loaded saved registry C:/Users/mayucel/Documents/PROJECTS/CODES/Homer3_Meryem_fork/Homer3/FuncRegistry/UserFunctions/Registry.mat
Displaying channels [] in data blocks [1]

Logger: Chapter 1

MainGUI: March 24, 2021, 13:27:59 - Startup time - 16.1 seconds

Displaying channels [] in data blocks [1]
Processing iGroup=1, iSubj=1, iRun=1
Processing iGroup=1, iSubj=1, iRun=0
Processing iGroup=1, iSubj=2, iRun=1
Processing iGroup=1, iSubj=2, iRun=0
Processing iGroup=1, iSubj=0, iRun=0
Saving group 1 in C:/Users/mayucel/Documents/PROJECTS/FNIRS TEST DATA/mci/Subj1/groupResults.mat
Saving processed data in C:/Users/mayucel/Documents/PROJECTS/FNIRS TEST DATA/mci/Subj1/groupResults.mat
Auto-saving processing results ...
Current GroupClass version 1.2
Completed saving groupResults.mat for all groups in 1.912 seconds.
Displaying channels [] in data blocks [1]

LastCheckForUpdates.dat

deleted100644 → 0
+0 −1
Original line number Diff line number Diff line
24-Mar-2021 13:27:42
+8 −4
Original line number Diff line number Diff line
@@ -80,7 +80,7 @@ end
axes(hAxes);

% Delete all channel lines drawn
if ishandles(maingui.axesSDG.handles.ch)
if ishandles(maingui.axesSDG.handles.ch) && (maingui.axesSDG.handles.axes == hAxes)
    delete(maingui.axesSDG.handles.ch)
    delete(findobj(hAxes, 'Type', 'line'))  % Prevents previously drawn lines from piling up
end
@@ -184,11 +184,13 @@ if ~isempty(iSrcDet) && iSrcDet(1,1)~=0
    
end

if (maingui.axesSDG.handles.axes == hAxes)
    maingui.axesSDG.handles.ch = hCh;
end

% ADD SOURCE AND DETECTOR LABELS
hSD = zeros(nSrcs+nDets,1);
if isempty(maingui.axesSDG.handles.SD)
if isempty(maingui.axesSDG.handles.SD) || (maingui.axesSDG.handles.axes ~= hAxes)
    for idx1 = 1:nSrcs
        if ~isempty(find(MeasList(:,1)==idx1)) %#ok<*EFIND>
            hSD(idx1) = text( SD.SrcPos(idx1,1), SD.SrcPos(idx1,2), sprintf('%d', idx1), 'fontsize',fs, 'fontweight','bold', 'color','r' );
@@ -201,7 +203,9 @@ if isempty(maingui.axesSDG.handles.SD)
            set(hSD(idx2+idx1), 'ButtonDownFcn',get(hAxes,'ButtonDownFcn'), 'horizontalalignment','center', 'edgecolor',edgecol, 'Clipping', 'on');
        end
    end
    if (maingui.axesSDG.handles.axes == hAxes)
        maingui.axesSDG.handles.SD = hSD;
    end
else
    uistack(nonzeros(maingui.axesSDG.handles.SD),'top')
end
+1.33 KiB (95.9 KiB)

File changed.

No diff preview for this file type.

+55 −2
Original line number Diff line number Diff line
@@ -413,6 +413,11 @@ switch(proclevel)
        maingui.dataTree.SetCurrElem(iGroup, iSubj, iRun);
end
[iGroup, iSubj, iRun] = maingui.dataTree.GetCurrElemIndexID();
if iRun == 0
    set(handles.menuItemPowerSpectrum, 'enable', 'off')
else
    set(handles.menuItemPowerSpectrum, 'enable', 'on')
end
listboxGroupTree_Callback([], [iGroup,iSubj,iRun], handles)
Display(handles, hObject);

@@ -1741,8 +1746,13 @@ n_channels = length(iCh);
if n_channels > 0
    iSrcDet = maingui.axesSDG.iSrcDet;
    colors = maingui.axesSDG.linecolor;
    d = maingui.dataTree.currElem.acquired.data.dataTimeSeries;
    sf = maingui.dataTree.currElem.acquired.data.time(2) - maingui.dataTree.currElem.acquired.data.time(1);
    d = maingui.dataTree.currElem.GetDataTimeSeries();
    t = maingui.dataTree.currElem.GetTime();
    if isempty(t)
        msgbox('Power Spectrum Plot Tool unavailable for subject and group class');
        return;
    end
    sf = t(2)-t(1);
    fs = 1/sf;
    try
       close(maingui.spectrumFigureHandle);
@@ -1961,3 +1971,46 @@ callbacks.radiobuttonProcTypeSubj = @uipanelProcessingType_SelectionChangeFcn;
callbacks.radiobuttonProcTypeRun = @uipanelProcessingType_SelectionChangeFcn;



% --------------------------------------------------------------------
function menuItemPowerSpectrum_Loglog_Callback(hObject, eventdata, handles)
% 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)
global maingui;
iCh = maingui.axesSDG.iCh;
n_channels = length(iCh);
if n_channels > 0
    iSrcDet = maingui.axesSDG.iSrcDet;
    colors = maingui.axesSDG.linecolor;
    d = maingui.dataTree.currElem.GetDataTimeSeries();
    t = maingui.dataTree.currElem.GetTime();
    if isempty(t)
        msgbox('Power Spectrum Plot Tool unavailable for subject and group class');
        return;
    end
    sf = t(2)-t(1);
    fs = 1/sf;
    try
       close(maingui.spectrumFigureHandle);
    catch
    end
    maingui.spectrumFigureHandle = figure('NumberTitle', 'off', 'Name', 'PSD of selected channels');
    n = 3;
    m = ceil(n_channels / n);
    for i = 1:n_channels
        % 100 sec window with 50% overlap
        window = floor(100 / sf);
        overlap = window / 2;
        bins = 2048;
        [pxx,f] = pwelch(d(:,iCh(i)), window, overlap, bins, fs);
        subplot(m,n,i);
        semilogx(f, 10*log10(pxx), 'Color', colors(i,:));
        title([num2str(iSrcDet(i,1)), ' \rightarrow ', num2str(iSrcDet(i,2))]);
        xlim([0,fs/2]);
        xlabel(sprintf('Frequency (Hz)'));
        ylabel(sprintf('PSD (dB)\n'));
    end
else
    errordlg('Cannot calculate power spectra with no channels selected.', 'No channels selected'); 
end
 No newline at end of file