|
17 | 17 | spm_version = fileparts(which('spm')); |
18 | 18 | if isempty(spm_version) |
19 | 19 | msg = 'SPM not found! Please install SPM12 and make sure it is in your search path.'; |
20 | | - msg = hyperlink('https://www.fil.ion.ucl.ac.uk/spm/software/spm12', 'SPM12', msg); |
| 20 | + msg = hyperlink('https://www.fil.ion.ucl.ac.uk/spm/software/spm12/', 'SPM12', msg); |
| 21 | + fprintf('\n'); |
21 | 22 | error(msg); |
22 | 23 | elseif strcmpi(spm_version(end-3:end),'spm8') |
23 | 24 | msg = ['SPM8 detected. Gannet no longer supports SPM8. ' ... |
24 | 25 | 'Please install SPM12 and make sure it is in your search path.']; |
25 | | - msg = hyperlink('https://www.fil.ion.ucl.ac.uk/spm/software/spm12', 'SPM12', msg); |
| 26 | + msg = hyperlink('https://www.fil.ion.ucl.ac.uk/spm/software/spm12/', 'SPM12', msg); |
| 27 | + fprintf('\n'); |
26 | 28 | error(msg); |
27 | 29 | end |
28 | 30 |
|
29 | 31 | if MRS_struct.ii ~= length(struc) |
30 | | - error('The number of NIfTI files does not match the number of MRS files processed by CoRegStandAlone.'); |
| 32 | + fprintf('\n'); |
| 33 | + error('The number of structural image files does not match the number of MRS files.'); |
31 | 34 | end |
32 | 35 |
|
33 | 36 | numscans = numel(MRS_struct.metabfile); |
34 | 37 | vox = MRS_struct.p.vox(1); |
35 | 38 |
|
36 | 39 | for ii = 1:numscans |
| 40 | + |
| 41 | + [~,b,c] = fileparts(MRS_struct.metabfile{ii}); |
| 42 | + [~,e,f] = fileparts(struc{ii}); |
| 43 | + if ii == 1 |
| 44 | + fprintf('\nCo-registering voxel from %s to %s...\n', [b c], [e f]); |
| 45 | + else |
| 46 | + fprintf('Co-registering voxel from %s to %s...\n', [b c], [e f]); |
| 47 | + end |
37 | 48 |
|
| 49 | + fname = MRS_struct.metabfile{ii}; |
| 50 | + |
38 | 51 | % Loop over voxels if PRIAM |
39 | 52 | for kk = 1:length(vox) |
40 | 53 |
|
|
43 | 56 |
|
44 | 57 | case 'GE' |
45 | 58 | [~,~,ext] = fileparts(struc{ii}); |
46 | | - if strcmp(ext,'.nii') |
47 | | - MRS_struct = GannetMask_GE_nii(MRS_struct.metabfile{ii}, struc{ii}, MRS_struct, ii, vox, kk); |
| 59 | + if strcmp(ext, '.nii') |
| 60 | + MRS_struct = GannetMask_GE_nii(fname, struc{ii}, MRS_struct, ii, vox, kk); |
48 | 61 | else |
49 | | - MRS_struct = GannetMask_GE(MRS_struct.metabfile{ii}, struc{ii}, MRS_struct, ii, vox, kk); |
| 62 | + MRS_struct = GannetMask_GE(fname, struc{ii}, MRS_struct, ii, vox, kk); |
50 | 63 | end |
51 | 64 |
|
52 | 65 | case 'NIfTI' |
53 | | - MRS_struct = GannetMask_NIfTI(MRS_struct.metabfile{ii}, struc{ii}, MRS_struct, ii, vox, kk); |
| 66 | + MRS_struct = GannetMask_NIfTI(fname, struc{ii}, MRS_struct, ii, vox, kk); |
54 | 67 |
|
55 | 68 | case 'Philips' |
56 | | - sparname = [MRS_struct.metabfile{ii}(1:(end-4)) MRS_struct.p.spar_string]; |
57 | | - MRS_struct = GannetMask_Philips(sparname, struc{ii}, MRS_struct, ii, vox, kk); |
58 | | - |
| 69 | + MRS_struct = GannetMask_Philips(fname, struc{ii}, MRS_struct, ii, vox, kk); |
| 70 | + |
59 | 71 | case 'Philips_data' |
60 | 72 | if exist(MRS_struct.metabfile_sdat,'file') |
61 | 73 | MRS_struct.p.vendor = 'Philips'; |
|
82 | 94 | end |
83 | 95 |
|
84 | 96 | case 'Siemens_rda' |
85 | | - MRS_struct = GannetMask_SiemensRDA(MRS_struct.metabfile{ii}, struc{ii}, MRS_struct, ii, vox, kk); |
| 97 | + MRS_struct = GannetMask_SiemensRDA(fname, struc{ii}, MRS_struct, ii, vox, kk); |
86 | 98 |
|
87 | 99 | case {'Siemens_twix', 'Siemens_dicom', 'DICOM'} |
88 | | - MRS_struct = GannetMask_SiemensTWIX(MRS_struct.metabfile{ii}, struc{ii}, MRS_struct, ii, vox, kk); |
| 100 | + MRS_struct = GannetMask_SiemensTWIX(fname, struc{ii}, MRS_struct, ii, vox, kk); |
89 | 101 |
|
90 | 102 | end |
91 | 103 |
|
|
172 | 184 | title(t, 'FontName', 'Arial', 'FontSize', 15, 'Interpreter', 'none'); |
173 | 185 |
|
174 | 186 | % Gannet logo |
175 | | - Gannet_logo = fullfile(fileparts(which('GannetLoad')), 'Gannet3_logo.jpg'); |
| 187 | + Gannet_logo = fullfile(fileparts(which('GannetLoad')), 'Gannet3_logo.png'); |
176 | 188 | I = imread(Gannet_logo); |
177 | | - axes('Position', [0.825, 0.05, 0.125, 0.125]); |
| 189 | + axes('Position', [0.85, 0.05, 0.125, 0.125]); |
178 | 190 | imshow(I); |
179 | | - text(0.9, 0, MRS_struct.version.Gannet, 'Units', 'normalized', 'FontName', 'Arial', 'FontSize', 14, 'FontWeight', 'bold', 'HorizontalAlignment', 'left'); |
| 191 | + text(0.925, 0, MRS_struct.version.Gannet, 'Units', 'normalized', 'FontName', 'Arial', 'FontSize', 14, 'FontWeight', 'bold', 'HorizontalAlignment', 'left'); |
180 | 192 | axis off square; |
181 | 193 |
|
182 | 194 | % Gannet documentation |
|
0 commit comments