Home > FMAToolbox > Data > GetCurrentSession.m

GetCurrentSession

PURPOSE ^

GetCurrentSession - Get information about current session.

SYNOPSIS ^

function info = GetCurrentSession(verbose)

DESCRIPTION ^

GetCurrentSession - Get information about current session.

  USAGE

    GetCurrentSession
    GetCurrentSession('verbose')  % detailed output

    info = GetCurrentSession  % return info (do not display)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function info = GetCurrentSession(verbose)
0002 
0003 %GetCurrentSession - Get information about current session.
0004 %
0005 %  USAGE
0006 %
0007 %    GetCurrentSession
0008 %    GetCurrentSession('verbose')  % detailed output
0009 %
0010 %    info = GetCurrentSession  % return info (do not display)
0011 
0012 % Copyright (C) 2008-2011 by Michaƫl Zugaro
0013 %
0014 % This program is free software; you can redistribute it and/or modify
0015 % it under the terms of the GNU General Public License as published by
0016 % the Free Software Foundation; either version 3 of the License, or
0017 % (at your option) any later version.
0018 
0019 global DATA;
0020 info = [];
0021 
0022 verbose = nargin >= 1 && strcmp(lower(verbose),'verbose');
0023 
0024 % Initialization
0025 if isempty(DATA),
0026     disp('No session loaded');
0027     return
0028 end
0029 
0030 if nargout > 0,
0031     info.basename = DATA.session.basename;
0032     info.path = DATA.session.path;
0033     info.nChannels = DATA.nChannels;
0034     info.wideband = DATA.rates.wideband;
0035     info.lfp = DATA.rates.lfp;
0036     return
0037 end
0038 
0039 separator;
0040 disp('Session');
0041 disp(['  Name                           ' DATA.session.basename]);
0042 disp(['  Disk Path                      ' DATA.session.path]);
0043 
0044 separator;
0045 disp('Channels');
0046 disp(['  Number of Channels             ' int2str(DATA.nChannels)]);
0047 disp(['  Wide-Band Sampling Rate        ' num2str(DATA.rates.wideband)]);
0048 disp(['  LFP Sampling Rate              ' num2str(DATA.rates.lfp)]);
0049 
0050 separator;
0051 disp('Events');
0052 disp(['  Total Number of Events         ' int2str(size(DATA.events.time,1))]);
0053 ev = unique(DATA.events.description);
0054 n = size(ev,1);
0055 disp(['  Number of Different Types      ' int2str(n)]);
0056 if verbose,
0057     for i = 1:n,
0058         if i < 10, white = ' '; else white = ''; end
0059         disp([' ' white int2str(i) '. Description                 ''' ev{i} '''']);
0060         n1 = length(GetEvents({ev{i}}));
0061         disp(['     Number                      ' int2str(n1)]);
0062     end
0063 end
0064 if n ~= 0,
0065     disp(['  Time of First Event            ' num2str(DATA.events.time(1))]);
0066     disp(['  Time of Last Event             ' num2str(DATA.events.time(end))]);
0067 end
0068 
0069 separator;
0070 disp('Positions');
0071 disp(['  Sampling Rate                  ' num2str(DATA.rates.video)]);
0072 disp(['  Image Size (pixels)            ' int2str(DATA.maxX) 'x' int2str(DATA.maxY)]);
0073 n = size(DATA.positions,1);
0074 disp(['  Number of Position Samples     ' int2str(n)]);
0075 if n ~= 0,
0076     disp(['  Number of Undetected Samples   ' int2str(sum(DATA.positions(:,1)==-1))]);
0077 end
0078 
0079 separator;
0080 disp('Spikes');
0081 nGroups = DATA.spikeGroups.nGroups;
0082 disp(['  Number of Spike Groups         ' int2str(nGroups)]);
0083 if verbose,
0084     for i = 1:nGroups,
0085         if i < 10, white1 = ' '; else white1 = ''; end
0086         clusters = DATA.spikes(DATA.spikes(:,2)==i,3);
0087         nClusters = length(unique(clusters));
0088         for j = 1:nClusters,
0089             if j < 10, white2 = ' '; else white2 = ''; end
0090             if j == 1, n = [white1 int2str(i) '.']; else n = '   ';end
0091             disp([' ' n ' Spikes in cluster ' white2 int2str(j) '        ' int2str(sum(clusters==j))]);
0092         end
0093     end
0094 end
0095 
0096 separator;
0097 
0098 function separator
0099 
0100 %  disp('-------------------------------------------------------------------------------------------------------');
0101 disp(' ');

Generated on Fri 16-Mar-2018 13:00:20 by m2html © 2005