Skip to content

Commit

Permalink
bug fixes for new canlab2023 naming convention
Browse files Browse the repository at this point in the history
  • Loading branch information
bogpetre committed Nov 3, 2023
1 parent 4f6b6e4 commit e186ef2
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions CanlabCore/Data_extraction/load_atlas.m
Original file line number Diff line number Diff line change
Expand Up @@ -321,31 +321,31 @@
case {'canlab2023_coarse_fmriprep20_2mm', 'canlab2023_coarse_fmriprep20','canlab2023_coarse_2mm', ...
'canlab2023_fmriprep20_2mm', 'canlab2023_coarse', 'canlab2023_fmriprep20', 'canlab2023_2mm', ...
'canlab2023'}
savefile='CANLab2023_coarse_fmriprep20_2mm_atlas_object.mat';
savefile='CANLab2023_coarse_MNI152NLin2009cAsym_2mm_atlas_object.mat';
varname = 'atlas_obj';
docreate = true;
create_atlas = @(x1)create_CANLab2023_atlas('MNI152NLin2009cAsym','coarse',2);

case {'canlab2023_coarse_fsl6_2mm', 'canlab2023_coarse_fsl6', 'canlab2023_fsl6_2mm', 'canlab2023_fsl6'}
savefile='CANLab2023_coarse_fsl6_2mm_atlas_object.mat';
savefile='CANLab2023_coarse_MNI152NLin2009cAsym_2mm_atlas_object.mat';
varname = 'atlas_obj';
docreate = true;
create_atlas = @(x1)create_CANLab2023_atlas('MNI152NLin6Asym','coarse',2);

case {'canlab2023_coarse_fmriprep20_1mm', 'canlab2023_coarse_1mm', 'canlab2023_fmriprep20_1mm', 'canlab2023_1mm'}
savefile='CANLab2023_coarse_fmriprep20_atlas_object.mat';
savefile='CANLab2023_coarse_MNI152NLin2009cAsym_atlas_object.mat';
varname = 'atlas_obj';
docreate = true;
create_atlas = @(x1)create_CANLab2023_atlas('MNI152NLin2009cAsym','coarse',1);

case {'canlab2023_coarse_fsl6_1mm', 'canlab2023_fsl6_1mm'}
savefile='CANLab2023_coarse_fsl6_atlas_object.mat';
savefile='CANLab2023_coarse_MNI152NLin2009cAsym_atlas_object.mat';
varname = 'atlas_obj';
docreate = true;
create_atlas = @(x1)create_CANLab2023_atlas('MNI152NLin6Asym','coarse',1);

case {'canlab2023_fine_fmriprep20_2mm', 'canlab2023_fine_fmriprep20','canlab2023_fine_2mm', 'canlab2023_fine'}
savefile='CANLab2023_fine_fmriprep20_2mm_atlas_object.mat';
savefile='CANLab2023_fine_MNI152NLin2009cAsym_2mm_atlas_object.mat';
varname = 'atlas_obj';
docreate = true;
create_atlas = @(x1)create_CANLab2023_atlas('MNI152NLin2009cAsym','fine',2);
Expand All @@ -357,13 +357,13 @@
create_atlas = @(x1)create_CANLab2023_atlas('MNI152NLin6Asym','fine',2);

case {'canlab2023_fine_fmriprep20_1mm', 'canlab2023_fine_1mm'}
savefile='CANLab2023_fine_fmriprep20_atlas_object.mat';
savefile='CANLab2023_fine_MNI152NLin2009cAsym_atlas_object.mat';
varname = 'atlas_obj';
docreate = true;
create_atlas = @(x1)create_CANLab2023_atlas('MNI152NLin2009cAsym','fine',1);

case {'canlab2023_fine_fsl6_1mm'}
savefile='CANLab2023_fine_fsl6_atlas_object.mat';
savefile='CANLab2023_fine_MNI152NLin6Asym_atlas_object.mat';
varname = 'atlas_obj';
docreate = true;
create_atlas = @(x1)create_CANLab2023_atlas('MNI152NLin6Asym','fine',1);
Expand All @@ -384,11 +384,12 @@
if isempty(dir(which(savefile)))
% atlas is missing
create_atlas(0);
this_atlas = load_atlas_from_file(savefile, varname, verbose);
atlas_obj = load_atlas_from_file(savefile, varname, verbose);
else
latest = which(strrep(savefile,'.mat','.latest'));
if exist(latest, 'file') ~= 2
create_atlas(0);
latest = which(strrep(savefile,'.mat','.latest'));
end
fid = fopen(latest);
latest = str2num(char(fread(fid,inf)'));
Expand Down

0 comments on commit e186ef2

Please sign in to comment.