add dawnbin to matlab default path

add dawnbin to matlab default path

%------------ FreeSurfer -----------------------------%
fshome = getenv('FREESURFER_HOME');
fsmatlab = sprintf('%s/matlab',fshome);
if (exist(fsmatlab) == 7)
    path(path,fsmatlab);
end
clear fshome fsmatlab;
%-----------------------------------------------------%

%------------ FreeSurfer FAST ------------------------%
fsfasthome = getenv('FSFAST_HOME');
fsfasttoolbox = sprintf('%s/toolbox',fsfasthome);
if (exist(fsfasttoolbox) == 7)
    path(path,fsfasttoolbox);
end
clear fsfasthome fsfasttoolbox;
%-----------------------------------------------------%

user=getenv('USER');
if strcmp(user, 'xst833'),
    home = getenv('HOME');
else
    user,
    home = '/home/xst833/';
end

addpath(genpath(sprintf('%s/fmri/afni.matlab/',home)));
addpath(genpath(sprintf('%s/fmri/bct.20121204/',home)));
addpath(genpath(sprintf('%s/fmri/nbs1.2/',home)));
addpath(genpath(sprintf('%s/fmri/gretna/',home)));
addpath(genpath(sprintf('%s/fmri/spm8/',home)));
addpath(genpath(sprintf('%s/fmri/surfstat/',home)));
addpath(genpath(sprintf('%s/fmri/panda/PANDA/',home)));
addpath(genpath(sprintf('%s/fmri/matlab/gift/GroupICATv3.0a/icatb',home)));
addpath(genpath(sprintf('%s/fmri/matlab/rest/REST/',home)));
addpath(genpath(sprintf('%s/fmri/matlab/mlsp/',home)));
addpath((sprintf('%s/fmri/matlab/m2html/',home)));
addpath((sprintf('%s/fmri/matlab/BrainNetViewer/',home)));
addpath((sprintf('%s/fmri/matlab/eig3/',home)));
addpath((sprintf('%s/fmri/matlab/export_fig/',home)));

addpath((sprintf('%s/dawn/bin/',home)));
clear home;

%function filter_path(pattern)
pattern='.git';
all = path;
[entries] = regexp(all, '([^:]+):', 'tokens');
for i = 1:length(entries)
     entry = char(entries{i});
     if (~isempty(strfind(entry, pattern)))
         rmpath(entry);
     end;
end;
clear all pattern entry entries;

%------------ FreeSurfer -----------------------------%
fshome = getenv('FREESURFER_HOME');
fsmatlab = sprintf('%s/matlab',fshome);
if (exist(fsmatlab) == 7)
    path(path,fsmatlab);
end
clear fshome fsmatlab;
%-----------------------------------------------------%

%------------ FreeSurfer FAST ------------------------%
fsfasthome = getenv('FSFAST_HOME');
fsfasttoolbox = sprintf('%s/toolbox',fsfasthome);
if (exist(fsfasttoolbox) == 7)
    path(path,fsfasttoolbox);
end
clear fsfasthome fsfasttoolbox;
%-----------------------------------------------------%

user=getenv('USER');
if strcmp(user, 'xst833'),
    home = getenv('HOME');
else
    user,
    home = '/home/xst833/';
end

addpath(genpath(sprintf('%s/fmri/afni.matlab/',home)));
addpath(genpath(sprintf('%s/fmri/bct.20121204/',home)));
addpath(genpath(sprintf('%s/fmri/nbs1.2/',home)));
addpath(genpath(sprintf('%s/fmri/gretna/',home)));
addpath(genpath(sprintf('%s/fmri/spm8/',home)));
addpath(genpath(sprintf('%s/fmri/surfstat/',home)));
addpath(genpath(sprintf('%s/fmri/panda/PANDA/',home)));
addpath(genpath(sprintf('%s/fmri/matlab/gift/GroupICATv3.0a/icatb',home)));
addpath(genpath(sprintf('%s/fmri/matlab/rest/REST/',home)));
addpath(genpath(sprintf('%s/fmri/matlab/mlsp/',home)));
addpath((sprintf('%s/fmri/matlab/m2html/',home)));
addpath((sprintf('%s/fmri/matlab/BrainNetViewer/',home)));
addpath((sprintf('%s/fmri/matlab/eig3/',home)));
addpath((sprintf('%s/fmri/matlab/export_fig/',home)));
clear home;

%function filter_path(pattern)
pattern='.git';
all = path;
[entries] = regexp(all, '([^:]+):', 'tokens');
for i = 1:length(entries)
     entry = char(entries{i});
     if (~isempty(strfind(entry, pattern)))
         rmpath(entry);
     end;
end;
clear all pattern entry entries;


added matlab kmeans script

added matlab kmeans script

Code Repo/Part 4 - Clustering/kmeans.matlab


minor compatibility change

minor compatibility change

if ~isdeployed,

self=mfilename('fullpath');
matlabver = version('-release');
cself=[mfilename('fullpath'),'_', matlabver , '_cache.m'];
cmd=['test ', cself, ' -nt ', self '.m && echo 1 || echo 0'];
[~, snewer]=system(cmd);
if 1==str2num(snewer), %if cache is newer than me
    fprintf(2, 'Loading cached startup path: %s\n', cself);
    %load cache
    pd=pwd;  [pathn, scriptn]=fileparts(cself);
    cd(pathn);
    eval(sprintf('npath=%s;', scriptn)); path(npath);
    addpath(pathn);
    cd(pd);
    clear self snewer cself pd pathn scriptn npath
    return
end %if cself does not exist, it is Ok, system will think it fails to be newer!

%------------ FreeSurfer -----------------------------%
fshome = getenv('FREESURFER_HOME');
fsmatlab = sprintf('%s/matlab',fshome);
if (exist(fsmatlab) == 7)
    path(path,fsmatlab);
end
clear fshome fsmatlab;
%-----------------------------------------------------%

%------------ FreeSurfer FAST ------------------------%
fsfasthome = getenv('FSFAST_HOME');
fsfasttoolbox = sprintf('%s/toolbox',fsfasthome);
if (exist(fsfasttoolbox) == 7)
    path(path,fsfasttoolbox);
end
clear fsfasthome fsfasttoolbox;
%-----------------------------------------------------%

user=getenv('USER'),
node=getenv('HOSTNAME'),
%if strcmp(user, 'xst833'),
if ismember(user, {'xst833', 'tbp688', 'dawnsong', 'songx4'})
    home = getenv('HOME'),
else
    home = '/home/xst833/';
end

fmriTools={
'fmri/afni.matlab';
'fmri/bct.20121204';
'fmri/nbs1.2';
'fmri/gretna';
% 'spm12';
% 'spm12/toolbox/cat12';
'fmri/spm8';
'fmri/spm8/toolbox/vbm8';
'fmri/surfstat';
'fmri/panda/PANDA';
'matlab/gift/GroupICATv4.0a/icatb';
'matlab/rest/REST';
'matlab/mlsp';
'matlab/m2thml';
'matlab/BrainNetViewer';
'matlab/eig3';
'matlab/export_fig';
'matlab/ite/code';
'matlab/jsonlab';
%'matlab/MIToolbox';
};
for i=1:size(fmriTools, 1),
    dir=sprintf(['%s/' fmriTools{i}], home);
    if exist(dir, 'dir'),
        addpath(genpath(dir));
        fprintf(2, sprintf('# Added path: %s\n', dir));
    else
        fprintf(2, sprintf('## Cannot find dir: %s\n', dir));
    end
end

%add my bin path
dawnbind= getenv('DAWNBIND');
addpath(genpath(dawnbind));
clear home fmriTools;

fprintf(2, sprintf('#Cleaning .git .svn dirs\n'));
%function filter_path(pattern)
pattern={'.git', '.svn'};
all = path;
[entries] = regexp(all, '([^:]+):', 'tokens');
for i = 1:length(entries)
    entry = char(entries{i});
    for j=1:length(pattern),
         if (~isempty(strfind(entry, pattern{j})))
             rmpath(entry);
         end;
    end
end;
clear all pattern entry entries;

savepath(cself)
clear self cself snewer
%else %~isdeployed
%    fprintf('I am deployed')

%set default figure settings
set(0, 'defaultTextFontSize', 16)
set(0, 'defaultLineLineWidth', 2)
set(0, 'defaultAxesFontSize', 16)

end

if ~isdeployed,

self=mfilename;
matlabver = version('-release');
cself=[mfilename('fullpath'),'_', matlabver , '_cache.m'];
[~, snewer]=system(['test ', cself, ' -nt ', self ' && echo 1 || echo 0']);
if 1==str2num(snewer), %if cache is newer than me
    fprintf(2, 'Loading cached startup path: %s\n', cself);
    %load cache
    pd=pwd;  [pathn, scriptn]=fileparts(cself);
    cd(pathn);
    eval(sprintf('npath=%s;', scriptn)); path(npath);
    addpath(pathn);
    cd(pd);
    clear self snewer cself pd pathn scriptn npath
    return
end %if cself does not exist, it is Ok, system will think it fails to be newer!

%------------ FreeSurfer -----------------------------%
fshome = getenv('FREESURFER_HOME');
fsmatlab = sprintf('%s/matlab',fshome);
if (exist(fsmatlab) == 7)
    path(path,fsmatlab);
end
clear fshome fsmatlab;
%-----------------------------------------------------%

%------------ FreeSurfer FAST ------------------------%
fsfasthome = getenv('FSFAST_HOME');
fsfasttoolbox = sprintf('%s/toolbox',fsfasthome);
if (exist(fsfasttoolbox) == 7)
    path(path,fsfasttoolbox);
end
clear fsfasthome fsfasttoolbox;
%-----------------------------------------------------%

user=getenv('USER'),
node=getenv('HOSTNAME'),
%if strcmp(user, 'xst833'),
if ismember(user, {'xst833', 'tbp688', 'dawnsong', 'songx4'})
    home = getenv('HOME'),
else
    home = '/home/xst833/';
end

fmriTools={
'fmri/afni.matlab';
'fmri/bct.20121204';
'fmri/nbs1.2';
'fmri/gretna';
% 'spm12';
% 'spm12/toolbox/cat12';
'fmri/spm8';
'fmri/spm8/toolbox/vbm8';
'fmri/surfstat';
'fmri/panda/PANDA';
'matlab/gift/GroupICATv4.0a/icatb';
'matlab/rest/REST';
'matlab/mlsp';
'matlab/m2thml';
'matlab/BrainNetViewer';
'matlab/eig3';
'matlab/export_fig';
'matlab/ite/code';
'matlab/jsonlab';
%'matlab/MIToolbox';
};
for i=1:size(fmriTools, 1),
    dir=sprintf(['%s/' fmriTools{i}], home);
    if exist(dir, 'dir'),
        addpath(genpath(dir));
        fprintf(2, sprintf('# Added path: %s\n', dir));
    else
        fprintf(2, sprintf('## Cannot find dir: %s\n', dir));
    end
end

%add my bin path
dawnbind= getenv('DAWNBIND');
addpath(genpath(dawnbind));
clear home fmriTools;

fprintf(2, sprintf('#Cleaning .git .svn dirs\n'));
%function filter_path(pattern)
pattern={'.git', '.svn'};
all = path;
[entries] = regexp(all, '([^:]+):', 'tokens');
for i = 1:length(entries)
    entry = char(entries{i});
    for j=1:length(pattern),
         if (~isempty(strfind(entry, pattern{j})))
             rmpath(entry);
         end;
    end
end;
clear all pattern entry entries;

savepath(cself)
clear self cself snewer
%else %~isdeployed
%    fprintf('I am deployed')

%set default figure settings
set(0, 'defaultTextFontSize', 16)
set(0, 'defaultAxisFontSize', 16)
set(0, 'defaultLineLineWidth', 2)

end


reminded save

reminded save

%------------ FreeSurfer -----------------------------%
fshome = getenv('FREESURFER_HOME');
fsmatlab = sprintf('%s/matlab',fshome);
if (exist(fsmatlab) == 7)
    path(path,fsmatlab);
end
clear fshome fsmatlab;
%-----------------------------------------------------%

%------------ FreeSurfer FAST ------------------------%
fsfasthome = getenv('FSFAST_HOME');
fsfasttoolbox = sprintf('%s/toolbox',fsfasthome);
if (exist(fsfasttoolbox) == 7)
    path(path,fsfasttoolbox);
end
clear fsfasthome fsfasttoolbox;
%-----------------------------------------------------%

home = getenv('HOME');
addpath(genpath(sprintf('%s/fmri/afni.matlab/',home)));
addpath(genpath(sprintf('%s/fmri/bct.20121204/',home)));
addpath(genpath(sprintf('%s/fmri/nbs1.2/',home)));
addpath(genpath(sprintf('%s/fmri/gretna/',home)));
addpath(genpath(sprintf('%s/fmri/spm8/',home)));
addpath(genpath(sprintf('%s/fmri/surfstat/',home)));
addpath(genpath(sprintf('%s/fmri/panda/PANDA/',home)));
addpath(genpath(sprintf('%s/fmri/matlab/gift/GroupICATv3.0a/icatb',home)));
addpath(genpath(sprintf('%s/fmri/matlab/rest/REST/',home)));
clear home;

%function filter_path(pattern)
pattern='.git';
all = path;
[entries] = regexp(all, '([^:]+):', 'tokens');
for i = 1:length(entries)
     entry = char(entries{i});
     if (~isempty(strfind(entry, pattern)))
         rmpath(entry);
     end;
end;
clear all pattern entry entries;


set my default figure font size and line width

if ~isdeployed,

self=mfilename;
matlabver = version('-release');
cself=[mfilename('fullpath'),'_', matlabver , '_cache.m'];
[~, snewer]=system(['test ', cself, ' -nt ', self ' && echo 1 || echo 0']);
if 1==str2num(snewer), %if cache is newer than me
    fprintf(2, 'Loading cached startup path: %s\n', cself);
    %load cache
    pd=pwd;  [pathn, scriptn]=fileparts(cself);
    cd(pathn);
    eval(sprintf('npath=%s;', scriptn)); path(npath);
    addpath(pathn);
    cd(pd);
    clear self snewer cself pd pathn scriptn npath
    return
end %if cself does not exist, it is Ok, system will think it fails to be newer!

%------------ FreeSurfer -----------------------------%
fshome = getenv('FREESURFER_HOME');
fsmatlab = sprintf('%s/matlab',fshome);
if (exist(fsmatlab) == 7)
    path(path,fsmatlab);
end
clear fshome fsmatlab;
%-----------------------------------------------------%

%------------ FreeSurfer FAST ------------------------%
fsfasthome = getenv('FSFAST_HOME');
fsfasttoolbox = sprintf('%s/toolbox',fsfasthome);
if (exist(fsfasttoolbox) == 7)
    path(path,fsfasttoolbox);
end
clear fsfasthome fsfasttoolbox;
%-----------------------------------------------------%

user=getenv('USER'),
node=getenv('HOSTNAME'),
%if strcmp(user, 'xst833'),
if ismember(user, {'xst833', 'tbp688', 'dawnsong', 'songx4'})
    home = getenv('HOME'),
else
    home = '/home/xst833/';
end

fmriTools={
'fmri/afni.matlab';
'fmri/bct.20121204';
'fmri/nbs1.2';
'fmri/gretna';
% 'spm12';
% 'spm12/toolbox/cat12';
'fmri/spm8';
'fmri/spm8/toolbox/vbm8';
'fmri/surfstat';
'fmri/panda/PANDA';
'matlab/gift/GroupICATv4.0a/icatb';
'matlab/rest/REST';
'matlab/mlsp';
'matlab/m2thml';
'matlab/BrainNetViewer';
'matlab/eig3';
'matlab/export_fig';
'matlab/ite/code';
'matlab/jsonlab';
%'matlab/MIToolbox';
};
for i=1:size(fmriTools, 1),
    dir=sprintf(['%s/' fmriTools{i}], home);
    if exist(dir, 'dir'),
        addpath(genpath(dir));
        fprintf(2, sprintf('# Added path: %s\n', dir));
    else
        fprintf(2, sprintf('## Cannot find dir: %s\n', dir));
    end
end

%add my bin path
dawnbind= getenv('DAWNBIND');
addpath(genpath(dawnbind));
clear home fmriTools;

fprintf(2, sprintf('#Cleaning .git .svn dirs\n'));
%function filter_path(pattern)
pattern={'.git', '.svn'};
all = path;
[entries] = regexp(all, '([^:]+):', 'tokens');
for i = 1:length(entries)
    entry = char(entries{i});
    for j=1:length(pattern),
         if (~isempty(strfind(entry, pattern{j})))
             rmpath(entry);
         end;
    end
end;
clear all pattern entry entries;

savepath(cself)
clear self cself snewer
%else %~isdeployed
%    fprintf('I am deployed')

%set default figure settings
set(0, 'defaultTextFontSize', 16)
set(0, 'defaultAxisFontSize', 16)
set(0, 'defaultLineLineWidth', 2)

end

if ~isdeployed,

self=mfilename;
matlabver = version('-release');
cself=[mfilename('fullpath'),'_', matlabver , '_cache.m'];
[~, snewer]=system(['test ', cself, ' -nt ', self ' && echo 1 || echo 0']);
if 1==str2num(snewer), %if cache is newer than me
    fprintf(2, 'Loading cached startup path: %s\n', cself);
    %load cache
    pd=pwd;  [pathn, scriptn]=fileparts(cself);
    cd(pathn);
    eval(sprintf('npath=%s;', scriptn)); path(npath);
    addpath(pathn);
    cd(pd);
    clear self snewer cself pd pathn scriptn npath
    return
end %if cself does not exist, it is Ok, system will think it fails to be newer!

%------------ FreeSurfer -----------------------------%
fshome = getenv('FREESURFER_HOME');
fsmatlab = sprintf('%s/matlab',fshome);
if (exist(fsmatlab) == 7)
    path(path,fsmatlab);
end
clear fshome fsmatlab;
%-----------------------------------------------------%

%------------ FreeSurfer FAST ------------------------%
fsfasthome = getenv('FSFAST_HOME');
fsfasttoolbox = sprintf('%s/toolbox',fsfasthome);
if (exist(fsfasttoolbox) == 7)
    path(path,fsfasttoolbox);
end
clear fsfasthome fsfasttoolbox;
%-----------------------------------------------------%

user=getenv('USER'),
node=getenv('HOSTNAME'),
%if strcmp(user, 'xst833'),
if ismember(user, {'xst833', 'tbp688', 'dawnsong', 'songx4'})
    home = getenv('HOME'),
else
    home = '/home/xst833/';
end

fmriTools={
'fmri/afni.matlab';
'fmri/bct.20121204';
'fmri/nbs1.2';
'fmri/gretna';
% 'spm12';
% 'spm12/toolbox/cat12';
'fmri/spm8';
'fmri/spm8/toolbox/vbm8';
'fmri/surfstat';
'fmri/panda/PANDA';
'matlab/gift/GroupICATv4.0a/icatb';
'matlab/rest/REST';
'matlab/mlsp';
'matlab/m2thml';
'matlab/BrainNetViewer';
'matlab/eig3';
'matlab/export_fig';
'matlab/ite/code';
'matlab/jsonlab';
%'matlab/MIToolbox';
};
for i=1:size(fmriTools, 1),
    dir=sprintf(['%s/' fmriTools{i}], home);
    if exist(dir, 'dir'),
        addpath(genpath(dir));
        fprintf(2, sprintf('# Added path: %s\n', dir));
    else
        fprintf(2, sprintf('## Cannot find dir: %s\n', dir));
    end
end

%add my bin path
dawnbind= getenv('DAWNBIND');
addpath(genpath(dawnbind));
clear home fmriTools;

fprintf(2, sprintf('#Cleaning .git .svn dirs\n'));
%function filter_path(pattern)
pattern={'.git', '.svn'};
all = path;
[entries] = regexp(all, '([^:]+):', 'tokens');
for i = 1:length(entries)
    entry = char(entries{i});
    for j=1:length(pattern),
         if (~isempty(strfind(entry, pattern{j})))
             rmpath(entry);
         end;
    end
end;
clear all pattern entry entries;

savepath(cself)
clear self cself snewer
%else %~isdeployed
%    fprintf('I am deployed')
end


make sure nnr747 can find my  home's matlab config

if ~isdeployed,

self=mfilename;
cself=[mfilename('fullpath'), '_cache.m'];
[~, snewer]=system(['test ', cself, ' -nt ', self ' && echo 1 || echo 0']);
if 1==str2num(snewer), %if cache is newer than me
    fprintf(2, 'Loading cached startup path: %s\n', cself);
    %load cache
    pd=pwd;  path=fileparts(cself);
    cd(path); path=startup_cache; addpath(path);  cd(pd);
    clear self snewer cself pd path
    return
end %if cself does not exist, it is Ok, system will think it fails to be newer!

%------------ FreeSurfer -----------------------------%
fshome = getenv('FREESURFER_HOME');
fsmatlab = sprintf('%s/matlab',fshome);
if (exist(fsmatlab) == 7)
    path(path,fsmatlab);
end
clear fshome fsmatlab;
%-----------------------------------------------------%

%------------ FreeSurfer FAST ------------------------%
fsfasthome = getenv('FSFAST_HOME');
fsfasttoolbox = sprintf('%s/toolbox',fsfasthome);
if (exist(fsfasttoolbox) == 7)
    path(path,fsfasttoolbox);
end
clear fsfasthome fsfasttoolbox;
%-----------------------------------------------------%

user=getenv('USER'),
node=getenv('HOSTNAME'),
%if strcmp(user, 'xst833'),
if ismember(user, {'xst833', 'tbp688'})
    home = getenv('HOME'),
else
    home = '/home/xst833/';
end

fmriTools={
'fmri/afni.matlab';
'fmri/bct.20121204';
'fmri/nbs1.2';
'fmri/gretna';
% 'spm12';
% 'spm12/toolbox/cat12';
'fmri/spm8';
'fmri/spm8/toolbox/vbm8';
'fmri/surfstat';
'fmri/panda/PANDA';
'matlab/gift/GroupICATv4.0a/icatb';
'matlab/rest/REST';
'matlab/mlsp';
'matlab/m2thml';
'matlab/BrainNetViewer';
'matlab/eig3';
'matlab/export_fig';
'matlab/ite/code';
'matlab/jsonlab';
%'matlab/MIToolbox';
};
for i=1:size(fmriTools, 1),
    dir=sprintf(['%s/' fmriTools{i}], home);
    if exist(dir, 'dir'),
        addpath(genpath(dir));
        fprintf(2, sprintf('# Added path: %s\n', dir));
    else
        fprintf(2, sprintf('## Cannot find dir: %s\n', dir));
    end
end

%add my bin path
dawnbind= getenv('DAWNBIND');
addpath(genpath(dawnbind));
clear home fmriTools;

fprintf(2, sprintf('#Cleaning .git .svn dirs\n'));
%function filter_path(pattern)
pattern={'.git', '.svn'};
all = path;
[entries] = regexp(all, '([^:]+):', 'tokens');
for i = 1:length(entries)
    entry = char(entries{i});
    for j=1:length(pattern),
         if (~isempty(strfind(entry, pattern{j})))
             rmpath(entry);
         end;
    end
end;
clear all pattern entry entries;

savepath(cself)
clear self cself snewer
end %~isdeployed

if ~isdeployed,

self=mfilename;
cself=[mfilename('fullpath'), '_cache.m'];
[~, snewer]=system(['test ', cself, ' -nt ', self ' && echo 1 || echo 0']);
if 1==str2num(snewer), %if cache is newer than me
    fprintf(2, 'Loading cached startup path: %s\n', cself);
    %load cache
    pd=pwd;  path=fileparts(cself);
    cd(path); path=startup_cache; addpath(path);  cd(pd);
    clear self snewer cself pd path
    return
end %if cself does not exist, it is Ok, system will think it fails to be newer!

%------------ FreeSurfer -----------------------------%
fshome = getenv('FREESURFER_HOME');
fsmatlab = sprintf('%s/matlab',fshome);
if (exist(fsmatlab) == 7)
    path(path,fsmatlab);
end
clear fshome fsmatlab;
%-----------------------------------------------------%

%------------ FreeSurfer FAST ------------------------%
fsfasthome = getenv('FSFAST_HOME');
fsfasttoolbox = sprintf('%s/toolbox',fsfasthome);
if (exist(fsfasttoolbox) == 7)
    path(path,fsfasttoolbox);
end
clear fsfasthome fsfasttoolbox;
%-----------------------------------------------------%

user=getenv('USER'),
node=getenv('HOSTNAME'),
%if strcmp(user, 'xst833'),
    home = getenv('HOME');
%else
%    home = '/home/xst833/';
%end

fmriTools={
'fmri/afni.matlab';
'fmri/bct.20121204';
'fmri/nbs1.2';
'fmri/gretna';
% 'spm12';
% 'spm12/toolbox/cat12';
'fmri/spm8';
'fmri/spm8/toolbox/vbm8';
'fmri/surfstat';
'fmri/panda/PANDA';
'matlab/gift/GroupICATv4.0a/icatb';
'matlab/rest/REST';
'matlab/mlsp';
'matlab/m2thml';
'matlab/BrainNetViewer';
'matlab/eig3';
'matlab/export_fig';
'matlab/ite/code';
'matlab/jsonlab';
%'matlab/MIToolbox';
};
for i=1:size(fmriTools, 1),
    dir=sprintf(['%s/' fmriTools{i}], home);
    if exist(dir, 'dir'),
        addpath(genpath(dir));
        fprintf(2, sprintf('# Added path: %s\n', dir));
    else
        fprintf(2, sprintf('## Cannot find dir: %s\n', dir));
    end
end

%add my bin path
dawnbind= getenv('DAWNBIND');
addpath(genpath(dawnbind));
clear home fmriTools;

fprintf(2, sprintf('#Cleaning .git .svn dirs\n'));
%function filter_path(pattern)
pattern={'.git', '.svn'};
all = path;
[entries] = regexp(all, '([^:]+):', 'tokens');
for i = 1:length(entries)
    entry = char(entries{i});
    for j=1:length(pattern),
         if (~isempty(strfind(entry, pattern{j})))
             rmpath(entry);
         end;
    end
end;
clear all pattern entry entries;

savepath(cself)
clear self cself snewer
end %~isdeployed


Update public/libs/bower_components/ace-builds/demo/kitchen-sink/docs/matlab.matlab

Signed-off-by: Bernard Ojengwa <fccb4cc00c1ba7e51bf5c2b5f77130b9fe8d917e@gmail.com>

%{
   %{
      Ace Matlab demo
   %}
%}

classdef hello
   methods
      function greet(this)
         disp('Hello!')  % say hi
      end
   end
end

% transpose
a = [ 'x''y', "x\n\
      y", 1' ]' + 2'


add new lines to match github repo

add new lines to match github repo

git-svn-id: 0dfcd2cbfde11cd338b51061f2a1a040b934da89@483 786e58fb-9377-0410-9ff7-e4ac0ac0635c


Update tmp/bower_components/ace-builds/demo/kitchen-sink/docs/matlab.matlab

Signed-off-by: Bernard Ojengwa <fccb4cc00c1ba7e51bf5c2b5f77130b9fe8d917e@gmail.com>


considering matlab version when building the cached startup file

if ~isdeployed,

self=mfilename;
matlabver = version('-release');
cself=[mfilename('fullpath'),'_', matlabver , '_cache.m'];
[~, snewer]=system(['test ', cself, ' -nt ', self ' && echo 1 || echo 0']);
if 1==str2num(snewer), %if cache is newer than me
    fprintf(2, 'Loading cached startup path: %s\n', cself);
    %load cache
    pd=pwd;  path=fileparts(cself);
    cd(path); path=startup_cache; addpath(path);  cd(pd);
    clear self snewer cself pd path
    return
end %if cself does not exist, it is Ok, system will think it fails to be newer!

%------------ FreeSurfer -----------------------------%
fshome = getenv('FREESURFER_HOME');
fsmatlab = sprintf('%s/matlab',fshome);
if (exist(fsmatlab) == 7)
    path(path,fsmatlab);
end
clear fshome fsmatlab;
%-----------------------------------------------------%

%------------ FreeSurfer FAST ------------------------%
fsfasthome = getenv('FSFAST_HOME');
fsfasttoolbox = sprintf('%s/toolbox',fsfasthome);
if (exist(fsfasttoolbox) == 7)
    path(path,fsfasttoolbox);
end
clear fsfasthome fsfasttoolbox;
%-----------------------------------------------------%

user=getenv('USER'),
node=getenv('HOSTNAME'),
%if strcmp(user, 'xst833'),
if ismember(user, {'xst833', 'tbp688', 'dawnsong', 'songx4'})
    home = getenv('HOME'),
else
    home = '/home/xst833/';
end

fmriTools={
'fmri/afni.matlab';
'fmri/bct.20121204';
'fmri/nbs1.2';
'fmri/gretna';
% 'spm12';
% 'spm12/toolbox/cat12';
'fmri/spm8';
'fmri/spm8/toolbox/vbm8';
'fmri/surfstat';
'fmri/panda/PANDA';
'matlab/gift/GroupICATv4.0a/icatb';
'matlab/rest/REST';
'matlab/mlsp';
'matlab/m2thml';
'matlab/BrainNetViewer';
'matlab/eig3';
'matlab/export_fig';
'matlab/ite/code';
'matlab/jsonlab';
%'matlab/MIToolbox';
};
for i=1:size(fmriTools, 1),
    dir=sprintf(['%s/' fmriTools{i}], home);
    if exist(dir, 'dir'),
        addpath(genpath(dir));
        fprintf(2, sprintf('# Added path: %s\n', dir));
    else
        fprintf(2, sprintf('## Cannot find dir: %s\n', dir));
    end
end

%add my bin path
dawnbind= getenv('DAWNBIND');
addpath(genpath(dawnbind));
clear home fmriTools;

fprintf(2, sprintf('#Cleaning .git .svn dirs\n'));
%function filter_path(pattern)
pattern={'.git', '.svn'};
all = path;
[entries] = regexp(all, '([^:]+):', 'tokens');
for i = 1:length(entries)
    entry = char(entries{i});
    for j=1:length(pattern),
         if (~isempty(strfind(entry, pattern{j})))
             rmpath(entry);
         end;
    end
end;
clear all pattern entry entries;

savepath(cself)
clear self cself snewer
end %~isdeployed

if ~isdeployed,

self=mfilename;
cself=[mfilename('fullpath'), '_cache.m'];
[~, snewer]=system(['test ', cself, ' -nt ', self ' && echo 1 || echo 0']);
if 1==str2num(snewer), %if cache is newer than me
    fprintf(2, 'Loading cached startup path: %s\n', cself);
    %load cache
    pd=pwd;  path=fileparts(cself);
    cd(path); path=startup_cache; addpath(path);  cd(pd);
    clear self snewer cself pd path
    return
end %if cself does not exist, it is Ok, system will think it fails to be newer!

%------------ FreeSurfer -----------------------------%
fshome = getenv('FREESURFER_HOME');
fsmatlab = sprintf('%s/matlab',fshome);
if (exist(fsmatlab) == 7)
    path(path,fsmatlab);
end
clear fshome fsmatlab;
%-----------------------------------------------------%

%------------ FreeSurfer FAST ------------------------%
fsfasthome = getenv('FSFAST_HOME');
fsfasttoolbox = sprintf('%s/toolbox',fsfasthome);
if (exist(fsfasttoolbox) == 7)
    path(path,fsfasttoolbox);
end
clear fsfasthome fsfasttoolbox;
%-----------------------------------------------------%

user=getenv('USER'),
node=getenv('HOSTNAME'),
%if strcmp(user, 'xst833'),
if ismember(user, {'xst833', 'tbp688', 'dawnsong', 'songx4'})
    home = getenv('HOME'),
else
    home = '/home/xst833/';
end

fmriTools={
'fmri/afni.matlab';
'fmri/bct.20121204';
'fmri/nbs1.2';
'fmri/gretna';
% 'spm12';
% 'spm12/toolbox/cat12';
'fmri/spm8';
'fmri/spm8/toolbox/vbm8';
'fmri/surfstat';
'fmri/panda/PANDA';
'matlab/gift/GroupICATv4.0a/icatb';
'matlab/rest/REST';
'matlab/mlsp';
'matlab/m2thml';
'matlab/BrainNetViewer';
'matlab/eig3';
'matlab/export_fig';
'matlab/ite/code';
'matlab/jsonlab';
%'matlab/MIToolbox';
};
for i=1:size(fmriTools, 1),
    dir=sprintf(['%s/' fmriTools{i}], home);
    if exist(dir, 'dir'),
        addpath(genpath(dir));
        fprintf(2, sprintf('# Added path: %s\n', dir));
    else
        fprintf(2, sprintf('## Cannot find dir: %s\n', dir));
    end
end

%add my bin path
dawnbind= getenv('DAWNBIND');
addpath(genpath(dawnbind));
clear home fmriTools;

fprintf(2, sprintf('#Cleaning .git .svn dirs\n'));
%function filter_path(pattern)
pattern={'.git', '.svn'};
all = path;
[entries] = regexp(all, '([^:]+):', 'tokens');
for i = 1:length(entries)
    entry = char(entries{i});
    for j=1:length(pattern),
         if (~isempty(strfind(entry, pattern{j})))
             rmpath(entry);
         end;
    end
end;
clear all pattern entry entries;

savepath(cself)
clear self cself snewer
end %~isdeployed


considering my local computer and my NIH account

if ~isdeployed,

self=mfilename;
cself=[mfilename('fullpath'), '_cache.m'];
[~, snewer]=system(['test ', cself, ' -nt ', self ' && echo 1 || echo 0']);
if 1==str2num(snewer), %if cache is newer than me
    fprintf(2, 'Loading cached startup path: %s\n', cself);
    %load cache
    pd=pwd;  path=fileparts(cself);
    cd(path); path=startup_cache; addpath(path);  cd(pd);
    clear self snewer cself pd path
    return
end %if cself does not exist, it is Ok, system will think it fails to be newer!

%------------ FreeSurfer -----------------------------%
fshome = getenv('FREESURFER_HOME');
fsmatlab = sprintf('%s/matlab',fshome);
if (exist(fsmatlab) == 7)
    path(path,fsmatlab);
end
clear fshome fsmatlab;
%-----------------------------------------------------%

%------------ FreeSurfer FAST ------------------------%
fsfasthome = getenv('FSFAST_HOME');
fsfasttoolbox = sprintf('%s/toolbox',fsfasthome);
if (exist(fsfasttoolbox) == 7)
    path(path,fsfasttoolbox);
end
clear fsfasthome fsfasttoolbox;
%-----------------------------------------------------%

user=getenv('USER'),
node=getenv('HOSTNAME'),
%if strcmp(user, 'xst833'),
if ismember(user, {'xst833', 'tbp688', 'dawnsong', 'songx4'})
    home = getenv('HOME'),
else
    home = '/home/xst833/';
end

fmriTools={
'fmri/afni.matlab';
'fmri/bct.20121204';
'fmri/nbs1.2';
'fmri/gretna';
% 'spm12';
% 'spm12/toolbox/cat12';
'fmri/spm8';
'fmri/spm8/toolbox/vbm8';
'fmri/surfstat';
'fmri/panda/PANDA';
'matlab/gift/GroupICATv4.0a/icatb';
'matlab/rest/REST';
'matlab/mlsp';
'matlab/m2thml';
'matlab/BrainNetViewer';
'matlab/eig3';
'matlab/export_fig';
'matlab/ite/code';
'matlab/jsonlab';
%'matlab/MIToolbox';
};
for i=1:size(fmriTools, 1),
    dir=sprintf(['%s/' fmriTools{i}], home);
    if exist(dir, 'dir'),
        addpath(genpath(dir));
        fprintf(2, sprintf('# Added path: %s\n', dir));
    else
        fprintf(2, sprintf('## Cannot find dir: %s\n', dir));
    end
end

%add my bin path
dawnbind= getenv('DAWNBIND');
addpath(genpath(dawnbind));
clear home fmriTools;

fprintf(2, sprintf('#Cleaning .git .svn dirs\n'));
%function filter_path(pattern)
pattern={'.git', '.svn'};
all = path;
[entries] = regexp(all, '([^:]+):', 'tokens');
for i = 1:length(entries)
    entry = char(entries{i});
    for j=1:length(pattern),
         if (~isempty(strfind(entry, pattern{j})))
             rmpath(entry);
         end;
    end
end;
clear all pattern entry entries;

savepath(cself)
clear self cself snewer
end %~isdeployed

if ~isdeployed,

self=mfilename;
cself=[mfilename('fullpath'), '_cache.m'];
[~, snewer]=system(['test ', cself, ' -nt ', self ' && echo 1 || echo 0']);
if 1==str2num(snewer), %if cache is newer than me
    fprintf(2, 'Loading cached startup path: %s\n', cself);
    %load cache
    pd=pwd;  path=fileparts(cself);
    cd(path); path=startup_cache; addpath(path);  cd(pd);
    clear self snewer cself pd path
    return
end %if cself does not exist, it is Ok, system will think it fails to be newer!

%------------ FreeSurfer -----------------------------%
fshome = getenv('FREESURFER_HOME');
fsmatlab = sprintf('%s/matlab',fshome);
if (exist(fsmatlab) == 7)
    path(path,fsmatlab);
end
clear fshome fsmatlab;
%-----------------------------------------------------%

%------------ FreeSurfer FAST ------------------------%
fsfasthome = getenv('FSFAST_HOME');
fsfasttoolbox = sprintf('%s/toolbox',fsfasthome);
if (exist(fsfasttoolbox) == 7)
    path(path,fsfasttoolbox);
end
clear fsfasthome fsfasttoolbox;
%-----------------------------------------------------%

user=getenv('USER'),
node=getenv('HOSTNAME'),
%if strcmp(user, 'xst833'),
if ismember(user, {'xst833', 'tbp688'})
    home = getenv('HOME'),
else
    home = '/home/xst833/';
end

fmriTools={
'fmri/afni.matlab';
'fmri/bct.20121204';
'fmri/nbs1.2';
'fmri/gretna';
% 'spm12';
% 'spm12/toolbox/cat12';
'fmri/spm8';
'fmri/spm8/toolbox/vbm8';
'fmri/surfstat';
'fmri/panda/PANDA';
'matlab/gift/GroupICATv4.0a/icatb';
'matlab/rest/REST';
'matlab/mlsp';
'matlab/m2thml';
'matlab/BrainNetViewer';
'matlab/eig3';
'matlab/export_fig';
'matlab/ite/code';
'matlab/jsonlab';
%'matlab/MIToolbox';
};
for i=1:size(fmriTools, 1),
    dir=sprintf(['%s/' fmriTools{i}], home);
    if exist(dir, 'dir'),
        addpath(genpath(dir));
        fprintf(2, sprintf('# Added path: %s\n', dir));
    else
        fprintf(2, sprintf('## Cannot find dir: %s\n', dir));
    end
end

%add my bin path
dawnbind= getenv('DAWNBIND');
addpath(genpath(dawnbind));
clear home fmriTools;

fprintf(2, sprintf('#Cleaning .git .svn dirs\n'));
%function filter_path(pattern)
pattern={'.git', '.svn'};
all = path;
[entries] = regexp(all, '([^:]+):', 'tokens');
for i = 1:length(entries)
    entry = char(entries{i});
    for j=1:length(pattern),
         if (~isempty(strfind(entry, pattern{j})))
             rmpath(entry);
         end;
    end
end;
clear all pattern entry entries;

savepath(cself)
clear self cself snewer
end %~isdeployed


update test output after correcting the indentation bug

git-svn-id: 0dfcd2cbfde11cd338b51061f2a1a040b934da89@464 786e58fb-9377-0410-9ff7-e4ac0ac0635c


use cache to speedup loading paths

use cache to speedup loading paths

if ~isdeployed,

self=mfilename;
cself=[mfilename('fullpath'), '_cache.m'];
[~, snewer]=system(['test ', cself, ' -nt ', self ' && echo 1 || echo 0']);
if 1==str2num(snewer), %if cache is newer than me
    fprintf(2, 'Loading cached startup path: %s\n', cself);
    %load cache
    pd=pwd;  path=fileparts(cself);
    cd(path); path=startup_cache; addpath(path);  cd(pd);
    clear self snewer cself pd path
    return
end %if cself does not exist, it is Ok, system will think it fails to be newer!

%------------ FreeSurfer -----------------------------%
fshome = getenv('FREESURFER_HOME');
fsmatlab = sprintf('%s/matlab',fshome);
if (exist(fsmatlab) == 7)
    path(path,fsmatlab);
end
clear fshome fsmatlab;
%-----------------------------------------------------%

%------------ FreeSurfer FAST ------------------------%
fsfasthome = getenv('FSFAST_HOME');
fsfasttoolbox = sprintf('%s/toolbox',fsfasthome);
if (exist(fsfasttoolbox) == 7)
    path(path,fsfasttoolbox);
end
clear fsfasthome fsfasttoolbox;
%-----------------------------------------------------%

user=getenv('USER'),
node=getenv('HOSTNAME'),
%if strcmp(user, 'xst833'),
    home = getenv('HOME');
%else
%    home = '/home/xst833/';
%end

fmriTools={
'fmri/afni.matlab';
'fmri/bct.20121204';
'fmri/nbs1.2';
'gretna';
% 'spm12';
% 'spm12/toolbox/cat12';
'spm8';
'spm8/toolbox/vbm8';
'surfstat';
'panda/PANDA';
'matlab/gift/GroupICATv4.0a/icatb';
'matlab/rest/REST';
'matlab/mlsp';
'matlab/m2thml';
'matlab/BrainNetViewer';
'matlab/eig3';
'matlab/export_fig';
'matlab/ite/code';
'matlab/jsonlab';
%'matlab/MIToolbox';
};
for i=1:size(fmriTools, 1),
    dir=sprintf(['%s/' fmriTools{i}], home);
    if exist(dir, 'dir'),
        addpath(genpath(dir));
        fprintf(2, sprintf('# Added path: %s\n', dir));
    else
        fprintf(2, sprintf('## Cannot find dir: %s\n', dir));
    end
end

%add my bin path
dawnbind= getenv('DAWNBIND');
addpath(genpath(dawnbind));
clear home fmriTools;

fprintf(2, sprintf('#Cleaning .git .svn dirs\n'));
%function filter_path(pattern)
pattern={'.git', '.svn'};
all = path;
[entries] = regexp(all, '([^:]+):', 'tokens');
for i = 1:length(entries)
    entry = char(entries{i});
    for j=1:length(pattern),
         if (~isempty(strfind(entry, pattern{j})))
             rmpath(entry);
         end;
    end
end;
clear all pattern entry entries;

savepath(cself)
clear self cself snewer
end %~isdeployed

if ~isdeployed,

%------------ FreeSurfer -----------------------------%
fshome = getenv('FREESURFER_HOME');
fsmatlab = sprintf('%s/matlab',fshome);
if (exist(fsmatlab) == 7)
    path(path,fsmatlab);
end
clear fshome fsmatlab;
%-----------------------------------------------------%

%------------ FreeSurfer FAST ------------------------%
fsfasthome = getenv('FSFAST_HOME');
fsfasttoolbox = sprintf('%s/toolbox',fsfasthome);
if (exist(fsfasttoolbox) == 7)
    path(path,fsfasttoolbox);
end
clear fsfasthome fsfasttoolbox;
%-----------------------------------------------------%

user=getenv('USER'),
node=getenv('HOSTNAME'),
%if strcmp(user, 'xst833'),
    home = getenv('HOME');
%else
%    home = '/home/xst833/';
%end

fmriTools={
'fmri/afni.matlab';
'fmri/bct.20121204';
'fmri/nbs1.2';
'gretna';
% 'spm12';
% 'spm12/toolbox/cat12';
'spm8';
'spm8/toolbox/vbm8';
'surfstat';
'panda/PANDA';
'matlab/gift/GroupICATv4.0a/icatb';
'matlab/rest/REST';
'matlab/mlsp';
'matlab/m2thml';
'matlab/BrainNetViewer';
'matlab/eig3';
'matlab/export_fig';
'matlab/ite/code';
'matlab/jsonlab';
'matlab/MIToolbox';
};
for i=1:size(fmriTools, 1),
    dir=sprintf(['%s/' fmriTools{i}], home);
    if exist(dir, 'dir'),
        addpath(genpath(dir));
        fprintf(2, sprintf('# Added path: %s\n', dir));
    else
        fprintf(2, sprintf('## Cannot find dir: %s\n', dir));
    end
end

%add my bin path
dawnbind= getenv('DAWNBIND');
addpath(genpath(dawnbind));
clear home fmriTools;

fprintf(2, sprintf('#Cleaning .git .svn dirs\n'));
%function filter_path(pattern)
pattern={'.git', '.svn'};
all = path;
[entries] = regexp(all, '([^:]+):', 'tokens');
for i = 1:length(entries)
    entry = char(entries{i});
    for j=1:length(pattern),
         if (~isempty(strfind(entry, pattern{j})))
             rmpath(entry);
         end;
    end
end;
clear all pattern entry entries;

end %~isdeployed


add Peng Hanchuan's Information estimation toolbox

if ~isdeployed,

%------------ FreeSurfer -----------------------------%
fshome = getenv('FREESURFER_HOME');
fsmatlab = sprintf('%s/matlab',fshome);
if (exist(fsmatlab) == 7)
    path(path,fsmatlab);
end
clear fshome fsmatlab;
%-----------------------------------------------------%

%------------ FreeSurfer FAST ------------------------%
fsfasthome = getenv('FSFAST_HOME');
fsfasttoolbox = sprintf('%s/toolbox',fsfasthome);
if (exist(fsfasttoolbox) == 7)
    path(path,fsfasttoolbox);
end
clear fsfasthome fsfasttoolbox;
%-----------------------------------------------------%

user=getenv('USER'),
node=getenv('HOSTNAME'),
if strcmp(user, 'xst833'),
    home = getenv('HOME');
else
    home = '/home/xst833/';
end

addpath(genpath(sprintf('%s/fmri/afni.matlab/',home)));
addpath(genpath(sprintf('%s/fmri/bct.20121204/',home)));
addpath(genpath(sprintf('%s/fmri/nbs1.2/',home)));
addpath(genpath(sprintf('%s/fmri/gretna/',home)));
%addpath((sprintf('%s/fmri/spm12/',home)));
%addpath((sprintf('%s/fmri/spm12/toolbox/cat12',home)));
addpath((sprintf('%s/fmri/spm8/',home)));
addpath((sprintf('%s/fmri/spm8/toolbox/vbm8',home)));
addpath(genpath(sprintf('%s/fmri/surfstat/',home)));
addpath(genpath(sprintf('%s/fmri/panda/PANDA/',home)));
addpath(genpath(sprintf('%s/fmri/matlab/gift/GroupICATv4.0a/icatb',home)));
addpath(genpath(sprintf('%s/fmri/matlab/rest/REST/',home)));
addpath(genpath(sprintf('%s/fmri/matlab/mlsp/',home)));
addpath((sprintf('%s/fmri/matlab/m2html/',home)));
addpath((sprintf('%s/fmri/matlab/BrainNetViewer/',home)));
addpath((sprintf('%s/fmri/matlab/eig3/',home)));
addpath((sprintf('%s/fmri/matlab/export_fig/',home)));
addpath(genpath(sprintf('%s/fmri/matlab/ite/code', home)));
addpath(sprintf('%s/fmri/matlab/jsonlab', home));
addpath(genpath(sprintf('%s/fmri/matlab/PengHC-MIToolbox-2.1.2', home)));

%add my bin path
dawnbind= getenv('DAWNBIND');
addpath(genpath(dawnbind));
clear home;

%function filter_path(pattern)
pattern={'.git', '.svn'};
all = path;
[entries] = regexp(all, '([^:]+):', 'tokens');
for i = 1:length(entries)
    entry = char(entries{i});
    for j=1:length(pattern),
         if (~isempty(strfind(entry, pattern{j})))
             rmpath(entry);
         end;
    end
end;
clear all pattern entry entries;

end %~isdeployed

if ~isdeployed,

%------------ FreeSurfer -----------------------------%
fshome = getenv('FREESURFER_HOME');
fsmatlab = sprintf('%s/matlab',fshome);
if (exist(fsmatlab) == 7)
    path(path,fsmatlab);
end
clear fshome fsmatlab;
%-----------------------------------------------------%

%------------ FreeSurfer FAST ------------------------%
fsfasthome = getenv('FSFAST_HOME');
fsfasttoolbox = sprintf('%s/toolbox',fsfasthome);
if (exist(fsfasttoolbox) == 7)
    path(path,fsfasttoolbox);
end
clear fsfasthome fsfasttoolbox;
%-----------------------------------------------------%

user=getenv('USER'),
node=getenv('HOSTNAME'),
if strcmp(user, 'xst833'),
    home = getenv('HOME');
else
    home = '/home/xst833/';
end

addpath(genpath(sprintf('%s/fmri/afni.matlab/',home)));
addpath(genpath(sprintf('%s/fmri/bct.20121204/',home)));
addpath(genpath(sprintf('%s/fmri/nbs1.2/',home)));
addpath(genpath(sprintf('%s/fmri/gretna/',home)));
%addpath((sprintf('%s/fmri/spm12/',home)));
%addpath((sprintf('%s/fmri/spm12/toolbox/cat12',home)));
addpath((sprintf('%s/fmri/spm8/',home)));
addpath((sprintf('%s/fmri/spm8/toolbox/vbm8',home)));
addpath(genpath(sprintf('%s/fmri/surfstat/',home)));
addpath(genpath(sprintf('%s/fmri/panda/PANDA/',home)));
addpath(genpath(sprintf('%s/fmri/matlab/gift/GroupICATv4.0a/icatb',home)));
addpath(genpath(sprintf('%s/fmri/matlab/rest/REST/',home)));
addpath(genpath(sprintf('%s/fmri/matlab/mlsp/',home)));
addpath((sprintf('%s/fmri/matlab/m2html/',home)));
addpath((sprintf('%s/fmri/matlab/BrainNetViewer/',home)));
addpath((sprintf('%s/fmri/matlab/eig3/',home)));
addpath((sprintf('%s/fmri/matlab/export_fig/',home)));
addpath(genpath(sprintf('%s/fmri/matlab/ite/code', home)));
addpath(sprintf('%s/fmri/matlab/jsonlab', home));

%add my bin path
dawnbind= getenv('DAWNBIND');
addpath(genpath(dawnbind));
clear home;

%function filter_path(pattern)
pattern={'.git', '.svn'};
all = path;
[entries] = regexp(all, '([^:]+):', 'tokens');
for i = 1:length(entries)
    entry = char(entries{i});
    for j=1:length(pattern),
         if (~isempty(strfind(entry, pattern{j})))
             rmpath(entry);
         end;
    end
end;
clear all pattern entry entries;

end %~isdeployed


add jsonlab into path

add jsonlab into path

if ~isdeployed,

%------------ FreeSurfer -----------------------------%
fshome = getenv('FREESURFER_HOME');
fsmatlab = sprintf('%s/matlab',fshome);
if (exist(fsmatlab) == 7)
    path(path,fsmatlab);
end
clear fshome fsmatlab;
%-----------------------------------------------------%

%------------ FreeSurfer FAST ------------------------%
fsfasthome = getenv('FSFAST_HOME');
fsfasttoolbox = sprintf('%s/toolbox',fsfasthome);
if (exist(fsfasttoolbox) == 7)
    path(path,fsfasttoolbox);
end
clear fsfasthome fsfasttoolbox;
%-----------------------------------------------------%

user=getenv('USER'),
node=getenv('HOSTNAME'),
if strcmp(user, 'xst833'),
    home = getenv('HOME');
else
    home = '/home/xst833/';
end

addpath(genpath(sprintf('%s/fmri/afni.matlab/',home)));
addpath(genpath(sprintf('%s/fmri/bct.20121204/',home)));
addpath(genpath(sprintf('%s/fmri/nbs1.2/',home)));
addpath(genpath(sprintf('%s/fmri/gretna/',home)));
addpath((sprintf('%s/fmri/spm8/',home)));
addpath((sprintf('%s/fmri/spm8/toolbox/vbm8',home)));
addpath(genpath(sprintf('%s/fmri/surfstat/',home)));
addpath(genpath(sprintf('%s/fmri/panda/PANDA/',home)));
addpath(genpath(sprintf('%s/fmri/matlab/gift/GroupICATv4.0a/icatb',home)));
addpath(genpath(sprintf('%s/fmri/matlab/rest/REST/',home)));
addpath(genpath(sprintf('%s/fmri/matlab/mlsp/',home)));
addpath((sprintf('%s/fmri/matlab/m2html/',home)));
addpath((sprintf('%s/fmri/matlab/BrainNetViewer/',home)));
addpath((sprintf('%s/fmri/matlab/eig3/',home)));
addpath((sprintf('%s/fmri/matlab/export_fig/',home)));
addpath(genpath(sprintf('%s/fmri/matlab/ite/code', home)));
addpath(sprintf('%s/fmri/matlab/jsonlab', home));

%add my bin path
dawnbind= getenv('DAWNBIND');
addpath(genpath(dawnbind));
clear home;

%function filter_path(pattern)
pattern={'.git', '.svn'};
all = path;
[entries] = regexp(all, '([^:]+):', 'tokens');
for i = 1:length(entries)
    entry = char(entries{i});
    for j=1:length(pattern),
         if (~isempty(strfind(entry, pattern{j})))
             rmpath(entry);
         end;
    end
end;
clear all pattern entry entries;

end %~isdeployed

if ~isdeployed,

%------------ FreeSurfer -----------------------------%
fshome = getenv('FREESURFER_HOME');
fsmatlab = sprintf('%s/matlab',fshome);
if (exist(fsmatlab) == 7)
    path(path,fsmatlab);
end
clear fshome fsmatlab;
%-----------------------------------------------------%

%------------ FreeSurfer FAST ------------------------%
fsfasthome = getenv('FSFAST_HOME');
fsfasttoolbox = sprintf('%s/toolbox',fsfasthome);
if (exist(fsfasttoolbox) == 7)
    path(path,fsfasttoolbox);
end
clear fsfasthome fsfasttoolbox;
%-----------------------------------------------------%

user=getenv('USER'),
node=getenv('HOSTNAME'),
if strcmp(user, 'xst833'),
    home = getenv('HOME');
else
    home = '/home/xst833/';
end

addpath(genpath(sprintf('%s/fmri/afni.matlab/',home)));
addpath(genpath(sprintf('%s/fmri/bct.20121204/',home)));
addpath(genpath(sprintf('%s/fmri/nbs1.2/',home)));
addpath(genpath(sprintf('%s/fmri/gretna/',home)));
addpath((sprintf('%s/fmri/spm8/',home)));
addpath((sprintf('%s/fmri/spm8/toolbox/vbm8',home)));
addpath(genpath(sprintf('%s/fmri/surfstat/',home)));
addpath(genpath(sprintf('%s/fmri/panda/PANDA/',home)));
addpath(genpath(sprintf('%s/fmri/matlab/gift/GroupICATv3.0a/icatb',home)));
addpath(genpath(sprintf('%s/fmri/matlab/rest/REST/',home)));
addpath(genpath(sprintf('%s/fmri/matlab/mlsp/',home)));
addpath((sprintf('%s/fmri/matlab/m2html/',home)));
addpath((sprintf('%s/fmri/matlab/BrainNetViewer/',home)));
addpath((sprintf('%s/fmri/matlab/eig3/',home)));
addpath((sprintf('%s/fmri/matlab/export_fig/',home)));
addpath(genpath(sprintf('%s/fmri/matlab/ite/code', home)));

%add my bin path
dawnbind= getenv('DAWNBIND');
addpath(genpath(dawnbind));
clear home;

%function filter_path(pattern)
pattern={'.git', '.svn'};
all = path;
[entries] = regexp(all, '([^:]+):', 'tokens');
for i = 1:length(entries)
    entry = char(entries{i});
    for j=1:length(pattern),
         if (~isempty(strfind(entry, pattern{j})))
             rmpath(entry);
         end;
    end
end;
clear all pattern entry entries;

end %~isdeployed


filter .git path in matlab startup

filter .git path in matlab startup

%------------ FreeSurfer -----------------------------%
fshome = getenv('FREESURFER_HOME');
fsmatlab = sprintf('%s/matlab',fshome);
if (exist(fsmatlab) == 7)
    path(path,fsmatlab);
end
clear fshome fsmatlab;
%-----------------------------------------------------%

%------------ FreeSurfer FAST ------------------------%
fsfasthome = getenv('FSFAST_HOME');
fsfasttoolbox = sprintf('%s/toolbox',fsfasthome);
if (exist(fsfasttoolbox) == 7)
    path(path,fsfasttoolbox);
end
clear fsfasthome fsfasttoolbox;
%-----------------------------------------------------%

home = getenv('HOME');
addpath(genpath(sprintf('%s/fmri/afni.matlab/',home)));
addpath(genpath(sprintf('%s/fmri/bct.20121204/',home)));
addpath(genpath(sprintf('%s/fmri/nbs1.2/',home)));
addpath(genpath(sprintf('%s/fmri/gretna/',home)));
addpath(genpath(sprintf('%s/fmri/spm8/',home)));
addpath(genpath(sprintf('%s/fmri/surfstat/',home)));
addpath(genpath(sprintf('%s/fmri/panda/PANDA/',home)));
addpath(genpath(sprintf('%s/fmri/matlab/gift/GroupICATv3.0a/icatb',home)));
addpath(genpath(sprintf('%s/fmri/matlab/rest/REST/',home)));
clear home;

%function filter_path(pattern)
pattern='.git';
all = path;
[entries] = regexp(all, '([^:]+):', 'tokens');
for i = 1:length(entries)
     entry = char(entries{i});
     if (~isempty(strfind(entry, pattern)))
         rmpath(entry);
     end;
end;

%------------ FreeSurfer -----------------------------%
fshome = getenv('FREESURFER_HOME');
fsmatlab = sprintf('%s/matlab',fshome);
if (exist(fsmatlab) == 7)
    path(path,fsmatlab);
end
clear fshome fsmatlab;
%-----------------------------------------------------%

%------------ FreeSurfer FAST ------------------------%
fsfasthome = getenv('FSFAST_HOME');
fsfasttoolbox = sprintf('%s/toolbox',fsfasthome);
if (exist(fsfasttoolbox) == 7)
    path(path,fsfasttoolbox);
end
clear fsfasthome fsfasttoolbox;
%-----------------------------------------------------%

home = getenv('HOME');
addpath(genpath(sprintf('%s/fmri/afni.matlab/',home)));
addpath(genpath(sprintf('%s/fmri/bct.20121204/',home)));
addpath(genpath(sprintf('%s/fmri/nbs1.2/',home)));
addpath(genpath(sprintf('%s/fmri/gretna/',home)));
addpath(genpath(sprintf('%s/fmri/spm8/',home)));
addpath(genpath(sprintf('%s/fmri/surfstat/',home)));
addpath(genpath(sprintf('%s/fmri/panda/PANDA/',home)));
addpath(genpath(sprintf('%s/fmri/matlab/gift/GroupICATv3.0a/icatb',home)));
clear home;


cleaner way to define my toolboxes for Matlab to startup

if ~isdeployed,

%------------ FreeSurfer -----------------------------%
fshome = getenv('FREESURFER_HOME');
fsmatlab = sprintf('%s/matlab',fshome);
if (exist(fsmatlab) == 7)
    path(path,fsmatlab);
end
clear fshome fsmatlab;
%-----------------------------------------------------%

%------------ FreeSurfer FAST ------------------------%
fsfasthome = getenv('FSFAST_HOME');
fsfasttoolbox = sprintf('%s/toolbox',fsfasthome);
if (exist(fsfasttoolbox) == 7)
    path(path,fsfasttoolbox);
end
clear fsfasthome fsfasttoolbox;
%-----------------------------------------------------%

user=getenv('USER'),
node=getenv('HOSTNAME'),
%if strcmp(user, 'xst833'),
    home = getenv('HOME');
%else
%    home = '/home/xst833/';
%end

fmriTools={
'fmri/afni.matlab';
'fmri/bct.20121204';
'fmri/nbs1.2';
'gretna';
% 'spm12';
% 'spm12/toolbox/cat12';
'spm8';
'spm8/toolbox/vbm8';
'surfstat';
'panda/PANDA';
'matlab/gift/GroupICATv4.0a/icatb';
'matlab/rest/REST';
'matlab/mlsp';
'matlab/m2thml';
'matlab/BrainNetViewer';
'matlab/eig3';
'matlab/export_fig';
'matlab/ite/code';
'matlab/jsonlab';
'matlab/MIToolbox';
};
for i=1:size(fmriTools, 1),
    dir=sprintf(['%s/' fmriTools{i}], home);
    if exist(dir, 'dir'),
        addpath(genpath(dir));
        fprintf(2, sprintf('# Added path: %s\n', dir));
    else
        fprintf(2, sprintf('## Cannot find dir: %s\n', dir));
    end
end

%add my bin path
dawnbind= getenv('DAWNBIND');
addpath(genpath(dawnbind));
clear home fmriTools;

fprintf(2, sprintf('#Cleaning .git .svn dirs\n'));
%function filter_path(pattern)
pattern={'.git', '.svn'};
all = path;
[entries] = regexp(all, '([^:]+):', 'tokens');
for i = 1:length(entries)
    entry = char(entries{i});
    for j=1:length(pattern),
         if (~isempty(strfind(entry, pattern{j})))
             rmpath(entry);
         end;
    end
end;
clear all pattern entry entries;

end %~isdeployed

if ~isdeployed,

%------------ FreeSurfer -----------------------------%
fshome = getenv('FREESURFER_HOME');
fsmatlab = sprintf('%s/matlab',fshome);
if (exist(fsmatlab) == 7)
    path(path,fsmatlab);
end
clear fshome fsmatlab;
%-----------------------------------------------------%

%------------ FreeSurfer FAST ------------------------%
fsfasthome = getenv('FSFAST_HOME');
fsfasttoolbox = sprintf('%s/toolbox',fsfasthome);
if (exist(fsfasttoolbox) == 7)
    path(path,fsfasttoolbox);
end
clear fsfasthome fsfasttoolbox;
%-----------------------------------------------------%

user=getenv('USER'),
node=getenv('HOSTNAME'),
%if strcmp(user, 'xst833'),
    home = getenv('HOME');
%else
%    home = '/home/xst833/';
%end

addpath(genpath(sprintf('%s/fmri/afni.matlab/',home)));
addpath(genpath(sprintf('%s/fmri/bct.20121204/',home)));
addpath(genpath(sprintf('%s/fmri/nbs1.2/',home)));
addpath(genpath(sprintf('%s/fmri/gretna/',home)));
%addpath((sprintf('%s/fmri/spm12/',home)));
%addpath((sprintf('%s/fmri/spm12/toolbox/cat12',home)));
addpath((sprintf('%s/fmri/spm8/',home)));
addpath((sprintf('%s/fmri/spm8/toolbox/vbm8',home)));
addpath(genpath(sprintf('%s/fmri/surfstat/',home)));
addpath(genpath(sprintf('%s/fmri/panda/PANDA/',home)));
addpath(genpath(sprintf('%s/fmri/matlab/gift/GroupICATv4.0a/icatb',home)));
addpath(genpath(sprintf('%s/fmri/matlab/rest/REST/',home)));
addpath(genpath(sprintf('%s/fmri/matlab/mlsp/',home)));
addpath((sprintf('%s/fmri/matlab/m2html/',home)));
addpath((sprintf('%s/fmri/matlab/BrainNetViewer/',home)));
addpath((sprintf('%s/fmri/matlab/eig3/',home)));
addpath((sprintf('%s/fmri/matlab/export_fig/',home)));
addpath(genpath(sprintf('%s/fmri/matlab/ite/code', home)));
addpath(sprintf('%s/fmri/matlab/jsonlab', home));
addpath(genpath(sprintf('%s/fmri/matlab/MIToolbox', home)));

%add my bin path
dawnbind= getenv('DAWNBIND');
addpath(genpath(dawnbind));
clear home;

%function filter_path(pattern)
pattern={'.git', '.svn'};
all = path;
[entries] = regexp(all, '([^:]+):', 'tokens');
for i = 1:length(entries)
    entry = char(entries{i});
    for j=1:length(pattern),
         if (~isempty(strfind(entry, pattern{j})))
             rmpath(entry);
         end;
    end
end;
clear all pattern entry entries;

end %~isdeployed


Removing another reference version.  I think this is the last of them.

git-svn-id: 88467cb1fb04b8a755be7e1ee1026be4190196ef@22435 3a8e244f-b0f2-452b-bcba-4c88e055c3ca

function [L,U,p] = lutx(A)
%LUTX  Triangular factorization, textbook version
%   [L,U,p] = lutx(A) produces a unit lower triangular matrix L,
%   an upper triangular matrix U, and a permutation vector p,
%   so that L*U = A(p,:)

[n,n] = size(A);
p = (1:n)';

for k = 1:n-1

   % Find index of largest element below diagonal in k-th column
   [r,m] = max(abs(A(k:n,k)));
   m = m+k-1;

   % Skip elimination if column is zero
   if (A(m,k) ~= 0)

      % Swap pivot row
      if (m ~= k)
         A([k m],:) = A([m k],:);
         p([k m]) = p([m k]);
      end

      % Compute multipliers
      i = k+1:n;
      A(i,k) = A(i,k)/A(k,k);

      % Update the remainder of the matrix
      j = k+1:n;
      A(i,j) = A(i,j) - A(i,k)*A(k,j);
   end
end

% Separate result
L = tril(A,-1) + eye(n,n);
U = triu(A);


use my own forked MIToolbox

use my own forked MIToolbox

if ~isdeployed,

%------------ FreeSurfer -----------------------------%
fshome = getenv('FREESURFER_HOME');
fsmatlab = sprintf('%s/matlab',fshome);
if (exist(fsmatlab) == 7)
    path(path,fsmatlab);
end
clear fshome fsmatlab;
%-----------------------------------------------------%

%------------ FreeSurfer FAST ------------------------%
fsfasthome = getenv('FSFAST_HOME');
fsfasttoolbox = sprintf('%s/toolbox',fsfasthome);
if (exist(fsfasttoolbox) == 7)
    path(path,fsfasttoolbox);
end
clear fsfasthome fsfasttoolbox;
%-----------------------------------------------------%

user=getenv('USER'),
node=getenv('HOSTNAME'),
if strcmp(user, 'xst833'),
    home = getenv('HOME');
else
    home = '/home/xst833/';
end

addpath(genpath(sprintf('%s/fmri/afni.matlab/',home)));
addpath(genpath(sprintf('%s/fmri/bct.20121204/',home)));
addpath(genpath(sprintf('%s/fmri/nbs1.2/',home)));
addpath(genpath(sprintf('%s/fmri/gretna/',home)));
%addpath((sprintf('%s/fmri/spm12/',home)));
%addpath((sprintf('%s/fmri/spm12/toolbox/cat12',home)));
addpath((sprintf('%s/fmri/spm8/',home)));
addpath((sprintf('%s/fmri/spm8/toolbox/vbm8',home)));
addpath(genpath(sprintf('%s/fmri/surfstat/',home)));
addpath(genpath(sprintf('%s/fmri/panda/PANDA/',home)));
addpath(genpath(sprintf('%s/fmri/matlab/gift/GroupICATv4.0a/icatb',home)));
addpath(genpath(sprintf('%s/fmri/matlab/rest/REST/',home)));
addpath(genpath(sprintf('%s/fmri/matlab/mlsp/',home)));
addpath((sprintf('%s/fmri/matlab/m2html/',home)));
addpath((sprintf('%s/fmri/matlab/BrainNetViewer/',home)));
addpath((sprintf('%s/fmri/matlab/eig3/',home)));
addpath((sprintf('%s/fmri/matlab/export_fig/',home)));
addpath(genpath(sprintf('%s/fmri/matlab/ite/code', home)));
addpath(sprintf('%s/fmri/matlab/jsonlab', home));
addpath(genpath(sprintf('%s/fmri/matlab/MIToolbox', home)));

%add my bin path
dawnbind= getenv('DAWNBIND');
addpath(genpath(dawnbind));
clear home;

%function filter_path(pattern)
pattern={'.git', '.svn'};
all = path;
[entries] = regexp(all, '([^:]+):', 'tokens');
for i = 1:length(entries)
    entry = char(entries{i});
    for j=1:length(pattern),
         if (~isempty(strfind(entry, pattern{j})))
             rmpath(entry);
         end;
    end
end;
clear all pattern entry entries;

end %~isdeployed

if ~isdeployed,

%------------ FreeSurfer -----------------------------%
fshome = getenv('FREESURFER_HOME');
fsmatlab = sprintf('%s/matlab',fshome);
if (exist(fsmatlab) == 7)
    path(path,fsmatlab);
end
clear fshome fsmatlab;
%-----------------------------------------------------%

%------------ FreeSurfer FAST ------------------------%
fsfasthome = getenv('FSFAST_HOME');
fsfasttoolbox = sprintf('%s/toolbox',fsfasthome);
if (exist(fsfasttoolbox) == 7)
    path(path,fsfasttoolbox);
end
clear fsfasthome fsfasttoolbox;
%-----------------------------------------------------%

user=getenv('USER'),
node=getenv('HOSTNAME'),
if strcmp(user, 'xst833'),
    home = getenv('HOME');
else
    home = '/home/xst833/';
end

addpath(genpath(sprintf('%s/fmri/afni.matlab/',home)));
addpath(genpath(sprintf('%s/fmri/bct.20121204/',home)));
addpath(genpath(sprintf('%s/fmri/nbs1.2/',home)));
addpath(genpath(sprintf('%s/fmri/gretna/',home)));
%addpath((sprintf('%s/fmri/spm12/',home)));
%addpath((sprintf('%s/fmri/spm12/toolbox/cat12',home)));
addpath((sprintf('%s/fmri/spm8/',home)));
addpath((sprintf('%s/fmri/spm8/toolbox/vbm8',home)));
addpath(genpath(sprintf('%s/fmri/surfstat/',home)));
addpath(genpath(sprintf('%s/fmri/panda/PANDA/',home)));
addpath(genpath(sprintf('%s/fmri/matlab/gift/GroupICATv4.0a/icatb',home)));
addpath(genpath(sprintf('%s/fmri/matlab/rest/REST/',home)));
addpath(genpath(sprintf('%s/fmri/matlab/mlsp/',home)));
addpath((sprintf('%s/fmri/matlab/m2html/',home)));
addpath((sprintf('%s/fmri/matlab/BrainNetViewer/',home)));
addpath((sprintf('%s/fmri/matlab/eig3/',home)));
addpath((sprintf('%s/fmri/matlab/export_fig/',home)));
addpath(genpath(sprintf('%s/fmri/matlab/ite/code', home)));
addpath(sprintf('%s/fmri/matlab/jsonlab', home));
addpath(genpath(sprintf('%s/fmri/matlab/PengHC-MIToolbox-2.1.2', home)));

%add my bin path
dawnbind= getenv('DAWNBIND');
addpath(genpath(dawnbind));
clear home;

%function filter_path(pattern)
pattern={'.git', '.svn'};
all = path;
[entries] = regexp(all, '([^:]+):', 'tokens');
for i = 1:length(entries)
    entry = char(entries{i});
    for j=1:length(pattern),
         if (~isempty(strfind(entry, pattern{j})))
             rmpath(entry);
         end;
    end
end;
clear all pattern entry entries;

end %~isdeployed


fix wrong merge and wrong fmri path for SPM8

if ~isdeployed,

self=mfilename;
cself=[mfilename('fullpath'), '_cache.m'];
[~, snewer]=system(['test ', cself, ' -nt ', self ' && echo 1 || echo 0']);
if 1==str2num(snewer), %if cache is newer than me
    fprintf(2, 'Loading cached startup path: %s\n', cself);
    %load cache
    pd=pwd;  path=fileparts(cself);
    cd(path); path=startup_cache; addpath(path);  cd(pd);
    clear self snewer cself pd path
    return
end %if cself does not exist, it is Ok, system will think it fails to be newer!

%------------ FreeSurfer -----------------------------%
fshome = getenv('FREESURFER_HOME');
fsmatlab = sprintf('%s/matlab',fshome);
if (exist(fsmatlab) == 7)
    path(path,fsmatlab);
end
clear fshome fsmatlab;
%-----------------------------------------------------%

%------------ FreeSurfer FAST ------------------------%
fsfasthome = getenv('FSFAST_HOME');
fsfasttoolbox = sprintf('%s/toolbox',fsfasthome);
if (exist(fsfasttoolbox) == 7)
    path(path,fsfasttoolbox);
end
clear fsfasthome fsfasttoolbox;
%-----------------------------------------------------%

user=getenv('USER'),
node=getenv('HOSTNAME'),
%if strcmp(user, 'xst833'),
    home = getenv('HOME');
%else
%    home = '/home/xst833/';
%end

fmriTools={
'fmri/afni.matlab';
'fmri/bct.20121204';
'fmri/nbs1.2';
'fmri/gretna';
% 'spm12';
% 'spm12/toolbox/cat12';
'fmri/spm8';
'fmri/spm8/toolbox/vbm8';
'fmri/surfstat';
'fmri/panda/PANDA';
'matlab/gift/GroupICATv4.0a/icatb';
'matlab/rest/REST';
'matlab/mlsp';
'matlab/m2thml';
'matlab/BrainNetViewer';
'matlab/eig3';
'matlab/export_fig';
'matlab/ite/code';
'matlab/jsonlab';
%'matlab/MIToolbox';
};
for i=1:size(fmriTools, 1),
    dir=sprintf(['%s/' fmriTools{i}], home);
    if exist(dir, 'dir'),
        addpath(genpath(dir));
        fprintf(2, sprintf('# Added path: %s\n', dir));
    else
        fprintf(2, sprintf('## Cannot find dir: %s\n', dir));
    end
end

%add my bin path
dawnbind= getenv('DAWNBIND');
addpath(genpath(dawnbind));
clear home fmriTools;

fprintf(2, sprintf('#Cleaning .git .svn dirs\n'));
%function filter_path(pattern)
pattern={'.git', '.svn'};
all = path;
[entries] = regexp(all, '([^:]+):', 'tokens');
for i = 1:length(entries)
    entry = char(entries{i});
    for j=1:length(pattern),
         if (~isempty(strfind(entry, pattern{j})))
             rmpath(entry);
         end;
    end
end;
clear all pattern entry entries;

savepath(cself)
clear self cself snewer
end %~isdeployed

if ~isdeployed,

self=mfilename;
cself=[mfilename('fullpath'), '_cache.m'];
[~, snewer]=system(['test ', cself, ' -nt ', self ' && echo 1 || echo 0']);
if 1==str2num(snewer), %if cache is newer than me
    fprintf(2, 'Loading cached startup path: %s\n', cself);
    %load cache
    pd=pwd;  path=fileparts(cself);
    cd(path); path=startup_cache; addpath(path);  cd(pd);
    clear self snewer cself pd path
    return
end %if cself does not exist, it is Ok, system will think it fails to be newer!

%------------ FreeSurfer -----------------------------%
fshome = getenv('FREESURFER_HOME');
fsmatlab = sprintf('%s/matlab',fshome);
if (exist(fsmatlab) == 7)
    path(path,fsmatlab);
end
clear fshome fsmatlab;
%-----------------------------------------------------%

%------------ FreeSurfer FAST ------------------------%
fsfasthome = getenv('FSFAST_HOME');
fsfasttoolbox = sprintf('%s/toolbox',fsfasthome);
if (exist(fsfasttoolbox) == 7)
    path(path,fsfasttoolbox);
end
clear fsfasthome fsfasttoolbox;
%-----------------------------------------------------%

user=getenv('USER'),
node=getenv('HOSTNAME'),
%if strcmp(user, 'xst833'),
    home = getenv('HOME');
%else
%    home = '/home/xst833/';
%end

fmriTools={
'fmri/afni.matlab';
'fmri/bct.20121204';
'fmri/nbs1.2';
'gretna';
% 'spm12';
% 'spm12/toolbox/cat12';
'spm8';
'spm8/toolbox/vbm8';
'surfstat';
'panda/PANDA';
'matlab/gift/GroupICATv4.0a/icatb';
'matlab/rest/REST';
'matlab/mlsp';
'matlab/m2thml';
'matlab/BrainNetViewer';
'matlab/eig3';
'matlab/export_fig';
'matlab/ite/code';
'matlab/jsonlab';
%'matlab/MIToolbox';
};
for i=1:size(fmriTools, 1),
    dir=sprintf(['%s/' fmriTools{i}], home);
    if exist(dir, 'dir'),
        addpath(genpath(dir));
        fprintf(2, sprintf('# Added path: %s\n', dir));
    else
        fprintf(2, sprintf('## Cannot find dir: %s\n', dir));
    end
end

%add my bin path
dawnbind= getenv('DAWNBIND');
addpath(genpath(dawnbind));
clear home fmriTools;

fprintf(2, sprintf('#Cleaning .git .svn dirs\n'));
%function filter_path(pattern)
pattern={'.git', '.svn'};
all = path;
[entries] = regexp(all, '([^:]+):', 'tokens');
for i = 1:length(entries)
    entry = char(entries{i});
    for j=1:length(pattern),
         if (~isempty(strfind(entry, pattern{j})))
             rmpath(entry);
         end;
    end
end;
clear all pattern entry entries;

savepath(cself)
clear self cself snewer
end %~isdeployed


reminded save

reminded save

%------------ FreeSurfer -----------------------------%
fshome = getenv('FREESURFER_HOME');
fsmatlab = sprintf('%s/matlab',fshome);
if (exist(fsmatlab) == 7)
    path(path,fsmatlab);
end
clear fshome fsmatlab;
%-----------------------------------------------------%

%------------ FreeSurfer FAST ------------------------%
fsfasthome = getenv('FSFAST_HOME');
fsfasttoolbox = sprintf('%s/toolbox',fsfasthome);
if (exist(fsfasttoolbox) == 7)
    path(path,fsfasttoolbox);
end
clear fsfasthome fsfasttoolbox;
%-----------------------------------------------------%

home = getenv('HOME');
addpath(genpath(sprintf('%s/fmri/afni.matlab/',home)));
addpath(genpath(sprintf('%s/fmri/bct.20121204/',home)));
addpath(genpath(sprintf('%s/fmri/nbs1.2/',home)));
addpath(genpath(sprintf('%s/fmri/gretna/',home)));
addpath(genpath(sprintf('%s/fmri/spm8/',home)));
addpath(genpath(sprintf('%s/fmri/surfstat/',home)));
clear home;

%------------ FreeSurfer -----------------------------%
fshome = getenv('FREESURFER_HOME');
fsmatlab = sprintf('%s/matlab',fshome);
if (exist(fsmatlab) == 7)
    path(path,fsmatlab);
end
clear fshome fsmatlab;
%-----------------------------------------------------%

%------------ FreeSurfer FAST ------------------------%
fsfasthome = getenv('FSFAST_HOME');
fsfasttoolbox = sprintf('%s/toolbox',fsfasthome);
if (exist(fsfasttoolbox) == 7)
    path(path,fsfasttoolbox);
end
clear fsfasthome fsfasttoolbox;
%-----------------------------------------------------%

home = getenv('HOME');
addpath(genpath(sprintf('%s/fmri/afni.matlab/',home)));
addpath(genpath(sprintf('%s/fmri/bct.20121204/',home)));
addpath(genpath(sprintf('%s/fmri/nbs1.2/',home)));
addpath(genpath(sprintf('%s/fmri/gretna/',home)));
addpath(genpath(sprintf('%s/fmri/spm8/',home)));
clear home;


forgot sprintf, fixed

forgot sprintf, fixed

%------------ FreeSurfer -----------------------------%
fshome = getenv('FREESURFER_HOME');
fsmatlab = sprintf('%s/matlab',fshome);
if (exist(fsmatlab) == 7)
    path(path,fsmatlab);
end
clear fshome fsmatlab;
%-----------------------------------------------------%

%------------ FreeSurfer FAST ------------------------%
fsfasthome = getenv('FSFAST_HOME');
fsfasttoolbox = sprintf('%s/toolbox',fsfasthome);
if (exist(fsfasttoolbox) == 7)
    path(path,fsfasttoolbox);
end
clear fsfasthome fsfasttoolbox;
%-----------------------------------------------------%

home = getenv('HOME');
addpath(genpath(sprintf('%s/fmri/afni.matlab/',home)));
addpath(genpath(sprintf('%s/fmri/bct.20121204/',home)));
addpath(genpath(sprintf('%s/fmri/nbs1.2/',home)));
addpath(genpath(sprintf('%s/fmri/gretna/',home)));
addpath(genpath(sprintf('%s/fmri/spm8/',home)));
clear home;

%------------ FreeSurfer -----------------------------%
fshome = getenv('FREESURFER_HOME');
fsmatlab = sprintf('%s/matlab',fshome);
if (exist(fsmatlab) == 7)
    path(path,fsmatlab);
end
clear fshome fsmatlab;
%-----------------------------------------------------%

%------------ FreeSurfer FAST ------------------------%
fsfasthome = getenv('FSFAST_HOME');
fsfasttoolbox = sprintf('%s/toolbox',fsfasthome);
if (exist(fsfasttoolbox) == 7)
    path(path,fsfasttoolbox);
end
clear fsfasthome fsfasttoolbox;
%-----------------------------------------------------%

home = getenv('HOME');
addpath(genpath('%s/fmri/afni.matlab/',home));
addpath(genpath('%s/fmri/bct.20121204/',home));
addpath(genpath('%s/fmri/nbs1.2/',home));
addpath(genpath('%s/fmri/gretna/',home));


Matlab code to implement Mahalanobis distance algorithm.

function [ r ] = difference3( f1,f2 )

aa=rgb2gray(f1);
bb=rgb2gray(f2);
aa=rot90(aa);
bb=rot90(bb);
bb=mean(bb);

k=mahal(bb,double(aa));

r=sum(k);
end

error: pathspec 'MahalanobisDistance.matlab' did not match any file(s) known to git


Testing script for M-SOM parameters evaluation

fatal: unable to access 'https://github.com/TWOEARS/audio-visual-integration.git/': The requested URL returned error: 403


Matlab code to implement Euclidean Distance algorithm

fatal: unable to access 'https://github.com/suryadeepchatterjee3107/Key_Frame_identification.git/': The requested URL returned error: 403


Matlab code for ThingSpeak

Matlab code for ThingSpeak

readChannelID = 84835;

[sht31, time] = thingSpeakRead(readChannelID, 'Fields', 1, 'NumPoints', 10);
am2302 = thingSpeakRead(readChannelID, 'Fields', 3, 'NumPoints', 10);
am2320 = thingSpeakRead(readChannelID, 'Fields', 5, 'NumPoints', 10);

thingSpeakPlot(time, [sht31, am2302, am2320], 'legend',...
    {'SHT-31', 'AM2302', 'AM2320'});

error: pathspec 'paint.matlab' did not match any file(s) known to git


Update static/vendors/ace-builds/demo/kitchen-sink/docs/matlab.matlab

Signed-off-by: Bernard Ojengwa <fccb4cc00c1ba7e51bf5c2b5f77130b9fe8d917e@gmail.com>

fatal: unable to access 'https://github.com/apipanda/openssl.git/': The requested URL returned error: 403


Create VideoToFrames.matlab

Create VideoToFrames.matlab

This is the matlab code to convert input frames into video and count the number of frames. This takes a lot of time to run, to make the running time a bit less boring I have added a module which will show glimpses of the frames.

clc;
close all;
countm=0;
counte=0;
counth=0;
tot=1;
avg=0;
mov = VideoReader('longvid.avi.mp4');
% movie(mov);
% Determine how many frames there are.
numberOfFrames = size(mov, 2);
numberOfFramesWritten = 0;
% Output folder
outputFolder = fullfile(cd, 'frames');
if ~exist(outputFolder, 'dir')
    mkdir(outputFolder);
end
outputFolder3 = fullfile(cd, 'frames3');
if ~exist(outputFolder3, 'dir')
    mkdir(outputFolder3);
end
outputFolder2 = fullfile(cd, 'frames2');
if ~exist(outputFolder2, 'dir')
    mkdir(outputFolder2);
end
outputFolder1 = fullfile(cd, 'frames1');
if ~exist(outputFolder1, 'dir')
    mkdir(outputFolder1);
end

%getting no of frames

numberOfFrames = mov.NumberOfFrames;
numberOfFramesWritten = 0;
 oldFrame = read(mov, 1);
  oldFrame1 = read(mov, 1); oldFrame2 = read(mov, 1); oldFrame3 = read(mov, 1);
 imshow(oldFrame);
ee=0;
for frame = 1 : 1000
     outputBaseFileName = sprintf('%3.3d.png', frame);
        outputFullFileName = fullfile(outputFolder, outputBaseFileName);
        imwrite(thisFrame, outputFullFileName, 'png')

    thisFrame = read(mov, frame);
     dd = difference3(thisFrame,oldFrame3)
     ff = int32(dd)
    % ee=ee+dd;
    % avg=ee/tot;
    % gg=int32(avg)
     %fds(frame)=ff;

         if(ff>70)
        outputBaseFileName = sprintf('%3.3d.png', frame);
        outputFullFileName = fullfile(outputFolder3, outputBaseFileName);
        imwrite(thisFrame, outputFullFileName, 'png');
        progressIndication = sprintf('Wrote frame %4d of %d.', frame,numberOfFrames);
        disp(progressIndication);
        numberOfFramesWritten = numberOfFramesWritten + 1;
          countm=countm+1;
            oldFrame3=thisFrame;
        % imshow(thisFrame)
    end

    if((difference2(thisFrame,oldFrame2))>15000)
        outputBaseFileName = sprintf('%3.3d.png', frame);
        outputFullFileName = fullfile(outputFolder2, outputBaseFileName);
        imwrite(thisFrame, outputFullFileName, 'png');
        progressIndication = sprintf('Wrote frame %4d of %d.', frame,numberOfFrames);
        disp(progressIndication);
        numberOfFramesWritten = numberOfFramesWritten + 1;
            oldFrame2=thisFrame;
           counte=counte+1;
            %imshow(oldFrame);
    end
    if((difference(thisFrame,oldFrame1))>45000)
        outputBaseFileName = sprintf('%3.3d.png', frame);
        outputFullFileName = fullfile(outputFolder1, outputBaseFileName);
        imwrite(thisFrame, outputFullFileName, 'png');
        progressIndication = sprintf('Wrote frame %4d of %d.', frame,numberOfFrames);
        disp(progressIndication);
        numberOfFramesWritten = numberOfFramesWritten + 1;
        counth=counth+1;
        oldFrame1=thisFrame;
           % imshow(oldFrame);
    end
    tot=tot+1;
    oldFrame=thisFrame;
 %   'hello'

    [counte,counth,countm]

    bar([tot,counth,counte,countm])
   xlabel('technique')
      ylabel('number of frames')
    set(gca,'XTickLabel',{'total', 'Histogramic', 'Eucledian', 'Mahalanobis'})
saveas(gcf,'BarChartFile.png')

  %  imshow('BarChartFile.png')

      %imshow(thisFrame);
end

%progressIndication = sprintf('Wrote %d frames to folder "%s"',numberOfFramesWritten,outputFolder);
disp(progressIndication); bar([counth,counte,countm])

xlabel('technique')
      ylabel('number of frames')
    set(gca,'XTickLabel',{'Histogramic', 'Eucledian', 'Mahalanobis'})

saveas(gcf,'BarChartFile.png')

error: pathspec 'VideoToFrames.matlab' did not match any file(s) known to git