Skip to content

Commit

Permalink
rm macaque from install menu (since now is space)
Browse files Browse the repository at this point in the history
  • Loading branch information
andreashorn committed Jan 19, 2017
1 parent 8c436b6 commit 4385e82
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 48 deletions.
21 changes: 1 addition & 20 deletions ea_checkinstall.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
end
switch cmd
case 'list' % simply return list of installable datasets
success={'Redownload Data files','Apply Hotfix','Big Brain 100um subcortical (Amunts 2013)','Lead-DBS Macaque Toolbox','Structural group connectome (Horn 2013)'};
success={'Redownload Data files','Apply Hotfix','Big Brain 100um subcortical (Amunts 2013)','Structural group connectome (Horn 2013)'};
commands={'leaddata','hotfix','bigbrain','macaque','groupconnectome2013'};
case 'leaddata'
checkf=[ea_space,'bb.nii'];
Expand Down Expand Up @@ -53,25 +53,6 @@
else
disp('BigBrain is installed.')
end
case 'macaque'
checkf=[earoot,'toolbox',filesep,'macaque'];
force=ea_alreadyinstalled(checkf,checkonly,robot);
if checkonly;
success=~force;
return;
end
if force==-1;
success=-1;
return;
end

if ~exist(checkf,'file') || force
success=ea_downloadasset('Lead-DBS Macaque toolbox',...
[earoot,'toolbox',filesep,'macaque.zip'],...
'macaque');
else
disp('Macaque toolbox is installed.')
end
case 'groupconnectome2013'
checkf=[ea_getconnectomebase('dmri'),'Groupconnectome (Horn 2013) full.mat'];
force=ea_alreadyinstalled(checkf,checkonly,robot);
Expand Down
46 changes: 18 additions & 28 deletions ea_create_tpm_darteltemplate.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,20 @@ function ea_create_tpm_darteltemplate(mute)
matlabbatch{1}.spm.spatial.preproc.channel(t).biasfwhm = 60;
matlabbatch{1}.spm.spatial.preproc.channel(t).write = [0 0];
end
matlabbatch{1}.spm.spatial.preproc.tissue(1).tpm = {[ea_getearoot,'templates',filesep,'TPM_Lorio_Draganski.nii,1']}; % This is correct ? TPM Lorio Draganski to be kept in /templates folder since will be used to generate TPM in each space.
matlabbatch{1}.spm.spatial.preproc.tissue(1).ngaus = 1;
matlabbatch{1}.spm.spatial.preproc.tissue(1).native = [1 0];
matlabbatch{1}.spm.spatial.preproc.tissue(1).warped = [0 0];
matlabbatch{1}.spm.spatial.preproc.tissue(2).tpm = {[ea_getearoot,'templates',filesep,'TPM_Lorio_Draganski.nii,2']};
matlabbatch{1}.spm.spatial.preproc.tissue(2).ngaus = 1;
matlabbatch{1}.spm.spatial.preproc.tissue(2).native = [1 0];
matlabbatch{1}.spm.spatial.preproc.tissue(2).warped = [0 0];
matlabbatch{1}.spm.spatial.preproc.tissue(3).tpm = {[ea_getearoot,'templates',filesep,'TPM_Lorio_Draganski.nii,3']};
matlabbatch{1}.spm.spatial.preproc.tissue(3).ngaus = 2;
matlabbatch{1}.spm.spatial.preproc.tissue(3).native = [1 0];
matlabbatch{1}.spm.spatial.preproc.tissue(3).warped = [0 0];
matlabbatch{1}.spm.spatial.preproc.tissue(4).tpm = {[ea_getearoot,'templates',filesep,'TPM_Lorio_Draganski.nii,4']};
matlabbatch{1}.spm.spatial.preproc.tissue(4).ngaus = 3;
matlabbatch{1}.spm.spatial.preproc.tissue(4).native = [1 0];
matlabbatch{1}.spm.spatial.preproc.tissue(4).warped = [0 0];
matlabbatch{1}.spm.spatial.preproc.tissue(5).tpm = {[ea_getearoot,'templates',filesep,'TPM_Lorio_Draganski.nii,5']};
matlabbatch{1}.spm.spatial.preproc.tissue(5).ngaus = 4;
matlabbatch{1}.spm.spatial.preproc.tissue(5).native = [1 0];
matlabbatch{1}.spm.spatial.preproc.tissue(5).warped = [0 0];
matlabbatch{1}.spm.spatial.preproc.tissue(6).tpm = {[ea_getearoot,'templates',filesep,'TPM_Lorio_Draganski.nii,6']};
matlabbatch{1}.spm.spatial.preproc.tissue(6).ngaus = 2;
matlabbatch{1}.spm.spatial.preproc.tissue(6).native = [1 0];
matlabbatch{1}.spm.spatial.preproc.tissue(6).warped = [0 0];

if ~isempty(strfind(lower(ea_getspace),'macaque'))
tpmfile=[ea_space,'TPM.nii'];
else
tpmfile=[ea_getearoot,'templates',filesep,'TPM_Lorio_Draganski.nii'];
end
tpn=ea_open_vol(tpmfile);

for tpspectr=1:length(tpn)
matlabbatch{1}.spm.spatial.preproc.tissue(tpspectr).tpm = {[tpmfile,',',num2str(tpspectr)]}; % This is correct ? TPM Lorio Draganski to be kept in /templates folder since will be used to generate TPM in each space.
matlabbatch{1}.spm.spatial.preproc.tissue(tpspectr).ngaus = 1;
matlabbatch{1}.spm.spatial.preproc.tissue(tpspectr).native = [1 0];
matlabbatch{1}.spm.spatial.preproc.tissue(tpspectr).warped = [0 0];
end
matlabbatch{1}.spm.spatial.preproc.warp.mrf = 1;
matlabbatch{1}.spm.spatial.preproc.warp.cleanup = 1;
matlabbatch{1}.spm.spatial.preproc.warp.reg = [0 0.001 0.5 0.05 0.2];
Expand All @@ -57,11 +47,11 @@ function ea_create_tpm_darteltemplate(mute)
if ~exist([ea_space,'dartel'], 'dir')
mkdir([ea_space,'dartel']);
end
for c=1:6
for c=1:length(tpn)
if c<3
copyfile([ea_space,'c',num2str(c),spacedef.templates{1},'.nii'],[ea_space,'c',num2str(c),'mask.nii']);
end
movefile([ea_space,'c',num2str(c),spacedef.templates{1},'.nii'],[ea_space([],'dartel'),filesep,'dartelmni_6_hires_',sprintf('%05d',c),'.nii']);
movefile([ea_space,'c',num2str(c),spacedef.templates{1},'.nii'],[ea_space([],'dartel'),filesep,'dartelmni_6_hires_',sprintf('%05d',c),'.nii']);
end

% add atlas
Expand All @@ -82,7 +72,7 @@ function ea_create_tpm_darteltemplate(mute)
end
prefs=ea_prefs('');

for c=1:6
for c=1:length(tpn)
fina=[ea_space([],'dartel'),filesep,'dartelmni_6_hires_',sprintf('%05d',c),'.nii'];
nii=ea_load_nii(fina); % change datatype to something high for reslicing and smoothing.
nii.dt=[16,0];
Expand Down Expand Up @@ -181,7 +171,7 @@ function ea_create_tpm_darteltemplate(mute)


% lightly smooth TPM
for tp=1:6
for tp=1:length(tpn)
matlabbatch{1}.spm.spatial.smooth.data{tp} = [ea_space,'TPM.nii,',num2str(tp)];
end
matlabbatch{1}.spm.spatial.smooth.data=matlabbatch{1}.spm.spatial.smooth.data';
Expand Down

0 comments on commit 4385e82

Please sign in to comment.