Commit a90dc75d authored by jayd1860's avatar jayd1860
Browse files

v1.15.3

-- Tweaks to SnirfClass instructions in the help and README and a change to the error flagging when saving SNIRF files
parent 78994d19
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -27,3 +27,17 @@ At this point you should be ready to start snirf_homer3 from the Matlab command

Run the demos demo_snirf.m and demo_snirf_readfile.m (which should be available on the Matlab command line after running setpaths). They demonstrate how to use SnirfClass reader/writer to save, load and read SNIRF files. Make sure to run demo_snirf before demo_snirf_readfile.m since it expects the snirf files generated by demo_snirf to be present (otherwise it displays a message box stating this if it doesn't find them). The snirf_homer3 project includes sample .nirs files (DataTree/AcquiredData/Snirf/Examples) which the demo converts to .snirf files and then shows how to load them back into memory. 

3. Example 1:

	% Save .nirs file in SNIRF format
	nirs = load('neuro_run01.nirs','-mat');
	snirf1 = SnirfClass(nirs);
	snirf1.Save('neuro_run01.snirf');
	snirf1.Info();

	% Check that the file was saved correctly by looking at
	% snirf2 contents and comparing with snirf1 contents
	snirf2 = SnirfClass();
	snirf2.Load('neuro_run01.snirf');
	snirf2.Info();
+5 −0
Original line number Diff line number Diff line
@@ -73,6 +73,11 @@ classdef AuxClass < FileLoadSaveClass
        
        % -------------------------------------------------------
        function SaveHdf5(obj, fname, parent)
            % Arg 1
            if ~exist('fname', 'var') || isempty(fname)
                error('Unable to save file. No file name given.')
            end
            
            if ~exist(fname, 'file')
                fid = H5F.create(fname, 'H5F_ACC_TRUNC', 'H5P_DEFAULT', 'H5P_DEFAULT');
                H5F.close(fid);
+5 −0
Original line number Diff line number Diff line
@@ -87,6 +87,7 @@ classdef DataClass < FileLoadSaveClass
        % -------------------------------------------------------
        function err = LoadHdf5(obj, fname, parent)
            err = 0;
            
            if ~exist(fname, 'file')
                err = -1;
                return;
@@ -126,6 +127,10 @@ classdef DataClass < FileLoadSaveClass
        
        % -------------------------------------------------------
        function SaveHdf5(obj, fname, parent)
            if ~exist('fname', 'var') || isempty(fname)
                error('Unable to save file. No file name given.')
			end

            if ~exist(fname, 'file')
                fid = H5F.create(fname, 'H5F_ACC_TRUNC', 'H5P_DEFAULT', 'H5P_DEFAULT');
                H5F.close(fid);
+7 −0
Original line number Diff line number Diff line
@@ -129,6 +129,13 @@ classdef MeasListClass < FileLoadSaveClass
        
        % -------------------------------------------------------
        function SaveHdf5(obj, fname, parent)

            % Arg 1
            if ~exist('fname', 'var') || isempty(fname)
                error('Unable to save file. No file name given.')
            end
            
            % Arg 2
            if ~exist(fname, 'file')
                fid = H5F.create(fname, 'H5F_ACC_TRUNC', 'H5P_DEFAULT', 'H5P_DEFAULT');
                H5F.close(fid);
+5 −0
Original line number Diff line number Diff line
@@ -68,6 +68,11 @@ classdef MetaDataTagsClass < FileLoadSaveClass
        
        % -------------------------------------------------------
        function SaveHdf5(obj, fname, parent)
            % Arg 1
            if ~exist('fname', 'var') || isempty(fname)
                error('Unable to save file. No file name given.')
            end
            
            if ~exist(fname, 'file')
                fid = H5F.create(fname, 'H5F_ACC_TRUNC', 'H5P_DEFAULT', 'H5P_DEFAULT');
                H5F.close(fid);
Loading