Skip to content

Commit 1307088

Browse files
committed
Hopefully fixes imageempty error.
1 parent 6e77b34 commit 1307088

3 files changed

Lines changed: 20 additions & 5 deletions

File tree

ea_anatpreprocess.m

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
function ea_anatpreprocess(fpth)
2+
[pth,fn,ext]=fileparts(fpth);
3+
copyfile(fpth,fullfile(pth,['k',fn,ext]));
4+
ea_dcm2nii(fpth);
5+
6+
V=ea_open_vol(fpth);
7+
if any(V.dim<20)
8+
ea_warning('DCM2NII based autocrop and -reorient failed. Continuing without.');
9+
copyfile(fullfile(pth,['k',fn,ext]),fpth);
10+
end
11+
ea_bias_field_correction(fpth)
12+
V=ea_open_vol(fpth);
13+
if any(V.dim<20)
14+
ea_warning('Biasfield correction failed. Continuing without.');
15+
copyfile(fullfile(pth,['k',fn,ext]),fpth);
16+
end
17+
delete(['k',fn,ext]);
18+

ea_assignpretra.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@
1919
if ~exist([directory,'.pp'],'file') && ~exist([directory,'ea_normmethod_applied.mat'],'file') % only do this once, small hidden flag .pp inside patient folder will show this has been done before.
2020
for fi=f
2121
% apply biasfieldcorrection and reorient/crop
22-
ea_dcm2nii([directory,options.prefs.rawpreniis{fi}]);
23-
ea_bias_field_correction([directory,options.prefs.rawpreniis{fi}])
22+
ea_anatpreprocess([directory,options.prefs.rawpreniis{fi}]);
2423
end
2524
try
2625
fs=fopen([directory,'.pp'],'w');

ea_coreg_all_mri.m

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@
3939
if exist([directory,options.prefs.prenii_unnormalized_t1],'file')
4040
disp('Including T1 data for (grey-matter) normalization');
4141
if ~includeatlas
42-
% ea_dcm2nii([directory,options.prefs.prenii_unnormalized_t1]);
43-
% ea_bias_field_correction([directory,options.prefs.prenii_unnormalized_t1])
42+
4443
ea_coreg2images(options,[directory,options.prefs.prenii_unnormalized_t1],[directory,options.prefs.prenii_unnormalized],[directory,options.prefs.prenii_unnormalized_t1]);
4544
end
4645
to{cnt}=[options.earoot,'templates',filesep,'mni_hires_t1.nii'];
@@ -59,7 +58,6 @@
5958
if exist([directory,options.prefs.prenii_unnormalized_pd],'file')
6059
disp('Including PD data for (grey-matter) normalization');
6160
if ~includeatlas
62-
% ea_dcm2nii([directory,options.prefs.prenii_unnormalized_pd]);
6361
ea_coreg2images(options,[directory,options.prefs.prenii_unnormalized_pd],[directory,options.prefs.prenii_unnormalized],[directory,options.prefs.prenii_unnormalized_pd]);
6462
end
6563
to{cnt}=[options.earoot,'templates',filesep,'mni_hires_pd.nii'];

0 commit comments

Comments
 (0)