Home > vbmeg > functions > device > eeg > brainamp > db_template.m

db_template

PURPOSE ^

DB_TEMPLATE: Defines a template structure for all the Brainstorm data types.

SYNOPSIS ^

function [ template ] = db_template(structureName)

DESCRIPTION ^

 DB_TEMPLATE: Defines a template structure for all the Brainstorm data types.

 USAGE :  [template] = db_template(structureName);

 INPUT:   String - {'Anatomy', 'Surface', 'Channel', 'Data', 'HeadModel', 'Results', 'Stat', 
                    'Subject', 'Study', 'ProtocolInfo', 'ProtocolSubjects', 'ProtocolStudies',
                    'Layout', 'Colormap', 'Measures', 'LoadedResults', 'FigureId', 
                    'Figure', 'Dataset', 'DisplayHandlesTimeSeries', 'DisplayHandlesTopography', 
                    'DisplayHandles3DViz', 'Scout', 'GlobalData', 'Landmark', 
                    'SCS', 'NCS', 'TessInfo', ...}

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [ template ] = db_template(structureName)
0002 % DB_TEMPLATE: Defines a template structure for all the Brainstorm data types.
0003 %
0004 % USAGE :  [template] = db_template(structureName);
0005 %
0006 % INPUT:   String - {'Anatomy', 'Surface', 'Channel', 'Data', 'HeadModel', 'Results', 'Stat',
0007 %                    'Subject', 'Study', 'ProtocolInfo', 'ProtocolSubjects', 'ProtocolStudies',
0008 %                    'Layout', 'Colormap', 'Measures', 'LoadedResults', 'FigureId',
0009 %                    'Figure', 'Dataset', 'DisplayHandlesTimeSeries', 'DisplayHandlesTopography',
0010 %                    'DisplayHandles3DViz', 'Scout', 'GlobalData', 'Landmark',
0011 %                    'SCS', 'NCS', 'TessInfo', ...}
0012 
0013 % @=============================================================================
0014 % This software is part of the Brainstorm software:
0015 % http://neuroimage.usc.edu/brainstorm
0016 %
0017 % Copyright (c)2000-2013 Brainstorm by the University of Southern California
0018 % This software is distributed under the terms of the GNU General Public License
0019 % as published by the Free Software Foundation. Further details on the GPL
0020 % license can be found at http://www.gnu.org/copyleft/gpl.html.
0021 %
0022 % FOR RESEARCH PURPOSES ONLY. THE SOFTWARE IS PROVIDED "AS IS," AND THE
0023 % UNIVERSITY OF SOUTHERN CALIFORNIA AND ITS COLLABORATORS DO NOT MAKE ANY
0024 % WARRANTY, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF
0025 % MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, NOR DO THEY ASSUME ANY
0026 % LIABILITY OR RESPONSIBILITY FOR THE USE OF THIS SOFTWARE.
0027 %
0028 % For more information type "brainstorm license" at command prompt.
0029 % =============================================================================@
0030 %
0031 % Authors: Francois Tadel, 2008-2013
0032 
0033 
0034 switch lower(structureName)
0035     % ===== BASIC LOADED STRUCTURES =====
0036     case 'anatomy'
0037         template = struct('Comment',  '', ...
0038                           'FileName', '');
0039     case 'surface'
0040         template = struct('Comment',     '', ...
0041                           'FileName',    '', ...
0042                           'SurfaceType', '');
0043     case 'channel'
0044         template = struct('FileName',        '', ...
0045                           'Comment',         '', ...
0046                           'nbChannels',      0, ...
0047                           'Modalities',      [], ...
0048                           'DisplayableSensorTypes', []);
0049     case 'data'
0050         template = struct('FileName',       '', ...
0051                           'Comment',        '', ...
0052                           'DataType',       'recordings', ...
0053                           'BadTrial',       0);
0054     case 'dipoles'
0055         template = struct('FileName',       '', ...
0056                           'Comment',        '', ...
0057                           'DataFile',       '');
0058     case 'headmodel'
0059         template = struct('FileName',       '', ...
0060                           'HeadModelType',  '', ...
0061                           'MEGMethod',      '', ...
0062                           'EEGMethod',      '', ...
0063                           'Comment',        '', ...
0064                           'ECOGMethod',     '', ...
0065                           'SEEGMethod',     '');
0066     case 'results'
0067         template = struct('FileName',       '', ...
0068                           'Comment',        '', ...
0069                           'DataFile',       '', ...
0070                           'isLink',         0, ...
0071                           'HeadModelType',  '');
0072     case 'stat'
0073         template = struct('FileName',       '', ...
0074                           'Comment',        '', ...
0075                           'Type',           '', ...
0076                           'pThreshold',     '', ...
0077                           'DataFile',       '');
0078     case 'timefreq'
0079         template = struct('FileName',       '', ...
0080                           'Comment',        '', ...
0081                           'DataFile',       '', ...
0082                           'DataType',       '');
0083     case 'image'
0084         template = struct('FileName',       '', ...
0085                           'Comment',        '');
0086     case 'matrix'
0087         template = struct('FileName',       '', ...
0088                           'Comment',        '');
0089     case 'noisecov'
0090         template = struct('FileName',       '', ...
0091                           'Comment',        '');
0092         
0093     % ==== FILES ====
0094     case 'mrimat'
0095         template = struct(...
0096             'Comment',     '', ...
0097             'Cube',        [], ...
0098             'Voxsize',     [], ...
0099             'NCS',         [], ...
0100             'SCS',         [], ...
0101             'Header',      [], ...
0102             'Histogram',   [], ...
0103             'InitTransf',  [], ...
0104             'History',     []);
0105 
0106     case 'surfacemat'
0107         template = struct(...
0108             'Comment',         '', ...
0109             'Vertices',        [], ...
0110             'Faces',           [], ...
0111             'VertConn',        [], ...
0112             'VertNormals',     [], ...
0113             'Curvature',       [], ...
0114             'SulciMap',        [], ...
0115             'Atlas',           db_template('Atlas'), ...
0116             'iAtlas',          1, ...
0117             'tess2mri_interp', [], ...
0118             'Reg',             [], ...
0119             'History',         []);
0120         
0121     case 'datamat'
0122         template = struct('F',           [], ...
0123                           'Comment',     '', ...
0124                           'ChannelFlag', [], ...
0125                           'Time',        [], ...
0126                           'DataType',    'recordings', ...
0127                           'Device',      '', ...
0128                           'nAvg',        1, ...
0129                           'Events',      repmat(db_template('event'), 0), ...
0130                           'History',     []);
0131     case 'headmodelmat'
0132         template = struct('MEGMethod',     [], ...
0133                           'EEGMethod',     [], ...
0134                           'ECOGMethod',    [], ...
0135                           'SEEGMethod',    [], ...
0136                           'Gain',          [], ... 
0137                           'Comment',       '', ...  [nChannel, 3*nSources]
0138                           'HeadModelType', '', ...  {'volume', 'surface'}
0139                           'GridLoc',       [], ...  [nSources, 3]
0140                           'GridOrient',    [], ...  [nSources, 3]
0141                           'SurfaceFile',   '', ...
0142                           'Param',         []);
0143     case 'resultsmat'
0144         template = struct('ImagingKernel', [], ...
0145                           'ImageGridAmp',  [], ...
0146                           'Whitener',      [], ...
0147                           'nComponents',   1, ...
0148                           'Comment',       '', ...
0149                           'Function',      '', ...
0150                           'Time',          [], ...
0151                           'DataFile',      '', ...
0152                           'HeadModelFile', '', ...
0153                           'HeadModelType', '', ...
0154                           'ChannelFlag',   [], ...
0155                           'GoodChannel',   [], ...
0156                           'SurfaceFile',   'surface', ...
0157                           'Atlas',         [], ...
0158                           'GridLoc',       [], ...
0159                           'Options',       [], ...
0160                           'History',       []);
0161     case 'timefreqmat'
0162         template = struct('TF',          [], ...
0163                           'Comment',     '', ...
0164                           'DataType',    '', ...
0165                           'Time',        [], ...
0166                           'TimeBands',   [], ...
0167                           'Freqs',       [], ...
0168                           'RefRowNames', [], ...
0169                           'RowNames',    [], ...
0170                           'Measure',     [], ...
0171                           'Method',      [], ...
0172                           'DataFile',    '', ...
0173                           'SurfaceFile', [], ...
0174                           'Atlas',       [], ...
0175                           'nAvg',        1, ...
0176                           'Options',     [], ...
0177                           'History',     []);
0178     case 'channelmat'
0179         template = struct(...
0180             'Comment',    'Channels', ...
0181             'MegRefCoef', [], ...   % CTF compensators matrix, [nMeg x nMegRef]
0182             'Projector',  [], ...   % SSP matrix, [nChannels x nChannels]
0183             'TransfMeg',  [], ...   % MEG sensors: Successive transforms from device coord. system to brainstorm SCS
0184             'TransfMegLabels', [], ... % Labels for each MEG transformation
0185             'TransfEeg',  [], ...   % EEG sensors: Successive transforms from device coord. system to brainstorm SCS
0186             'TransfEegLabels', [], ... % Labels for each EEG transformation
0187             'HeadPoints', struct(...% Digitized head points 
0188                 'Loc',    [], ...
0189                 'Label',  [], ...
0190                 'Type',   []), ...
0191             'Channel',    [], ...  % [nChannels] Structure array, one structure per sensor
0192             'History',     []);
0193         
0194     case 'projector'
0195         template = struct(...
0196             'Comment',      [], ...
0197             'Components',   [], ...
0198             'CompMask',     [], ...
0199             'Status',       0, ...  % 0: not applied; 1: applied on the fly; 2: saved in the file, not revertible 
0200             'SingVal',      []);
0201         
0202     case 'matrixmat'
0203         template = struct(...
0204             'Value',       [], ...
0205             'Comment',     '', ...
0206             'Description', [], ...
0207             'Time',        [], ...
0208             'ChannelFlag', [], ...
0209             'nAvg',        1, ...
0210             'Events',      repmat(db_template('event'), 0), ...
0211             'History',     []);
0212     case 'statmat'
0213         template = struct(...
0214             'pmap',        [], ...
0215             'tmap',        [], ...
0216             'df',          0, ...
0217             'Type',        '', ...
0218             'Comment',     '', ...
0219             'Time',        [], ...
0220             'ChannelFlag', [], ...
0221             'HeadModelType', [], ...
0222             'GridLoc',       [], ...
0223             'GoodChannel',   [], ...
0224             'ColormapType',  '', ...
0225             'Atlas',         [], ...
0226             'History',     []);
0227             
0228     % ==== SUBJECT ====
0229     case 'subjectmat'
0230         template = struct(...
0231             'Comments',    '', ...
0232             'Anatomy',     '', ...
0233             'Cortex',      '', ...
0234             'Scalp',       '', ...
0235             'InnerSkull',  '', ...
0236             'OuterSkull',  '', ...
0237             'UseDefaultAnat',    0, ...
0238             'UseDefaultChannel', 1); 
0239     case 'subject'
0240         template = struct(...
0241               'Name',                'Unnamed', ...
0242               'Comments',            '', ...
0243               'FileName',            '', ...
0244               'DateOfAcquisition',   '', ...
0245               'Anatomy',             repmat(db_template('Anatomy'),0), ...
0246               'Surface',             repmat(db_template('Surface'),0), ...
0247               'iAnatomy',            [], ...
0248               'iScalp',              [], ...
0249               'iCortex',             [], ...
0250               'iInnerSkull',         [], ...
0251               'iOuterSkull',         [], ...
0252               'iOther',              [], ...
0253               'UseDefaultAnat',      0 , ... 
0254               'UseDefaultChannel',   1);
0255   
0256     % ==== STUDY ====
0257     case 'studymat'
0258         template = struct(...
0259               'DateOfStudy', date, ...
0260               'Name',        'Unnamed', ...
0261               'BadTrials',   []);
0262     case 'study'
0263          template = struct(...
0264               'Name',                'Unnamed', ...
0265               'FileName',            '', ...
0266               'DateOfStudy',         '', ...
0267               'BrainStormSubject',   '', ...
0268               'Condition',           '', ...
0269               ... repmat(db_template('Channel'),0)
0270               'Channel',             struct(...  
0271                   'FileName',        {}, ...
0272                   'Comment',         {}, ...
0273                   'nbChannels',      {}, ...
0274                   'Modalities' ,     {}, ...
0275                   'DisplayableSensorTypes', {}), ...
0276               'iChannel',            [], ...
0277               ... repmat(db_template('Data'),0)
0278               'Data',              struct(...
0279                   'FileName',        {}, ...
0280                   'Comment',         {}, ...
0281                   'DataType',        {}, ...
0282                   'BadTrial',        {}), ...
0283               ... repmat(db_template('HeadModel'),0)
0284               'HeadModel',         struct(...
0285                   'FileName',         {}, ...
0286                   'HeadModelType',    {}, ...
0287                   'MEGMethod',        {}, ...
0288                   'EEGMethod',        {}, ...
0289                   'Comment',          {}, ...
0290                   'ECOGMethod',       {}, ...
0291                   'SEEGMethod',       {}), ...
0292               'iHeadModel',        [], ...
0293               ... repmat(db_template('Results'),0)
0294               'Result',              struct(...
0295                   'FileName',        {}, ...
0296                   'Comment',         {}, ...
0297                   'DataFile',        {}, ...
0298                   'isLink',          {}, ...
0299                   'HeadModelType',   {}), ...
0300               ... repmat(db_template('Stat'),  0)
0301               'Stat',                struct(...
0302                   'FileName',        {}, ...
0303                   'Comment',         {}, ...
0304                   'Type',            {}, ...
0305                   'pThreshold',      {}, ...
0306                   'DataFile',        {}), ...
0307               ... repmat(db_template('Image'),  0)
0308               'Image',               struct(...
0309                   'FileName',        {}, ...
0310                   'Comment',         {}), ...
0311               ... repmat(db_template('noiseCov'), 0)
0312               'NoiseCov',            struct(...
0313                   'FileName',        {}, ...
0314                   'Comment',         {}), ...
0315               ... repmat(db_template('Dipoles'), 0)
0316               'Dipoles',             struct(...
0317                   'FileName',        {}, ...
0318                   'Comment',         {}, ...
0319                   'DataFile',        {}), ...
0320               ... repmat(db_template('Timefreq'),  0)
0321               'Timefreq',            struct(...
0322                   'FileName',        {}, ...
0323                   'Comment',         {}, ...
0324                   'DataFile',        {}, ...
0325                   'DataType',        {}), ...
0326               ... repmat(db_template('Matrix'),  0)
0327               'Matrix',             struct(...
0328                   'FileName',        {}, ...
0329                   'Comment',         {}));
0330           
0331     % ==== PROTOCOLINFO ====
0332     case 'protocolinfo'
0333         template = struct(...
0334               'Comment',               'default_protocol', ...
0335               'STUDIES',               '', ...
0336               'SUBJECTS',              '', ...
0337               'iStudy',                [], ...
0338               'UseDefaultAnat',        0, ...
0339               'UseDefaultChannel',     1);     
0340 
0341     case 'protocolsubjects' 
0342         template = struct(...
0343             'Subject',        repmat(db_template('Subject'), 0), ...
0344             'DefaultSubject', []);
0345         
0346     case 'protocolstudies'
0347         template = struct(...
0348             'Study',         repmat(db_template('Study'), 0), ...
0349             'DefaultStudy',  db_template('Study'), ...
0350             'AnalysisStudy', db_template('Study'));
0351         
0352     % ==== LAYOUT ====
0353     case 'layout'
0354         template = struct(...
0355             'MainWindowPos',             [0 0 0 0], ...
0356             'MainWindowSplitHorizontal', 0, ...
0357             'MainWindowExplorationMode', 'Subjects', ...
0358             'ScreensDef',                [], ...
0359             'NoGUI',                     0);     
0360     
0361     % ==== EVENT ====
0362     case 'event'
0363         template = struct(...
0364             'label',      '', ...
0365             'color',      [], ...
0366             'epochs',     [], ...      % [list of epochs indices]
0367             'samples',    [], ...      % [list of time indices]
0368             'times',      [], ...      % [list of time values]
0369             'reactTimes', [], ...      % [list of reaction times, when applicable]
0370             'select',     1);
0371         
0372     % ==== EPOCH ====
0373     case 'epoch'
0374         template = struct(...
0375                 'label',   '', ...        
0376                 'samples', [], ...        % [iStart, iStop]
0377                 'times',   [], ...        % [tStart, tStop]
0378                 'nAvg',    1, ...         % Number of epochs averaged to produce this block
0379                 'select',  1, ...
0380                 'bad',     0, ...
0381                 'channelflag', []);
0382         
0383     % ==== FILE IMPORT ====
0384     case 'sfile'
0385         template = struct(...
0386             'filename',   '', ...  % Full path to the file
0387             'format',     '', ...  % {fif,ctf,egi,neuroscan,brainamp,lena,cartool,...}
0388             'device',     '', ...  % {neuromag,ctf,egi,neuroscan,brainamp,...}
0389             'comment',    '', ...
0390             'byteorder',  '', ...  % ieee-le, ieee-be...
0391             'prop', struct(...            % Properties of the recordings
0392                 'times',        [], ...   % [tStart, tStop]
0393                 'samples',      [], ...   % [iStart, iStop]
0394                 'sfreq',        0, ...    % Sampling frequency
0395                 'nAvg',         1, ...    % Number of trials used to create this file 
0396                 'currCtfComp',  [], ...   % {0,1,3} Current CTF compensation order already applied to the recordings
0397                 'destCtfComp',  []), ...  % {0,1,3} Destination CTF compensation order
0398             'epochs',      repmat(db_template('epoch'), 0), ...
0399             'events',      repmat(db_template('event'), 0), ...
0400             'header',      [], ...
0401             'channelmat',  [], ...
0402             'channelflag', []);
0403         
0404     case 'importoptions'
0405         template = struct(...
0406             'ImportMode',       'Epoch', ...           % Import mode:  {Epoch, Time, Event}
0407             'UseEvents',        0, ...                 % {0,1}: If 1, perform epoching around the selected events
0408             'TimeRange',        [], ...                % Specifying a time window for 'Time' import mode
0409             'EventsTimeRange',  [-0.1000 0.3000], ...  % Time range for epoching, zero is the event onset (if epoching is enabled)
0410             'GetAllEpochs',     0, ...                 % {0,1}: Import all arrays, no matter how many they are
0411             'iEpochs',          1, ...                 % Array of indices of epochs to import (if GetAllEpochs is not enabled)
0412             'SplitRaw',         0, ...                 % {0,1}: If 1, and if importing continuous recordings (no epoching, no events): split recordings in small time blocks
0413             'SplitLength',      2, ...                 % Duration of each split time block, in seconds
0414             'Resample',         0, ...                 % Enable resampling (requires Signal Processing Toolbox)
0415             'ResampleFreq',     0, ...                 % Resampling frequency (if resampling is enabled)
0416             'UseCtfComp',       1, ...                 % Get and apply CTF 3rd gradient correction if available 
0417             'UseSsp',           1, ...                 % Get and apply SSP (Signal Space Projection) vectors if available
0418             'RemoveBaseline',   'no', ...              % Method used to remove baseline of each channel: {no, all, time, sample}
0419             'BaselineRange',    [], ...                % [tStart,tStop] If RemoveBaseline is 'time'; Else ignored
0420             'events',           [], ...                % Events structure: (label, epochs, samples, times, reactTimes, select)
0421             'CreateConditions', 0, ...                 % {0,1} If 1, create new conditions in Brainstorm database if it is more convenient
0422             'ChannelReplace',   1, ...        % If 1, prompts for automatic replacement of an existing channel file. If 2, replace it automatically. If 0, do not do it.
0423             'ChannelAlign',     1, ...        % If 1, prompts for automatic registration. If 2, perform it automatically. If 0, do not do it.
0424             'IgnoreShortEpochs',1, ...        % If 1, prompts for ignoring the epochs that are shorter that the others. If 2, ignore them automatically. If 0, do not do it.
0425             'EventsMode',       'ask', ...    % Where to get the events from: {'ask', 'ignore', Filename, ChannelName, ChannelNames}
0426             'EventsTrackMode',  'ask', ...    % {'value','bit','ask'}   - 4D/BTi only
0427             'DisplayMessages',  1);           % If 0, do not show any of the message boxes that the user would normally see
0428         
0429     % ==== COLORMAPS ====
0430     case 'colormap'
0431         template = struct(...
0432             'Name',             '', ...
0433             'CMap',             [], ...
0434             'isAbsoluteValues', 0, ...
0435             'isNormalized',     0, ...
0436             'DisplayColorbar',  1, ...
0437             'MaxValue',         [], ...
0438             'Contrast',         0, ...
0439             'Brightness',        0);
0440         
0441     case 'colormapinfo'
0442         template.AllTypes = {};
0443         template.Type     = '';
0444 
0445     % ==== GLOBAL DATA ====
0446     case 'measures'
0447         template = struct(...
0448             'DataType',        [], ...
0449             'F',               [], ...
0450             'Time',            [], ...
0451             'SamplingRate',    [], ...
0452             'NumberOfSamples', [], ...
0453             'ChannelFlag',     [], ...
0454             'sFile',           [], ...
0455             'isModified',      0, ...
0456             'ColormapType',    '');
0457 
0458     case 'loadedresults'
0459         template = struct(...
0460             'FileName',         '', ...
0461             'DataType',         '', ...
0462             'Comment',          '', ...
0463             'Time',             [], ...
0464             'SamplingRate',     [], ...
0465             'NumberOfSamples',  [], ...
0466             'ChannelFlag',      [], ...
0467             'ImageGridAmp',     [], ...
0468             'ImagingKernel',    [], ...
0469             'ZScore',           [], ...
0470             'HeadModelType',    [], ...
0471             'GridLoc',          [], ...
0472             'grid2mri_interp',  [], ...
0473             'nComponents',      0, ...
0474             'GoodChannel',      [], ...
0475             'OpticalFlow',      [], ...
0476             'ColormapType',     '', ...
0477             'Atlas',            []); 
0478         
0479     case 'loadeddipoles'
0480         template = struct(...
0481             'FileName',         '', ...
0482             'Comment',          '', ...
0483             'Time',             [], ...
0484             'SamplingRate',     [], ...
0485             'NumberOfSamples',  [], ...
0486             'DipoleNames',      [], ...
0487             'Dipole',           [], ...
0488             'Subset',           []); 
0489         
0490     case 'loadedtimefreq'
0491         template = struct(...
0492             'FileName',         '', ...
0493             'Comment',          '', ...
0494             'DataFile',         '', ...
0495             'DataType',         '', ...
0496             'TF',               [], ...
0497             'Freqs',            [], ...
0498             'Time',             [], ...
0499             'TimeBands',        [], ...
0500             'SamplingRate',     [], ...
0501             'NumberOfSamples',  [], ...
0502             'RefRowNames',      [], ...
0503             'RowNames',         [], ...
0504             'Modality',         [], ...
0505             'Measure',          [], ...
0506             'Method',           [], ...
0507             'Options',          [], ...
0508             'ColormapType',     '', ...
0509             'Atlas',            [], ...
0510             'SurfaceFile',      [], ...
0511             'sPAC',             []); 
0512         
0513     case 'loadedmatrix'
0514         template = struct(...
0515             'FileName',         '', ...
0516             'Comment',          '');
0517         
0518     case 'loadedsurface'
0519         template = struct(...
0520             'FileName',        '', ...
0521             'Name',            '', ...
0522             'Comment',         '', ...
0523             'Vertices',        [], ...
0524             'Faces',           [], ...
0525             'VertConn',        [], ...
0526             'VertNormals',     [], ...
0527             'VertArea',        [], ...
0528             'SulciMap',        [], ...
0529             'tess2mri_interp', [], ...  % Interpolation matrix (Surface -> MRI)
0530             'mrimask',         [], ...  % MRI mask
0531             'Atlas',           db_template('Atlas'), ...
0532             'iAtlas',          1, ...
0533             'isAtlasModified', 0);
0534                 
0535      
0536     case 'loadedmri'
0537         template = struct(...
0538             'FileName',   '', ...
0539             'Comment',    '', ...
0540             'Cube',       [], ...
0541             'Voxsize',    [], ...
0542             'SCS',        [], ...
0543             'NCS',        [], ...
0544             'Header',     [], ...
0545             'Histogram',  [], ...
0546             'InitTransf', [], ...
0547             'History',    []);  
0548 
0549     case 'figureid'
0550         template = struct(...
0551             'Type',           '', ...
0552             'SubType',        '', ...
0553             'Modality',       '');
0554     
0555     case 'figure'
0556         template = struct(...
0557             'Id',                    db_template('FigureId'), ...   
0558             'hFigure',               0, ...
0559             'Handles',               struct(), ...
0560             'SelectedChannels',      []);
0561 
0562     case 'channeldesc'
0563         template = struct(...
0564                 'Name',        '', ...
0565                 'Comment',     '', ...
0566                 'Type',        '', ...
0567                 'Loc',         [], ...
0568                 'Orient',      [], ...
0569                 'Weight',      []);
0570 
0571     case 'dataset'
0572         template = struct(...
0573             'DataFile',    '', ...
0574             'StudyFile',   '', ...
0575             'SubjectFile', '', ...
0576             'ChannelFile', '', ...
0577             'Surfaces',    repmat(db_template('LoadedSurface'), 0), ...
0578             'Measures',    db_template('Measures'), ...
0579             'Results',     repmat(db_template('LoadedResults'), 0), ...
0580             'Dipoles',     repmat(db_template('LoadedDipoles'), 0), ...
0581             'Timefreq',    repmat(db_template('LoadedTimefreq'), 0), ...
0582             'Matrix',      repmat(db_template('LoadedMatrix'), 0), ...
0583             'Channel',     repmat(db_template('ChannelDesc'), 0), ...
0584             'HeadPoints',  [], ...
0585             'Figure',      repmat(db_template('Figure'), 0));
0586 
0587     case 'displayhandlestimeseries'
0588         template = struct(...
0589             'hAxes',         [], ...
0590             'hCursor',       [], ...
0591             'hTextCursor',   [], ... 
0592             'hLines',        [], ...
0593             'LinesLabels',   [], ...
0594             'LinesColor',    [], ...
0595             'hColumnScale',  [], ...
0596             'hColumnScaleText', [], ...
0597             'hColumnScaleBar',  [], ...
0598             'ChannelOffsets',[], ...
0599             'iDispChannels', [], ...
0600             'DataMinMax',    [], ...
0601             'DisplayFactor', [], ...
0602             'DisplayMode',   []);
0603     case 'displayhandlestopography'
0604         template = struct(...
0605             'hSurf',          [], ...
0606             'Wmat',           [], ... 
0607             'DisplayMegGrad', '', ...   % {'first','second','norm'}
0608             'DataMinMax',     [], ...
0609             'hSensorMarkers', [], ...
0610             'hSensorLabels',  [], ...
0611             'hSensorOrient',  [], ...
0612             'hContours',      [], ...
0613             'MarkersLocs',    [], ...
0614             'hLines',         [], ...  % 2D Layout
0615             'ChannelOffsets', [], ...  % 2D Layout
0616             'DisplayFactor',  1, ...   % 2D Layout
0617             'hCursors',       [], ...  % 2D Layout
0618             'hZeroLines',     [], ...  % 2D Layout
0619             'jTextLegend',    [], ...  % 2D Layout
0620             'Channel',        [], ...  % 2D Layout
0621             'Vertices',       [], ...  % 2D Layout
0622             'SelChan',        [], ...  % 2D Layout
0623             'BoxesCenters',   [], ...  % 2D Layout
0624             'LinesColor',     []);     % 2D Layout
0625     case 'displayhandles3dviz'
0626         template = struct(...
0627             'hSensorMarkers', [], ...
0628             'hSensorLabels',  [], ...
0629             'hSensorOrient',  []);
0630         
0631     case 'displayhandlestimefreq'
0632         template = struct(...
0633             'DataMinMax', []);
0634            
0635     case 'atlas'
0636         template = struct(...
0637             'Name',   'User scouts', ...
0638             'Scouts', repmat(db_template('Scout'), 0));
0639         
0640     case 'scout'
0641         template = struct(...
0642             'Vertices',    [], ... % Index of vertices
0643             'Seed',        [], ... % Initial vertex of the scout area
0644             'Color',       [], ...
0645             'Label',       '', ...
0646             'Function',    'Mean', ... % Scout function: PCA, FastPCA, Mean, Mean_norm, Max, Power, All
0647             'Region',      'UU', ...      % 1st letter: Left/Right/Unknown,  2nd letter: Frontal/Parietal/Temporal/Occipital/Central/Unkown
0648             'Handles',     repmat(struct( ...
0649                 'hFig',        [], ... % Figure handle in which the scout is displayed
0650                 'hScout',      [], ... % Handles to the graphical scout objects
0651                 'hLabel',      [], ... 
0652                 'hVertices',   [], ...
0653                 'hPatch',      [], ...
0654                 'hContour',    []), 0));
0655     case 'scoutmat'
0656         template = struct(...
0657             'Vertices',   [], ... % Index of vertices
0658             'Seed',       [], ... % Initial vertex of the scout area
0659             'Color',      [0 1 0], ...
0660             'Label',      '', ...
0661             'Function',   'Mean', ...
0662             'Region',     'UU');   % 1st letter: Left/Right/Unknown,  2nd letter: Frontal/Parietal/Temporal/Occipital/Central/Unkown
0663         
0664     case 'cluster'
0665         template = struct(...
0666             'Sensors',    '', ...   % File on which the scout is defined
0667             'Label',      '', ...   % Comment
0668             'Function',   'Mean');  % Cluster function: PCA, FastPCA, Mean, Max, Power, All
0669            
0670     case 'globaldata'
0671         template = struct(...
0672             'Program', struct(...
0673                 'Version',           [], ...
0674                 'BrainstormHomeDir', [], ...
0675                 'GUI',               [], ...
0676                 'ProgressBar',       [], ...
0677                 'Clipboard',         struct(...
0678                     'Nodes',         [], ...
0679                     'isCut',         0), ...
0680                 'isReadOnly',        0), ...
0681             'DataBase', struct(...
0682                 'ProtocolInfo',       [], ...
0683                 'ProtocolSubjects',   [], ...
0684                 'ProtocolStudies',    [], ...
0685                 'isProtocolLoaded',   [], ...
0686                 'isProtocolModified', [], ...
0687                 'iProtocol',          0, ...
0688                 'BrainstormDbDir',    [], ...
0689                 'DbVersion',          0), ...
0690             'DataBaseSavedTime', 0, ...
0691             'DataSet',  repmat(db_template('DataSet'), 0), ...
0692             'Mri',      repmat(db_template('LoadedMri'), 0), ...
0693             'Surface',  repmat(db_template('LoadedSurface'), 0), ...
0694             'UserTimeWindow', struct(...
0695                 'Time',            [], ...
0696                 'SamplingRate',    [], ...
0697                 'NumberOfSamples', 0, ...
0698                 'CurrentTime',     []), ...
0699             'FullTimeWindow', struct(...
0700                 'Epochs', repmat(struct(...
0701                     'Time',            [], ...
0702                     'NumberOfSamples', 0), 0), ...
0703                 'CurrentEpoch',    []), ...
0704             'UserFrequencies', struct(...
0705                 'Freqs',        [], ...
0706                 'iCurrentFreq', []), ...
0707             'ChannelEditor',  struct(...
0708                 'ChannelFile',    '', ...
0709                 'ChannelMat',     [], ...
0710                 'DataFile',       [], ...
0711                 'LocColumns',     [], ...
0712                 'OrientColumns',  [], ...
0713                 'isModified',     0), ...
0714             'HeadModeler',    struct(...
0715                 'BFS',            [], ...
0716                 'nbSpheres',      [], ...
0717                 'GUI',            struct(...
0718                     'hFig',                     [], ...
0719                     'Figure3DButtonDown_Bak',   [], ...
0720                     'Figure3DButtonMotion_Bak', [], ...
0721                     'Figure3DButtonUp_Bak',     [], ...
0722                     'Figure3DCloseRequest_Bak', [], ...
0723                     'selectedButton',           [], ...
0724                     'mouseClicked',             [], ...
0725                     'isClosing',                [], ...
0726                     'hButtonTransX',            [], ...
0727                     'hButtonTransY',            [], ...
0728                     'hButtonTransZ',            [], ...
0729                     'hButtonResize',            [])), ...
0730              'Clusters', repmat(db_template('Cluster'), 0), ...
0731              'CurrentFigure',        struct(...
0732                  'Type3D', [], ...
0733                  'Type2D', [], ...
0734                  'TypeTF', [], ...
0735                  'Last',   []), ...
0736              'CurrentScoutsSurface', '', ...
0737              'VisualizationFilters', struct(...
0738                  'LowPassEnabled',       0, ...
0739                  'LowPassValue',         40, ...
0740                  'HighPassEnabled',      0, ...
0741                  'HighPassValue',        1, ...
0742                  'SinRemovalEnabled',    0, ...
0743                  'SinRemovalValue',      [], ...
0744                  'MirrorEnabled',        1), ...
0745              'Colormaps',            [], ...
0746              'Preferences',          [], ...
0747              'ChannelSelections',    struct(...
0748                  'CurrentSelection', [], ...
0749                  'Selections',       [], ...
0750                  'DefaultFactor',    []), ...
0751              'SelectedRows', [], ...
0752              'Processes', struct( ...
0753                  'All',       [], ...
0754                  'Current',   [], ...
0755                  'Pipelines', repmat(struct(...
0756                      'Name',      '', ...
0757                      'Processes', []), 0), ...
0758                  'Signature', []), ...
0759              'ProcessReports', struct(...
0760                  'jFrameReport', [], ...
0761                  'jTextHtml',    [], ...
0762                  'CurrentFile',  [], ...
0763                  'Reports',      []), ...
0764              'Interpolations', [], ...
0765              'Temp',           []);
0766         template.SelectedRows = {};
0767         
0768     case 'landmark'
0769         template = struct(...
0770             'Name',   '', ...
0771             'mriLoc', '');
0772     case 'scs'
0773         template = struct(...
0774             'NAS',    [], ...
0775             'LPA',    [], ...
0776             'RPA',    [], ...
0777             'R',      [], ...
0778             'T',      []);
0779     case 'ncs'
0780         template = struct(...
0781             'AC',    [], ...
0782             'PC',    [], ...
0783             'IH',    []);
0784         
0785     % ===== 3DViz appdata structure =====
0786     case 'tessinfo'
0787         anatomyColor = [.45*[1 1 1]; .6*[1 1 1]];
0788         template = struct(...
0789             'SurfaceFile',                '', ...
0790             'Name',                    '', ...
0791             'DataSource',              struct(...
0792                 'Type',                '', ...   % {'data', 'results', 'stats', ...}
0793                 'FileName',            '', ...
0794                 'Atlas',               []), ...
0795             'ColormapType',            '', ...
0796             'hPatch',                  [], ...
0797             'nVertices',               0, ...
0798             'nFaces',                  0, ...
0799             'SurfAlpha',               0, ...    % Surface transparency
0800             'SurfShowSulci',           0, ...    % Toggle show/hide surface sulci map viewing   
0801             'SurfShowEdges',           0, ...    % Toggle oon/off surface edges display
0802             'AnatomyColor',            anatomyColor, ... % RGB color for sulci map encoding
0803             'SurfSmoothValue',         0, ...
0804             'Data',                    [], ...   % MEG, EEG or current density for overlay to anatomy (needs to be compatible in size with FaceVertexCdata patch property)
0805             'DataMinMax',              [], ...   % Minimum and maximum of the DataSource.FileName file
0806             'DataWmat',                [], ...   % Interpolation matrix (transformation to map Data on hPatch surface) 
0807             'OverlayCube',             [], ...   % Interpolated results in a MRI volume
0808             'DataAlpha',               0, ...    % Alpha for blending of anatomy and surface data
0809             'DataThreshold',           0.5, ...  % Threshold to apply to color coding of data values  
0810             'SizeThreshold',           1, ...    % Threshold to apply to color coding of data values  
0811             'DataLimitValue',          [], ...   % Relative limits for colormapping
0812             'CutsPosition',            [0 0 0], ...   % Position of the three orthogonal MRI slices
0813             'Resect',                  'none', ...    % Either [x,y,z] resect values, or {'left', 'right', 'none'}
0814             'MipAnatomy',              [], ...        % 3 cells: Maximum intensity power in each direction (MRI amplitudes)
0815             'MipFunctional',           [] ...         % 3 cellsMaximum intensity power in each direction (sources amplitudes)
0816             );      
0817         template.MipAnatomy = cell(3,1);
0818         template.MipFunctional = cell(3,1);
0819         
0820     case 'tfinfo'
0821         template = struct(...
0822             'FileName',        '', ...
0823             'Comment',         '', ...
0824             'DisplayMode',     '', ...
0825             'Function',        'power', ...
0826             'HideEdgeEffects', 0, ...
0827             'iFreqs',          [], ...
0828             'RowName',         [], ...
0829             'InputTarget',     []);
0830         
0831     case 'nodelist'
0832         template = struct(...
0833            'name',       '', ...
0834            'comment',    '', ...
0835            'type',       '', ...
0836            'jPanel',     [], ...
0837            'jBorder',    [], ...
0838            'jTree',      [], ...
0839            'jPanelTag',  [], ...
0840            'jCheckTag',  [], ...
0841            'contents',   [], ...
0842            'filetags',   [], ...
0843            'commontags', []);
0844        
0845     case 'processfile'
0846         template = struct(...
0847             'iStudy',       0, ...
0848             'iItem',        0, ...
0849             'FileName',     '', ...
0850             'FileType',     '', ...
0851             'Comment',      '', ...
0852             'Condition',    '', ...
0853             'SubjectFile',  '', ...
0854             'SubjectName',  '', ...
0855             'DataFile',     '', ...
0856             'ChannelFile',  '', ...
0857             'ChannelTypes', '');
0858        
0859     case 'importfile'
0860         template = struct(...
0861             'iStudy',       0, ...
0862             'iItem',        0, ...
0863             'FileName',     '', ...
0864             'FileType',     'import', ...
0865             'Comment',      'import', ...
0866             'Condition',    'import', ...
0867             'SubjectFile',  '', ...
0868             'SubjectName',  '', ...
0869             'DataFile',     '', ...
0870             'ChannelFile',  '', ...
0871             'ChannelTypes', []);
0872         
0873     case 'processdesc'
0874         template = struct(...
0875             ... % Process description
0876             'Function',    [], ...
0877             'Comment',     '', ...
0878             'FileTag',     '', ...
0879             'Description', '', ...
0880             'Category',    '', ...
0881             'SubGroup',    '', ...
0882             'Index',       0, ...
0883             'isSeparator', 0, ...
0884             ... % Input type
0885             'InputTypes',  [], ...
0886             'OutputTypes', [], ...
0887             'nInputs',     1, ...
0888             'nMinFiles',   1, ...
0889             'isPaired',    0, ...
0890             'isSourceAbsolute', -1, ...
0891             'processDim',   [], ...
0892             'options',      [] ...
0893             );
0894         template.InputTypes = {};
0895         template.OutputTypes = {};
0896        
0897     otherwise
0898         error('Unknown data template : %s', structureName);
0899 end
0900   
0901   
0902 
0903

Generated on Mon 22-May-2023 06:53:56 by m2html © 2005