Skip to content

Commit 93401dc

Browse files
committed
Merge in development branch v1.54.0 using squashed commit of the following:
commit 9cce6bf Author: jayd1860 <[email protected]> Date: Thu Oct 6 00:38:59 2022 -0400 v1.54.0 -- Fix another channel order issue in DataClass.GetDataTimeSeries() found by Yuanyuan whenm running processing stream with hmrR_MotionCorrectSplineSG -- Minor addition to OpenFileGUI.m of keys to ignore ('home' and 'end') when navigating folders on MAC commit 3c514bb Author: jayd1860 <[email protected]> Date: Wed Sep 28 16:45:33 2022 -0400 v1.53.0 (#145) -- Sync Homer3 with the DataTree library modifications that make it standalone (if dependencies Utils and FuncRegistry are included) -- Fix typo in syncSubmodules preventing synchronization with libraries and add '.fig' type files that can be synced commit 890a798 Merge: b7b074e 52ec620 Author: jayd1860 <[email protected]> Date: Thu Sep 22 20:24:09 2022 -0400 Merge branch 'master' into development commit b7b074e Merge: 6831303 ae84fea Author: jayd1860 <[email protected]> Date: Thu Sep 22 19:20:59 2022 -0400 Merge jayd1860\homer3 into development: v1.52.0 -- Fix an issue in building and installing executable on MAC. -- Improve OpenFileGUI for opening processOpt config file on MAC. commit ae84fea Author: Jay Dubb <[email protected]> Date: Thu Sep 22 18:46:42 2022 -0400 v1.52.0 -- Fix an issue in building and installing executable on MAC. -- Improve OpenFileGUI for opening processOpt config file on MAC. commit 6831303 Author: jayd1860 <[email protected]> Date: Tue Sep 20 16:17:17 2022 -0400 Redo retrieval of measurement list, dataTimeSeries and mlAct to fix major issues with incorrect sorting of data. (#141) * v1.39.0 -- Fix matlab generated error displaying measurement list visible channels. Take MeasListVis field out of processing stream input (ProcInputClass) since it does not actually contribute to proc stream processing and move it to TreeNodeClass field chVis. * v1.40.0 -- Fix major issue with incorrect sorting of data and measurement list. -- Change unit tests to include wavelength when scrambling channel order. Also make scrambling for unit tests an option * v1.40.1 -- Add back display of standard error bars, and x and y-axis labels to MainGUI data display. -- Fix current element condition name display being cut off in PlotProbeGUI.m * -- Fix bug in shared lib synching code which incorrectly ignores differences in files with .cfg extensions thus ignoring differences in AppSettings.cfg * v1.41.0 -- Add ability to plot selected measurements in exported HRF file from ExportDataGUI -- In ConfigFileClass exclude AppSettings.cfg in submodules folder under Homer3 root folder * v1.42.0 -- Fix issue with probe.snirf or any other snirf files with no data or intentionally corrupt data being accepted as valid. -- Fix Nirs2Snirf not working for some some .nirs datasets which do not have CondNames. Add default CondNames to NirsClass.ErrorCheck() -- Fix display of mlAct in MainGUI broken after the measurement list order issue. -- For diagnostic purposes save error code in err field of all the SnirfClass sub-classes -- Add back to MainGUI making channels invisible by mouse right-clicking on them. * v1.42.1 -- Fix bug removing channels from display by mouse right-clicking in MainGUI axesSDG. Fixed incorrect distance criteria for source and detector from end points on clicked line. * v1.42.2 -- Fix error when loading snirf with corrupt stim data. Added error checking to flag bad stim data. Then add file with bad stim data and discard bad stims while displaying warning. -- Improve warning reporting for files that were allowed to load but with warnings. -- Fix matlab error in backward compatability code when derived output folder is same as root group folder * -- Log the current processing stream function call chain every time RUN button is clicked in MainGUI to generate derived data. -- Minor code formatting in SubjClass.m * v1.42.4 -- Fix bugs found by Meryem in fNIRS 2018 course SS_DEMO_1, Finger_Tapping_*.snirf. Errors when running processing stream in 1. hmrR_MotionArtifact fixed by getting rid of 'reshape' option to DataTimeSeries() 2. hmrR_OD2Conc.m fixed by getting rid of 'reshape' option to DataTimeSeries() 3. hmrR_GLM.m fixed in DataClass.m by NOT assuming source and detector indices do not skip numbers -- Just like for hmrR_MotionArtifact.m no need to reshape for hmrR_MotionArtifactByChannel.m since the -- Better error/warning logging in DataFilesClass.m and FileLoadSaveClass.m * v1.43.0 -- Set inactive channel data to NaN. That way they don't show up in MainGUI display. Implement this in DataClass: inactive channel is a channel for which all data is exactly zero (not approximately zero). -- Fix an issue in ProbeClass which incorrectly upload sourcePos3D or detectorPos3D as a column vector IF AND ONLY IF it is the ONLY optode in the probe. This leads to incorrect result in at least one user function processing hmrR_OD2Conc in which the calculation of rho is sensitive to row vs column vector. -- Fix several issues in incorrect unit tests results for Example9_SessRuns because of file naming in Simple_Probe_run* which contains '_' between Simple and Probe which are interpreted as a subject and session name. This is not how the original .nirs benchmark was processed based on the Simple_Probe*_. In order to match the original subject/session breakdown need to get rid of '_'. -- Fix another unit test bug which has to load saved derived data in compareDcAvg.m before comparing to benchmark. -- Fix another unit test bug in unitTest_BandpassFilt_LPF.m lpf wasn't being changed no matter what the value was because hmrR_BandpassFilter() changed to hmrR_BandpassFilter_old() -- Add to unit tests simulation of occasional random errors (simulateDataError.m and generateErrorOddsConstant.m) to do a check of whether the unit test is really checking data against the benchmark correctly. * -- Fix bug in SnirfClass .snirf file fomat conversion to NirsClas .nirs. -- Set default simulation of errors to none in UnitTests_Init.m -- Add namespace DataTreeClass to shared library Utils function points_on_line.m * v1.44.0 -- Fix ordering issue with active/inactive (mlAct) channels in user functions and MainGUI display. Use sources, detectors, wavelength matrix rather than a logical vector. -- When manually pruning channel only prune at the current wavelength. -- Implement missing application of active/inactive (mlAct) channels at the higher averaging user functions: hmrE_RunAvg.m, hmrG_SubjAvg.m, hmrS_SessAvg.m -- Fix incorrect nTrials calculation at the group level -- Fix PlotProbeGUI/plotProbe.m display issue as a result of fixing the MeasList ordering issue. * v1.45.0 -- Fix bug in channel exclusion in hmrR_PruneChannels.m -- Fix display of manually pruned channels in DisplayAxesSDG.m * v1.46.0 -- Fix plotProbe.m by rewriting the plotting to be based on SNIRF style 2D measurement list rather than .nirs era wavelength based measurement. * v1.47.0 -- Fix mlAct in hmrR_tCCA.m -- In PlotProbeGUI get condition dynamically from parent gui, that is MainGUI -- In PlotProbeGUI.m add back ability to display OD HRF and also any data type that is currently selected in MainGUI * v1.48.0 -- Fix very slow processing at the group, subject and session levels and slow display. All were caused by the same issue: very inefficient DataClass.GetDataTimeSeries('reshape') method. Changed it's code to be much more efficient. -- Fix typo in plotProbeAndSetProperties.m causing matlab-generated error -- Minor improvement to display of location of current processing in MainGUI listboxGroupTree when calculating provcessing stream * v1.48.1 -- Fix typo in hmrR_MotionCorrectWavelet.m causing matlab-generated exception -- More fixes in user functions hmrR_MotionArtifactByChannel.m and hmrR_MotionCorrectCbsi.m of inactive channels mlAct -- Added another performance enhancer in DataClass.GetDataTimeSeries() to speed up retrieval of measurement list and thus data time series. Added cache for measurement list matrix to avoid recalculating it. * v1.48.2 -- Capture and log to log file the function call stack when exception error occurs while running processing stream. * v1.48.3 -- Fix some child gui repositioning issues when MainGUI is upodated especially ProcStreamOptionsGUI -- Don't redisplay ProcStreamOptionsGUI if function call list is exactly same as last time. * v1.48.4 -- Fix time exclusion and motion correction by channel having incorrect channel order. Modify tIncCh to include measurement list info about sources, detectors and data type. -- Fix display of time exclusion and motion correction by channel showing incorrect channels. Clean up and rewrite DisplayExcludedTime() function. -- Improve speed of display function GetMeasurementList to use ml matrices instead of structures. Change definitions of GetMeasurementList() functions to be uniform and compatible with each other up and down the call stack, as well as having separate arguments for matrixOption ('matrix') and dataType ('dod', 'dc', dcAvg', etc). -- Minor graphics adjustment to MainGUI datatype listboxes for wavelength and HbType to be exactly overlapping * v1.50.0 -- Fix another channel order bug in DataClass.GetDataTimeSeries. order need to match linear order when squeezing dimensions > 1 into 1D. This caused incorrect results to be displayed for concentration HbT after running hmrR_MotionCorrectCbsi -- Fix minor display issue in MainGUI.m icorrectly enabling OD and concentration radio buttons even though no results exists. -- Add diagnostic/debug functions to unit test to generate simulated data time series whose data identifies the channel it originated in. * v1.51.0 -- Fix channel order issues excluded time by channel in hmrR_MotionCorrectSplineSG. Change GetDataTimeSeries to return measurement list associated with the data time series as well as adding other options to control channel order. -- Fix matlab exception bug in plot probe when clicking non-run, non-hrf data in MainGUI. Fix in plotProbeAndSetProperties.m, updateData() function which was cleaned up in addition to fixing problem. -- Fix incomplete isequal method in ProcStreamClass comparing 2 objects. This caused active ProcStreamOptionsGUI not to update correctly when removing function from function call chain in ProcStreamEditGUI. -- Fix issue in SubjClass when processing multiple sessions incorrectly adding trials from all the sessions. * v1.51.1 -- Fix matlab exception in hmrR_MotionCorrectCbsi.m because call to GetDataTimeSeries method was not updated to match new function definition. -- MainGUI and PlotProbeGUI/plotProbe.m display improvements: thinner data plot lines, exclude time patches incorrectly changing y lim. * v1.51.2 -- Fix matlab exception in hmrR_MotionCorrectSplineSG because of typo missing 'matrix' argument in GetMeasurementList(). hmrR_MotionCorrectSplineSG expects measurement list in matrix form rather than structure. * Diagnostic code which does not effect main Homer3 operation (so version number stays the same): -- Change generateSimData.m to include all data files in a group. This function replaces the files real data with fake data that has the channel ID (source idx, detector index, data type idx, condition idx) embedded in the data itself for diagnosing/uncovering channel order issues. -- Add more sim data user functions commit 3084e2d Author: jayd1860 <[email protected]> Date: Mon Sep 19 10:19:38 2022 -0400 Diagnostic code which does not effect main Homer3 operation (so version number stays the same): -- Change generateSimData.m to include all data files in a group. This function replaces the files real data with fake data that has the channel ID (source idx, detector index, data type idx, condition idx) embedded in the data itself for diagnosing/uncovering channel order issues. -- Add more sim data user functions commit c93071f Author: jayd1860 <[email protected]> Date: Fri Sep 16 13:18:49 2022 -0400 v1.51.2 -- Fix matlab exception in hmrR_MotionCorrectSplineSG because of typo missing 'matrix' argument in GetMeasurementList(). hmrR_MotionCorrectSplineSG expects measurement list in matrix form rather than structure. commit d3d8132 Author: jayd1860 <[email protected]> Date: Fri Sep 16 09:38:06 2022 -0400 v1.51.1 -- Fix matlab exception in hmrR_MotionCorrectCbsi.m because call to GetDataTimeSeries method was not updated to match new function definition. -- MainGUI and PlotProbeGUI/plotProbe.m display improvements: thinner data plot lines, exclude time patches incorrectly changing y lim. commit bb59bc7 Author: jayd1860 <[email protected]> Date: Thu Sep 15 22:05:57 2022 -0400 v1.51.0 -- Fix channel order issues excluded time by channel in hmrR_MotionCorrectSplineSG. Change GetDataTimeSeries to return measurement list associated with the data time series as well as adding other options to control channel order. -- Fix matlab exception bug in plot probe when clicking non-run, non-hrf data in MainGUI. Fix in plotProbeAndSetProperties.m, updateData() function which was cleaned up in addition to fixing problem. -- Fix incomplete isequal method in ProcStreamClass comparing 2 objects. This caused active ProcStreamOptionsGUI not to update correctly when removing function from function call chain in ProcStreamEditGUI. -- Fix issue in SubjClass when processing multiple sessions incorrectly adding trials from all the sessions. commit 402d787 Author: jayd1860 <[email protected]> Date: Mon Sep 12 14:08:24 2022 -0400 v1.50.0 -- Fix another channel order bug in DataClass.GetDataTimeSeries. order need to match linear order when squeezing dimensions > 1 into 1D. This caused incorrect results to be displayed for concentration HbT after running hmrR_MotionCorrectCbsi -- Fix minor display issue in MainGUI.m icorrectly enabling OD and concentration radio buttons even though no results exists. -- Add diagnostic/debug functions to unit test to generate simulated data time series whose data identifies the channel it originated in. commit 48ea9bf Author: jayd1860 <[email protected]> Date: Mon Sep 12 13:57:19 2022 -0400 v1.48.4 -- Fix time exclusion and motion correction by channel having incorrect channel order. Modify tIncCh to include measurement list info about sources, detectors and data type. -- Fix display of time exclusion and motion correction by channel showing incorrect channels. Clean up and rewrite DisplayExcludedTime() function. -- Improve speed of display function GetMeasurementList to use ml matrices instead of structures. Change definitions of GetMeasurementList() functions to be uniform and compatible with each other up and down the call stack, as well as having separate arguments for matrixOption ('matrix') and dataType ('dod', 'dc', dcAvg', etc). -- Minor graphics adjustment to MainGUI datatype listboxes for wavelength and HbType to be exactly overlapping commit f82ef89 Author: jayd1860 <[email protected]> Date: Mon Sep 12 13:23:59 2022 -0400 v1.48.3 -- Fix some child gui repositioning issues when MainGUI is upodated especially ProcStreamOptionsGUI -- Don't redisplay ProcStreamOptionsGUI if function call list is exactly same as last time. commit 9452143 Author: jayd1860 <[email protected]> Date: Wed Sep 7 11:45:22 2022 -0400 v1.48.2 -- Capture and log to log file the function call stack when exception error occurs while running processing stream. commit c118c68 Author: jayd1860 <[email protected]> Date: Wed Sep 7 10:48:14 2022 -0400 v1.48.1 -- Fix typo in hmrR_MotionCorrectWavelet.m causing matlab-generated exception -- More fixes in user functions hmrR_MotionArtifactByChannel.m and hmrR_MotionCorrectCbsi.m of inactive channels mlAct -- Added another performance enhancer in DataClass.GetDataTimeSeries() to speed up retrieval of measurement list and thus data time series. Added cache for measurement list matrix to avoid recalculating it. commit ab0fe48 Author: jayd1860 <[email protected]> Date: Tue Aug 30 23:20:01 2022 -0400 v1.48.0 -- Fix very slow processing at the group, subject and session levels and slow display. All were caused by the same issue: very inefficient DataClass.GetDataTimeSeries('reshape') method. Changed it's code to be much more efficient. -- Fix typo in plotProbeAndSetProperties.m causing matlab-generated error -- Minor improvement to display of location of current processing in MainGUI listboxGroupTree when calculating provcessing stream commit 150061c Author: jayd1860 <[email protected]> Date: Tue Aug 30 01:32:17 2022 -0400 v1.47.0 -- Fix mlAct in hmrR_tCCA.m -- In PlotProbeGUI get condition dynamically from parent gui, that is MainGUI -- In PlotProbeGUI.m add back ability to display OD HRF and also any data type that is currently selected in MainGUI commit 5d3d66e Author: jayd1860 <[email protected]> Date: Sun Aug 28 09:40:34 2022 -0400 v1.46.0 -- Fix plotProbe.m by rewriting the plotting to be based on SNIRF style 2D measurement list rather than .nirs era wavelength based measurement. commit 5afc448 Author: jayd1860 <[email protected]> Date: Wed Aug 24 17:46:36 2022 -0400 v1.45.0 -- Fix bug in channel exclusion in hmrR_PruneChannels.m -- Fix display of manually pruned channels in DisplayAxesSDG.m commit 4885f3d Author: jayd1860 <[email protected]> Date: Wed Aug 24 13:41:24 2022 -0400 v1.44.0 -- Fix ordering issue with active/inactive (mlAct) channels in user functions and MainGUI display. Use sources, detectors, wavelength matrix rather than a logical vector. -- When manually pruning channel only prune at the current wavelength. -- Implement missing application of active/inactive (mlAct) channels at the higher averaging user functions: hmrE_RunAvg.m, hmrG_SubjAvg.m, hmrS_SessAvg.m -- Fix incorrect nTrials calculation at the group level -- Fix PlotProbeGUI/plotProbe.m display issue as a result of fixing the MeasList ordering issue. commit ea93942 Author: jayd1860 <[email protected]> Date: Wed Aug 24 10:31:37 2022 -0400 -- Fix bug in SnirfClass .snirf file fomat conversion to NirsClas .nirs. -- Set default simulation of errors to none in UnitTests_Init.m -- Add namespace DataTreeClass to shared library Utils function points_on_line.m commit f038496 Author: jayd1860 <[email protected]> Date: Fri Aug 12 14:14:25 2022 -0400 v1.43.0 -- Set inactive channel data to NaN. That way they don't show up in MainGUI display. Implement this in DataClass: inactive channel is a channel for which all data is exactly zero (not approximately zero). -- Fix an issue in ProbeClass which incorrectly upload sourcePos3D or detectorPos3D as a column vector IF AND ONLY IF it is the ONLY optode in the probe. This leads to incorrect result in at least one user function processing hmrR_OD2Conc in which the calculation of rho is sensitive to row vs column vector. -- Fix several issues in incorrect unit tests results for Example9_SessRuns because of file naming in Simple_Probe_run* which contains '_' between Simple and Probe which are interpreted as a subject and session name. This is not how the original .nirs benchmark was processed based on the Simple_Probe*_. In order to match the original subject/session breakdown need to get rid of '_'. -- Fix another unit test bug which has to load saved derived data in compareDcAvg.m before comparing to benchmark. -- Fix another unit test bug in unitTest_BandpassFilt_LPF.m lpf wasn't being changed no matter what the value was because hmrR_BandpassFilter() changed to hmrR_BandpassFilter_old() -- Add to unit tests simulation of occasional random errors (simulateDataError.m and generateErrorOddsConstant.m) to do a check of whether the unit test is really checking data against the benchmark correctly. commit 54a831e Author: jayd1860 <[email protected]> Date: Tue Aug 9 17:40:05 2022 -0400 v1.42.4 -- Fix bugs found by Meryem in fNIRS 2018 course SS_DEMO_1, Finger_Tapping_*.snirf. Errors when running processing stream in 1. hmrR_MotionArtifact fixed by getting rid of 'reshape' option to DataTimeSeries() 2. hmrR_OD2Conc.m fixed by getting rid of 'reshape' option to DataTimeSeries() 3. hmrR_GLM.m fixed in DataClass.m by NOT assuming source and detector indices do not skip numbers -- Just like for hmrR_MotionArtifact.m no need to reshape for hmrR_MotionArtifactByChannel.m since the -- Better error/warning logging in DataFilesClass.m and FileLoadSaveClass.m commit 1c45ec6 Author: jayd1860 <[email protected]> Date: Tue Aug 9 11:45:30 2022 -0400 -- Log the current processing stream function call chain every time RUN button is clicked in MainGUI to generate derived data. -- Minor code formatting in SubjClass.m commit fbecb31 Author: jayd1860 <[email protected]> Date: Wed Aug 3 16:31:13 2022 -0400 v1.42.2 -- Fix error when loading snirf with corrupt stim data. Added error checking to flag bad stim data. Then add file with bad stim data and discard bad stims while displaying warning. -- Improve warning reporting for files that were allowed to load but with warnings. -- Fix matlab error in backward compatability code when derived output folder is same as root group folder commit 2cde4de Author: jayd1860 <[email protected]> Date: Wed Aug 3 12:29:53 2022 -0400 v1.42.1 -- Fix bug removing channels from display by mouse right-clicking in MainGUI axesSDG. Fixed incorrect distance criteria for source and detector from end points on clicked line. commit 193cfd2 Author: jayd1860 <[email protected]> Date: Sat Jul 30 23:36:02 2022 -0400 v1.42.0 -- Fix issue with probe.snirf or any other snirf files with no data or intentionally corrupt data being accepted as valid. -- Fix Nirs2Snirf not working for some some .nirs datasets which do not have CondNames. Add default CondNames to NirsClass.ErrorCheck() -- Fix display of mlAct in MainGUI broken after the measurement list order issue. -- For diagnostic purposes save error code in err field of all the SnirfClass sub-classes -- Add back to MainGUI making channels invisible by mouse right-clicking on them. commit 1fb30ba Author: jayd1860 <[email protected]> Date: Fri Jul 29 00:42:42 2022 -0400 v1.41.0 -- Add ability to plot selected measurements in exported HRF file from ExportDataGUI -- In ConfigFileClass exclude AppSettings.cfg in submodules folder under Homer3 root folder commit 93d18b0 Author: jayd1860 <[email protected]> Date: Tue Jul 26 22:12:16 2022 -0400 -- Fix bug in shared lib synching code which incorrectly ignores differences in files with .cfg extensions thus ignoring differences in AppSettings.cfg commit da417d0 Author: jayd1860 <[email protected]> Date: Thu Jul 21 18:00:36 2022 -0400 v1.40.1 -- Add back display of standard error bars, and x and y-axis labels to MainGUI data display. -- Fix current element condition name display being cut off in PlotProbeGUI.m commit cec5446 Author: jayd1860 <[email protected]> Date: Wed Jul 20 23:46:17 2022 -0400 v1.40.0 -- Fix major issue with incorrect sorting of data and measurement list. -- Change unit tests to include wavelength when scrambling channel order. Also make scrambling for unit tests an option commit 8af7176 Author: jayd1860 <[email protected]> Date: Tue Jul 19 12:26:12 2022 -0400 v1.39.0 -- Fix matlab generated error displaying measurement list visible channels. Take MeasListVis field out of processing stream input (ProcInputClass) since it does not actually contribute to proc stream processing and move it to TreeNodeClass field chVis. # Conflicts: # Utils/OpenFileGUI.fig # Utils/Shared/OpenFileGUI.m # Version.txt
1 parent 0d7a93f commit 93401dc

File tree

10 files changed

+188
-34
lines changed

10 files changed

+188
-34
lines changed

DataTree/AcquiredData/Snirf/DataClass.m

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
properties
1010
cache
11+
diagnostic
1112
end
1213

1314
methods
@@ -50,6 +51,7 @@
5051
% Set SNIRF fomat properties
5152
obj.measurementList = MeasListClass().empty();
5253
obj.cache = struct('measurementListMatrix',[]);
54+
obj.diagnostic = false;
5355

5456
if nargin==0
5557
return;
@@ -620,10 +622,10 @@ function SaveHdf5(obj, fileobj, location)
620622

621623
elseif nWavelengths > 0 && nCond > 0
622624

623-
for iS = 1:length(srcs)
624-
for iD = 1:length(dets)
625-
for iWl = 1:nWavelengths
626-
for iCond = 1:nCond
625+
for iCond = 1:nCond
626+
for iS = 1:length(srcs)
627+
for iD = 1:length(dets)
628+
for iWl = 1:nWavelengths
627629

628630
k = find(measurementListFull(:,1)==srcs(iS) & measurementListFull(:,2)==dets(iD) & measurementListFull(:,3)==iCond & measurementListFull(:,4)==wavelengths(iWl));
629631
if ~isempty(k)
@@ -658,10 +660,10 @@ function SaveHdf5(obj, fileobj, location)
658660

659661
elseif nDataTypeLabels > 0 && nCond > 0
660662

661-
for iS = 1:length(srcs)
662-
for iD = 1:length(dets)
663-
for iHbType = 1:length(hbTypes)
664-
for iCond = 1:nCond
663+
for iCond = 1:nCond
664+
for iS = 1:length(srcs)
665+
for iD = 1:length(dets)
666+
for iHbType = 1:length(hbTypes)
665667

666668
k = find(measurementListFull(:,1)==srcs(iS) & measurementListFull(:,2)==dets(iD) & measurementListFull(:,3)==iCond & measurementListFull(:,4)==iHbType);
667669
if ~isempty(k)
@@ -688,7 +690,7 @@ function SaveHdf5(obj, fileobj, location)
688690
k = find(measurementListFull(:,1)==srcs(iS) & measurementListFull(:,2)==dets(iD) & measurementListFull(:,4)==wavelengths(iWl));
689691
if ~isempty(k)
690692
iSDPair = find(measurementListSDpairs(:,1)==srcs(iS) & measurementListSDpairs(:,2)==dets(iD));
691-
d(:, iWl, iSDPair) = obj.dataTimeSeries(:,k); %#ok<*FNDSB>
693+
d(:, iSDPair, iWl) = obj.dataTimeSeries(:,k); %#ok<*FNDSB>
692694
order(kk) = k;
693695
kk = kk+1;
694696
end
@@ -707,7 +709,7 @@ function SaveHdf5(obj, fileobj, location)
707709
k = find(measurementListFull(:,1)==srcs(iS) & measurementListFull(:,2)==dets(iD) & measurementListFull(:,3)==iCond & measurementListFull(:,4)==wavelengths(iWl));
708710
if ~isempty(k)
709711
iSDPair = find(measurementListSDpairs(:,1)==srcs(iS) & measurementListSDpairs(:,2)==dets(iD));
710-
d(:, iWl, iSDPair, iCond) = obj.dataTimeSeries(:,k);
712+
d(:, iSDPair, iWl, iCond) = obj.dataTimeSeries(:,k);
711713
order(kk) = k;
712714
kk = kk+1;
713715
end
@@ -726,7 +728,7 @@ function SaveHdf5(obj, fileobj, location)
726728
k = find(measurementListFull(:,1)==srcs(iS) & measurementListFull(:,2)==dets(iD) & measurementListFull(:,4)==iHbType);
727729
if ~isempty(k)
728730
iSDPair = find(measurementListSDpairs(:,1)==srcs(iS) & measurementListSDpairs(:,2)==dets(iD));
729-
d(:, iHbType, iSDPair) = obj.dataTimeSeries(:,k);
731+
d(:, iSDPair, iHbType) = obj.dataTimeSeries(:,k);
730732
order(kk) = k;
731733
kk = kk+1;
732734
end
@@ -745,7 +747,7 @@ function SaveHdf5(obj, fileobj, location)
745747
k = find(measurementListFull(:,1)==srcs(iS) & measurementListFull(:,2)==dets(iD) & measurementListFull(:,3)==iCond & measurementListFull(:,4)==iHbType);
746748
if ~isempty(k)
747749
iSDPair = find(measurementListSDpairs(:,1)==srcs(iS) & measurementListSDpairs(:,2)==dets(iD));
748-
d(:, iHbType, iSDPair, iCond) = obj.dataTimeSeries(:,k);
750+
d(:, iSDPair, iHbType, iCond) = obj.dataTimeSeries(:,k);
749751
order(kk) = k;
750752
kk = kk+1;
751753
end
@@ -768,7 +770,16 @@ function SaveHdf5(obj, fileobj, location)
768770
ml(order) = ml;
769771
end
770772

773+
obj.SimulateErrors(d);
774+
end
775+
776+
771777

778+
% ---------------------------------------------------------
779+
function d = SimulateErrors(obj, d)
780+
if obj.diagnostic == false
781+
return
782+
end
772783
d = simulateDataError(d);
773784
end
774785

DataTree/setpaths.m

Lines changed: 152 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function setpaths(options)
3636
appNameInclList = {};
3737
exclSearchList = {'.git','Data','Docs','*_install','*.app'};
3838

39-
appThis = filesepStandard_startup(pwd);
39+
appThis = filesepStandard(pwd);
4040
appThisPaths = findDotMFolders(appThis, exclSearchList);
4141
if addremove == 0
4242
if ~isempty(which('deleteNamespace.m'))
@@ -53,8 +53,8 @@ function setpaths(options)
5353
for ii = 1:length(appNameExclList)
5454
foo = which([appNameExclList{ii}, '.m'],'-all');
5555
for jj = 1:length(foo)
56-
p = filesepStandard_startup(fileparts(foo{jj}));
57-
if pathscompare_startup(appThis, p)
56+
p = filesepStandard(fileparts(foo{jj}));
57+
if pathscompare(appThis, p)
5858
continue
5959
end
6060
fprintf('Exclude paths for %s\n', p);
@@ -67,11 +67,11 @@ function setpaths(options)
6767
foo = which([appNameInclList{ii}, '.m'],'-all');
6868
for jj = 1:length(foo)
6969
if jj > 1
70-
p = filesepStandard_startup(fileparts(foo{jj}));
70+
p = filesepStandard(fileparts(foo{jj}));
7171
appExclList = [appExclList; p]; %#ok<AGROW>
7272
fprintf('Exclude paths for %s\n', p);
7373
else
74-
p = filesepStandard_startup(fileparts(foo{jj}));
74+
p = filesepStandard(fileparts(foo{jj}));
7575
appInclList = [appInclList; p]; %#ok<AGROW>
7676
fprintf('Include paths for %s\n', p);
7777
end
@@ -97,7 +97,7 @@ function setpaths(options)
9797
% Add back all search paths for all other apps except for current app
9898
for ii = 1:length(appInclList)
9999
% This app's path has already been added
100-
if pathscompare_startup(appInclList{ii}, appThis)
100+
if pathscompare(appInclList{ii}, appThis)
101101
continue;
102102
end
103103
foo = findDotMFolders(appInclList{ii}, exclSearchList);
@@ -119,9 +119,6 @@ function setpaths(options)
119119

120120
end
121121

122-
appnames = [appname; dependencies()];
123-
PrintSystemInfo([], appnames)
124-
125122
cd(currdir);
126123

127124

@@ -184,15 +181,15 @@ function removeSearchPaths(app)
184181
r = version('-release');
185182
msg = sprintf('Removing search paths for %s ...', appname);
186183
h = waitbar(0, msg);
187-
p = str2cell_startup(p, delimiter);
184+
p = str2cell(p, delimiter);
188185
for kk = 1:length(p)
189186
if mod(kk,100)==0
190187
waitbar(kk/length(p), h);
191188
end
192189
if ~isempty(strfind(lower(p{kk}), 'matlab')) && ~isempty(strfind(p{kk}, r))
193190
continue;
194191
end
195-
if ~isempty(strfind(filesepStandard_startup(p{kk}), app))
192+
if ~isempty(strfind(filesepStandard(p{kk}), app))
196193
rmpath(p{kk});
197194
end
198195
end
@@ -268,3 +265,147 @@ function addDependenciesSearchPaths()
268265
end
269266
C(kk:end) = [];
270267

268+
269+
270+
271+
% -------------------------------------------------------------------------
272+
function dotmfolders = findDotMFolders(subdir, exclList)
273+
global MAXPATHLENGTH
274+
MAXPATHLENGTH = 8;
275+
276+
dotmfolders = {};
277+
278+
if ~exist('subdir','var')
279+
subdir = pwd;
280+
end
281+
if ~exist('exclList','var')
282+
exclList = {};
283+
end
284+
285+
if ~iscell(exclList)
286+
exclList = {exclList};
287+
end
288+
289+
subdirFullpath = filesepStandard(subdir,'full');
290+
291+
if ~ispathvalid(subdirFullpath, 'dir')
292+
fprintf('Warning: folder %s doesn''t exist\n', subdirFullpath);
293+
return;
294+
end
295+
296+
% If current subjdir is in the exclList then go back to curr dir and exit
297+
if isExcluded(subdirFullpath, exclList)
298+
return;
299+
end
300+
301+
dirs = dir([subdirFullpath, '*']);
302+
if isempty(dirs)
303+
return;
304+
end
305+
306+
if isdotmfolder(subdirFullpath)
307+
dotmfolders = {filesepStandard(subdirFullpath, 'nameonly')};
308+
end
309+
310+
for ii = 1:length(dirs)
311+
if ~dirs(ii).isdir
312+
continue;
313+
end
314+
if dirs(ii).name(1) == '.'
315+
continue;
316+
end
317+
dotmfolders = [dotmfolders; findDotMFolders([subdirFullpath, dirs(ii).name], exclList)]; %#ok<AGROW>
318+
end
319+
320+
321+
322+
323+
324+
% -------------------------------------------------------------------------
325+
function b = isdotmfolder(folder)
326+
global MAXPATHLENGTH
327+
b = false;
328+
if ~ispathvalid(folder, 'dir')
329+
return
330+
end
331+
if isempty(dir([folder,'/*.m']))
332+
% Exceptions to rule that 'dotm' folder must have at least one '.m' file:
333+
% it is a an executable folder (i.e. '/bin')
334+
if ~isempty(strfind(folder, '/bin/')) %#ok<*STREMP>
335+
b = true;
336+
return
337+
end
338+
return;
339+
else
340+
rootdir = which('findDotMFolders');
341+
rootdir = fileparts(rootdir);
342+
rootdir = pathsubtract(rootdir, 'Utils/submodules','nochange');
343+
p = pathsubtract(folder, rootdir);
344+
if length(find(p=='/')) > MAXPATHLENGTH
345+
return
346+
end
347+
end
348+
b = true;
349+
350+
351+
352+
353+
% -------------------------------------------------------------------------
354+
function b = isExcluded(pname, exclList)
355+
b = true;
356+
if pname(end)=='/'
357+
pname(end) = '';
358+
end
359+
if ~ispathvalid(pname,'dir')
360+
return;
361+
end
362+
[~,f,e] = fileparts(pname);
363+
for ii = 1:length(exclList)
364+
[c,d] = str2cell(exclList{ii},'*');
365+
if isempty(d) && strcmp(c{1}, [f,e])
366+
return;
367+
end
368+
369+
% Get list of all folders matching exclList{ii} pattern, whether it be
370+
% a single folder name or a wildcard pattern
371+
for jj = 1:length(c)
372+
k = strfind(c{jj}, [f,e]);
373+
if isempty(k)
374+
break;
375+
end
376+
end
377+
if ~isempty(k)
378+
return;
379+
end
380+
end
381+
b = false;
382+
383+
384+
385+
% -------------------------------------------------------------------------
386+
function diff = pathsubtract(p2_0, p1_0, options)
387+
if ~exist('options','var')
388+
options = '';
389+
end
390+
if optionExists(options, 'nochange')
391+
option = '';
392+
else
393+
option = 'full';
394+
end
395+
p1 = filesepStandard(p1_0, option);
396+
p2 = filesepStandard(p2_0, option);
397+
if isempty(p1)
398+
p1 = p1_0;
399+
end
400+
if isempty(p2)
401+
p2 = p2_0;
402+
end
403+
k = strfind(p2, p1);
404+
if ~isempty(k) && k(1)==1
405+
diff = p2(k(1)+length(p1):end);
406+
elseif ~isempty(k)
407+
diff = p2(1:k(1)-1);
408+
else
409+
diff = '';
410+
end
411+
File renamed without changes.

Utils/OpenFileGUI.m renamed to Utils/Shared/OpenFileGUI.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,8 @@ function dummyfunc(~, ~, ~)
315315
function listboxFilesFolders_KeyPressFcn(hObject, eventdata, handles)
316316
if strcmp(eventdata.Key, 'downarrow') || strcmp(eventdata.Key, 'uparrow')
317317
setappdata(hObject, 'keypress',1)
318+
elseif strcmp(eventdata.Key, 'home') || strcmp(eventdata.Key, 'end')
319+
setappdata(hObject, 'keypress',1)
318320
elseif strcmp(eventdata.Key, 'return')
319321
editFilename_Callback(handles.editFilename, 1, handles);
320322
end
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Utils/submodules/syncSubmodules.m

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -106,16 +106,16 @@
106106
if ~exist('peerlessonly','var')
107107
peerlessonly = false;
108108
end
109-
f1_1 = findTypeFiles(repo1.path, '.m');
110-
f1_2 = findTypeFiles(repo1.path, '.txt');
111-
f1_2 = findTypeFiles(repo1.path, '.cfg');
112-
f1_3 = findTypeFiles(repo1.path, '.numberfiles');
113-
f2_1 = findTypeFiles(repo2.path, '.m');
114-
f2_2 = findTypeFiles(repo2.path, '.cfg');
115-
f2_3 = findTypeFiles(repo2.path, '.numberfiles');
116-
f1 = [f1_1; f1_2; f1_3];
117-
f2 = [f2_1; f2_2; f2_3];
118109

110+
fileTypes = {'.m','.txt','.cfg','.numberfiles','.fig'};
111+
for iRepo = 1:2
112+
for iFt = 1:length(fileTypes)
113+
if eval( sprintf('~exist(''f%d'',''var'')', iRepo) )
114+
eval( sprintf('f%d = {};', iRepo) )
115+
end
116+
eval( sprintf('f%d = [f%d; findTypeFiles(repo%d.path, fileTypes{iFt})];', iRepo, iRepo, iRepo) )
117+
end
118+
end
119119
q = 0;
120120
for kk = 1:length(f2)
121121

@@ -152,7 +152,7 @@
152152
% repo1, then ADD f2 to repo1
153153
if repo2.datetime.num > repo1.datetime.num
154154

155-
p = pathsubtract(f2{kk}, repo2.path);
155+
p = pathsubtract_startup(f2{kk}, repo2.path);
156156
q = makeChange('add', f2{kk}, [repo1.path, p], repo1, preview, q);
157157
identical = false;
158158

Version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
1.52.0
1+
1.54.0
22

33

0 commit comments

Comments
 (0)