-
Notifications
You must be signed in to change notification settings - Fork 13
/
DiscernDataType.m
44 lines (37 loc) · 1.23 KB
/
DiscernDataType.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
function MRS_struct = DiscernDataType(filename, MRS_struct)
[~,~,ext] = fileparts(filename);
switch lower(ext)
case '.7'
MRS_struct.p.vendor = 'GE';
case '.dat'
MRS_struct.p.vendor = 'Siemens_twix';
case '.data'
MRS_struct.p.vendor = 'Philips_data';
case '.dcm'
MRS_struct.p.vendor = 'DICOM';
case {'.gz','.nii'}
MRS_struct.p.vendor = 'NIfTI';
case '.ima'
MRS_struct.p.vendor = 'Siemens_dicom';
case '.raw'
MRS_struct.p.vendor = 'Philips_raw';
case '.rda'
MRS_struct.p.vendor = 'Siemens_rda';
case '.sdat'
MRS_struct.p.vendor = 'Philips';
otherwise
error('Unrecognized file type! Extension must be .7, .dat, .data, .dcm, .gz, .ima, .nii, .raw, .rda, or, .sdat.');
end
if strcmp(MRS_struct.p.vendor, 'Siemens_rda')
w = warning('query','backtrace');
if strcmp(w.state,'on')
warning('off','backtrace');
end
fprintf('\n');
warning(['The Siemens .rda format is NOT recommended for use in Gannet. ' ...
'If possible, please re-export your data in the TWIX (.dat) format.']);
if strcmp(w.state,'on')
warning('on','backtrace');
end
end
end