Skip to content

Commit d82b4f2

Browse files
Merge pull request #29 from markmikkelsen/dev
Dev
2 parents e319a7a + 82db2c4 commit d82b4f2

29 files changed

+448
-355
lines changed

CoRegStandAlone/CoReg.m

Lines changed: 39 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
function MRS_struct = CoReg(MRS_struct, struc)
22

3-
% Coregistration of MRS voxel volumes to imaging datasets, based on headers.
3+
% Co-registration of MRS voxel volumes to imaging datasets, based on headers.
44

55
loadFile = which('GannetCoRegister');
66
fileID = fopen(loadFile, 'rt');
@@ -117,44 +117,46 @@
117117
figTitle = 'GannetCoRegister Output';
118118
set(gcf,'Name',figTitle,'Tag',figTitle,'NumberTitle','off');
119119

120-
subplot(2,3,4:6);
120+
ha = subplot(2,3,4:6);
121+
pos = get(ha, 'Position');
122+
set(ha, 'Position', [0 pos(2) 1 pos(4)]);
121123
axis off;
122124

123125
[~,tmp,tmp2] = fileparts(MRS_struct.mask.(vox{kk}).outfile{ii});
124126
fname = [tmp tmp2];
125127
if length(fname) > 30
126128
fname = [fname(1:12) '...' fname(end-11:end)];
127129
end
128-
text(0.5, 0.75, 'Mask output: ', 'HorizontalAlignment' , 'right', 'FontName', 'Arial', 'FontSize', 13);
129-
text(0.5, 0.75, [' ' fname], 'FontName', 'Arial', 'FontSize', 13, 'Interpreter', 'none');
130+
text(0.5, 0.75, 'Mask output: ', 'Units', 'normalized', 'HorizontalAlignment' , 'right', 'FontName', 'Arial', 'FontSize', 13);
131+
text(0.5, 0.75, [' ' fname], 'Units', 'normalized', 'FontName', 'Arial', 'FontSize', 13, 'Interpreter', 'none');
130132

131-
text(0.5, 0.63, 'Spatial parameters: ', 'HorizontalAlignment', 'right', 'FontName', 'Arial', 'FontSize', 13);
132-
text(0.5, 0.63, ' [LR, AP, FH]', 'FontName', 'Arial', 'FontSize', 13);
133+
text(0.5, 0.63, 'Spatial parameters: ', 'Units', 'normalized', 'HorizontalAlignment', 'right', 'FontName', 'Arial', 'FontSize', 13);
134+
text(0.5, 0.63, ' [LR, AP, FH]', 'Units', 'normalized', 'FontName', 'Arial', 'FontSize', 13);
133135

134136
tmp = [' ' num2str(MRS_struct.p.voxdim(ii,1)) ' \times ' num2str(MRS_struct.p.voxdim(ii,2)) ' \times ' num2str(MRS_struct.p.voxdim(ii,3)) ' mm^{3}'];
135-
text(0.5, 0.51, 'Dimensions: ', 'HorizontalAlignment', 'right', 'FontName', 'Arial', 'FontSize', 13);
136-
text(0.5, 0.51, tmp, 'FontName', 'Arial', 'FontSize', 13, 'Interpreter', 'tex');
137+
text(0.5, 0.51, 'Dimensions: ', 'Units', 'normalized', 'HorizontalAlignment', 'right', 'FontName', 'Arial', 'FontSize', 13);
138+
text(0.5, 0.51, tmp, 'Units', 'normalized', 'FontName', 'Arial', 'FontSize', 13, 'Interpreter', 'tex');
137139

138140
tmp = [' ' num2str(prod(MRS_struct.p.voxdim(ii,:))/1e3) ' mL'];
139-
text(0.5, 0.39, 'Volume: ', 'HorizontalAlignment', 'right', 'FontName', 'Arial', 'FontSize', 13);
140-
text(0.5, 0.39, tmp, 'FontName', 'Arial', 'FontSize', 13);
141+
text(0.5, 0.39, 'Volume: ', 'Units', 'normalized', 'HorizontalAlignment', 'right', 'FontName', 'Arial', 'FontSize', 13);
142+
text(0.5, 0.39, tmp, 'Units', 'normalized', 'FontName', 'Arial', 'FontSize', 13);
141143

142144
tmp = [' [' num2str(MRS_struct.p.voxoff(ii,1), '%3.1f') ', ' num2str(MRS_struct.p.voxoff(ii,2), '%3.1f') ', ' num2str(MRS_struct.p.voxoff(ii,3), '%3.1f') '] mm'];
143-
text(0.5, 0.27, 'Position: ', 'HorizontalAlignment', 'right', 'FontName', 'Arial', 'FontSize', 13);
144-
text(0.5, 0.27, tmp, 'FontName', 'Arial', 'FontSize', 13);
145+
text(0.5, 0.27, 'Position: ', 'Units', 'normalized', 'HorizontalAlignment', 'right', 'FontName', 'Arial', 'FontSize', 13);
146+
text(0.5, 0.27, tmp, 'Units', 'normalized', 'FontName', 'Arial', 'FontSize', 13);
145147

146148
if any(strcmp(MRS_struct.p.vendor,{'Philips','Philips_data'}))
147149
tmp = [' [' num2str(MRS_struct.p.voxang(ii,2), '%3.1f') ', ' num2str(MRS_struct.p.voxang(ii,1), '%3.1f') ', ' num2str(MRS_struct.p.voxang(ii,3), '%3.1f') '] deg'];
148150
else
149151
tmp = [' [' num2str(MRS_struct.p.voxang(ii,1), '%3.1f') ', ' num2str(MRS_struct.p.voxang(ii,2), '%3.1f') ', ' num2str(MRS_struct.p.voxang(ii,3), '%3.1f') '] deg'];
150152
end
151-
text(0.5, 0.15, 'Angulation: ', 'HorizontalAlignment', 'right', 'FontName', 'Arial', 'FontSize', 13);
152-
text(0.5, 0.15, tmp, 'FontName', 'Arial', 'FontSize', 13);
153+
text(0.5, 0.15, 'Angulation: ', 'Units', 'normalized', 'HorizontalAlignment', 'right', 'FontName', 'Arial', 'FontSize', 13);
154+
text(0.5, 0.15, tmp, 'Units', 'normalized', 'FontName', 'Arial', 'FontSize', 13);
153155

154-
text(0.5, 0.03, 'CoRegVer: ', 'HorizontalAlignment', 'right', 'FontName', 'Arial', 'FontSize', 13);
155-
text(0.5, 0.03, [' ' MRS_struct.version.coreg], 'FontName', 'Arial', 'FontSize', 13);
156+
text(0.5, 0.03, 'CoRegVer: ', 'Units', 'normalized', 'HorizontalAlignment', 'right', 'FontName', 'Arial', 'FontSize', 13);
157+
text(0.5, 0.03, [' ' MRS_struct.version.coreg], 'Units', 'normalized', 'FontName', 'Arial', 'FontSize', 13);
156158

157-
ha = subplot(2,3,1:3);
159+
hb = subplot(2,3,1:3);
158160

159161
if strcmp(MRS_struct.p.vendor,'Siemens_rda')
160162
[~,tmp,tmp2] = fileparts(MRS_struct.metabfile{ii*2-1});
@@ -179,31 +181,36 @@
179181
axis equal tight off;
180182
text(10, size(MRS_struct.mask.(vox{kk}).img{ii},1)/2, 'L', 'Color', [1 1 1], 'FontSize', 20);
181183
text(size(MRS_struct.mask.(vox{kk}).img{ii},2) - 20, size(MRS_struct.mask.(vox{kk}).img{ii},1)/2, 'R', 'Color', [1 1 1], 'FontSize', 20);
182-
set(ha,'pos',[0 0.15 1 1]);
184+
set(hb, 'Position', [0 0.15 1 1]);
183185
title(t, 'FontName', 'Arial', 'FontSize', 15, 'Interpreter', 'none');
184-
186+
185187
% Gannet logo
188+
axes('Position', [0.8825, 0.04, 0.125, 0.125], 'Units', 'normalized');
186189
Gannet_logo = fullfile(fileparts(which('GannetLoad')), 'Gannet3_logo.png');
187190
I = imread(Gannet_logo, 'BackgroundColor', 'none');
188-
axes('Position', [0.85, 0.05, 0.125, 0.125]);
189191
imshow(I);
190-
text(0.925, 0, MRS_struct.version.Gannet, 'Units', 'normalized', 'FontName', 'Arial', 'FontSize', 14, 'FontWeight', 'bold', 'HorizontalAlignment', 'left');
191-
axis off square;
192-
192+
axis off image;
193+
194+
% Gannet version
195+
d.left = 0;
196+
d.bottom = 0.02;
197+
d.width = 1;
198+
d.height = 0.02;
199+
axes('Position', [d.left d.bottom d.width d.height], 'Units', 'normalized');
200+
text(0.9925, 0, MRS_struct.version.Gannet, 'Units', 'normalized', 'FontName', 'Arial', 'FontSize', 14, 'FontWeight', 'bold', 'HorizontalAlignment', 'right');
201+
axis off;
202+
193203
% Gannet documentation
194-
axes('Position', [(1-0.9)/2, 0.025, 0.9, 0.15]);
204+
axes('Position', [d.left d.bottom d.width d.height], 'Units', 'normalized');
195205
str = 'For complete documentation, please visit: https://markmikkelsen.github.io/Gannet-docs';
196-
text(0.5, 0, str, 'FontName', 'Arial', 'FontSize', 11, 'HorizontalAlignment', 'center');
206+
text(0.5, 0, str, 'Units', 'normalized', 'FontName', 'Arial', 'FontSize', 11, 'HorizontalAlignment', 'center');
197207
axis off square;
198208

199209
% Batch number and output time
200-
d.w = 1;
201-
d.l = (1-d.w)/2;
202-
d.b = 0.98;
203-
d.h = 1-d.b;
204-
axes('Position', [d.l d.b d.w d.h]);
205-
text(0.0075, 0, ['Batch file: ' num2str(ii) ' of ' num2str(MRS_struct.p.numScans)], 'FontName', 'Arial', 'FontSize', 11, 'HorizontalAlignment', 'left');
206-
text(0.9925, 0, char(datetime('now','Format','dd-MMM-y HH:mm:ss')), 'FontName', 'Arial', 'FontSize', 11, 'HorizontalAlignment', 'right');
210+
d.bottom = 0.98;
211+
axes('Position', [d.left d.bottom d.width d.height], 'Units', 'normalized');
212+
text(0.0075, 0, ['Batch file: ' num2str(ii) ' of ' num2str(MRS_struct.p.numScans)], 'Units', 'normalized', 'FontName', 'Arial', 'FontSize', 11, 'HorizontalAlignment', 'left');
213+
text(0.9925, 0, char(datetime('now','Format','dd-MMM-y HH:mm:ss')), 'Units', 'normalized', 'FontName', 'Arial', 'FontSize', 11, 'HorizontalAlignment', 'right');
207214
axis off;
208215

209216
% For Philips .data

CoRegStandAlone/CoRegStandAlone.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
out = regexp(str, expression, 'names');
6666
MRS_struct.version.load = out.version;
6767

68-
MRS_struct.version.coregstandalone = '230326';
68+
MRS_struct.version.coregstandalone = '230729';
6969

7070
MRS_struct.ii = 0;
7171
if size(metabfile,2) == 1
@@ -157,11 +157,11 @@
157157
csv_name = fullfile(pwd, 'CoRegStandAlone_output.csv');
158158
if exist(csv_name, 'file')
159159
run_count = 1;
160-
csv_name = fullfile(pwd, ['CoRegStandAlone_output-' num2str(run_count) '.csv']);
160+
csv_name = fullfile(pwd, ['CoRegStandAlone_output' num2str(run_count) '.csv']);
161161
while 1
162162
if exist(csv_name, 'file')
163163
run_count = run_count + 1;
164-
csv_name = fullfile(pwd, ['CoRegStandAlone_output-' num2str(run_count) '.csv']);
164+
csv_name = fullfile(pwd, ['CoRegStandAlone_output' num2str(run_count) '.csv']);
165165
else
166166
break
167167
end

CoRegStandAlone/Seg.m

Lines changed: 36 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,9 @@
195195
set(h,'Name',figTitle,'Tag',figTitle,'NumberTitle','off');
196196

197197
% Output results
198-
subplot(2,3,4:6);
198+
ha = subplot(2,3,4:6);
199+
pos = get(ha, 'Position');
200+
set(ha, 'Position', [0 pos(2) 1 pos(4)]);
199201
axis off;
200202

201203
text_pos = 1;
@@ -209,31 +211,31 @@
209211
if length(fname) > 30
210212
fname = [fname(1:12) '...' fname(end-11:end)];
211213
end
212-
text(0.5, text_pos-0.12, 'Filename: ', 'FontName', 'Arial', 'HorizontalAlignment','right', 'VerticalAlignment', 'top', 'FontSize', 13);
213-
text(0.5, text_pos-0.12, [' ' fname], 'FontName', 'Arial', 'VerticalAlignment', 'top', 'FontSize', 13, 'Interpreter', 'none');
214+
text(0.5, text_pos-0.12, 'Filename: ', 'Units', 'normalized', 'FontName', 'Arial', 'HorizontalAlignment','right', 'VerticalAlignment', 'top', 'FontSize', 13);
215+
text(0.5, text_pos-0.12, [' ' fname], 'Units', 'normalized', 'FontName', 'Arial', 'VerticalAlignment', 'top', 'FontSize', 13, 'Interpreter', 'none');
214216

215217
[~,tmp1,tmp2] = fileparts(MRS_struct.mask.(vox{kk}).T1image{ii});
216218
T1image = [tmp1 tmp2];
217219
if length(T1image) > 30
218220
T1image = [T1image(1:12) '...' T1image(end-11:end)];
219221
end
220-
text(0.5, text_pos-0.24, 'Anatomical image: ', 'FontName', 'Arial', 'HorizontalAlignment','right', 'VerticalAlignment', 'top', 'FontSize', 13);
221-
text(0.5, text_pos-0.24, [' ' T1image], 'FontName', 'Arial', 'VerticalAlignment', 'top', 'FontSize', 13, 'Interpreter', 'none');
222+
text(0.5, text_pos-0.24, 'Anatomical image: ', 'Units', 'normalized', 'FontName', 'Arial', 'HorizontalAlignment','right', 'VerticalAlignment', 'top', 'FontSize', 13);
223+
text(0.5, text_pos-0.24, [' ' T1image], 'Units', 'normalized', 'FontName', 'Arial', 'VerticalAlignment', 'top', 'FontSize', 13, 'Interpreter', 'none');
222224

223225
tmp = sprintf(' %.2f', MRS_struct.out.(vox{kk}).tissue.fGM(ii));
224-
text(0.5, text_pos-0.36, 'GM voxel fraction: ', 'FontName', 'Arial', 'HorizontalAlignment','right', 'VerticalAlignment', 'top', 'FontSize', 13);
225-
text(0.5, text_pos-0.36, tmp, 'FontName', 'Arial', 'VerticalAlignment', 'top', 'FontSize', 13);
226+
text(0.5, text_pos-0.36, 'GM voxel fraction: ', 'Units', 'normalized', 'FontName', 'Arial', 'HorizontalAlignment','right', 'VerticalAlignment', 'top', 'FontSize', 13);
227+
text(0.5, text_pos-0.36, tmp, 'Units', 'normalized', 'FontName', 'Arial', 'VerticalAlignment', 'top', 'FontSize', 13);
226228

227229
tmp = sprintf(' %.2f', MRS_struct.out.(vox{kk}).tissue.fWM(ii));
228-
text(0.5, text_pos-0.48, 'WM voxel fraction: ', 'FontName', 'Arial', 'HorizontalAlignment','right', 'VerticalAlignment', 'top', 'FontSize', 13);
229-
text(0.5, text_pos-0.48, tmp, 'FontName', 'Arial', 'VerticalAlignment', 'top', 'FontSize', 13);
230+
text(0.5, text_pos-0.48, 'WM voxel fraction: ', 'Units', 'normalized', 'FontName', 'Arial', 'HorizontalAlignment','right', 'VerticalAlignment', 'top', 'FontSize', 13);
231+
text(0.5, text_pos-0.48, tmp, 'Units', 'normalized', 'FontName', 'Arial', 'VerticalAlignment', 'top', 'FontSize', 13);
230232

231233
tmp = sprintf(' %.2f', MRS_struct.out.(vox{kk}).tissue.fCSF(ii));
232-
text(0.5, text_pos-0.6, 'CSF voxel fraction: ', 'FontName', 'Arial', 'HorizontalAlignment','right', 'VerticalAlignment', 'top', 'FontSize', 13);
233-
text(0.5, text_pos-0.6, tmp, 'FontName', 'Arial', 'VerticalAlignment', 'top', 'FontSize', 13);
234+
text(0.5, text_pos-0.6, 'CSF voxel fraction: ', 'Units', 'normalized', 'FontName', 'Arial', 'HorizontalAlignment','right', 'VerticalAlignment', 'top', 'FontSize', 13);
235+
text(0.5, text_pos-0.6, tmp, 'Units', 'normalized', 'FontName', 'Arial', 'VerticalAlignment', 'top', 'FontSize', 13);
234236

235-
text(0.5, text_pos-0.72, 'SegmentVer: ', 'FontName', 'Arial', 'HorizontalAlignment','right', 'VerticalAlignment', 'top', 'FontSize', 13);
236-
text(0.5, text_pos-0.72, [' ' MRS_struct.version.segment], 'FontName', 'Arial', 'VerticalAlignment', 'top', 'FontSize', 13);
237+
text(0.5, text_pos-0.72, 'SegmentVer: ', 'Units', 'normalized', 'FontName', 'Arial', 'HorizontalAlignment','right', 'VerticalAlignment', 'top', 'FontSize', 13);
238+
text(0.5, text_pos-0.72, [' ' MRS_struct.version.segment], 'Units', 'normalized', 'FontName', 'Arial', 'VerticalAlignment', 'top', 'FontSize', 13);
237239

238240
if isfield(MRS_struct.p,'TablePosition')
239241
voxoff = MRS_struct.p.voxoff(ii,:) + MRS_struct.p.TablePosition(ii,:);
@@ -260,31 +262,34 @@
260262
end
261263
t = ['Voxel from ' fname ' on ' T1image];
262264
title(t, 'FontName', 'Arial', 'FontSize', 15, 'Interpreter', 'none');
263-
265+
264266
% Gannet logo
267+
axes('Position', [0.8825, 0.04, 0.125, 0.125], 'Units', 'normalized');
265268
Gannet_logo = fullfile(fileparts(which('GannetLoad')), 'Gannet3_logo.png');
266269
I = imread(Gannet_logo, 'BackgroundColor', 'none');
267-
axes('Position', [0.85, 0.05, 0.125, 0.125]);
268270
imshow(I);
269-
text(0.925, 0, MRS_struct.version.Gannet, 'Units', 'normalized', 'FontName', 'Arial', 'FontSize', 14, 'FontWeight', 'bold', 'HorizontalAlignment', 'left');
271+
axis off image;
272+
273+
% Gannet version
274+
d.left = 0;
275+
d.bottom = 0.02;
276+
d.width = 1;
277+
d.height = 0.02;
278+
axes('Position', [d.left d.bottom d.width d.height], 'Units', 'normalized');
279+
text(0.9925, 0, MRS_struct.version.Gannet, 'Units', 'normalized', 'FontName', 'Arial', 'FontSize', 14, 'FontWeight', 'bold', 'HorizontalAlignment', 'right');
270280
axis off;
271-
axis square;
272-
281+
273282
% Gannet documentation
274-
axes('Position', [(1-0.9)/2, 0.025, 0.9, 0.15]);
283+
axes('Position', [d.left d.bottom d.width d.height], 'Units', 'normalized');
275284
str = 'For complete documentation, please visit: https://markmikkelsen.github.io/Gannet-docs';
276-
text(0.5, 0, str, 'FontName', 'Arial', 'FontSize', 11, 'HorizontalAlignment', 'center');
277-
axis off;
278-
axis square;
285+
text(0.5, 0, str, 'Units', 'normalized', 'FontName', 'Arial', 'FontSize', 11, 'HorizontalAlignment', 'center');
286+
axis off square;
279287

280288
% Batch number and output time
281-
d.w = 1;
282-
d.l = (1-d.w)/2;
283-
d.b = 0.98;
284-
d.h = 1-d.b;
285-
axes('Position', [d.l d.b d.w d.h]);
286-
text(0.0075, 0, ['Batch file: ' num2str(ii) ' of ' num2str(MRS_struct.p.numScans)], 'FontName', 'Arial', 'FontSize', 11, 'HorizontalAlignment', 'left');
287-
text(0.9925, 0, char(datetime('now','Format','dd-MMM-y HH:mm:ss')), 'FontName', 'Arial', 'FontSize', 11, 'HorizontalAlignment', 'right');
289+
d.bottom = 0.98;
290+
axes('Position', [d.left d.bottom d.width d.height], 'Units', 'normalized');
291+
text(0.0075, 0, ['Batch file: ' num2str(ii) ' of ' num2str(MRS_struct.p.numScans)], 'Units', 'normalized', 'FontName', 'Arial', 'FontSize', 11, 'HorizontalAlignment', 'left');
292+
text(0.9925, 0, char(datetime('now','Format','dd-MMM-y HH:mm:ss')), 'Units', 'normalized', 'FontName', 'Arial', 'FontSize', 11, 'HorizontalAlignment', 'right');
288293
axis off;
289294

290295
% For Philips .data
@@ -404,14 +409,14 @@
404409

405410
img_montage = cat(2, img_t, img_t_GM, img_t_WM, img_t_CSF);
406411

407-
ha = subplot(2,3,1:3);
412+
hb = subplot(2,3,1:3);
408413
imagesc(img_montage);
409414
axis equal tight off;
410415
text(floor(size(mask_t,2)/2), 20, 'Voxel', 'Color', [1 1 1], 'FontSize', 20, 'HorizontalAlignment', 'center');
411416
text(floor(size(mask_t,2)) + floor(size(mask_t,2)/2), 20, 'GM', 'Color', [1 1 1], 'FontSize', 20, 'HorizontalAlignment', 'center');
412417
text(2*floor(size(mask_t,2)) + floor(size(mask_t,2)/2), 20, 'WM', 'Color', [1 1 1], 'FontSize', 20, 'HorizontalAlignment', 'center');
413418
text(3*floor(size(mask_t,2)) + floor(size(mask_t,2)/2), 20, 'CSF', 'Color', [1 1 1], 'FontSize', 20, 'HorizontalAlignment', 'center');
414-
set(ha, 'pos', [0 0.17 1 1]);
419+
set(hb, 'Position', [0 0.17 1 1]);
415420

416421

417422

DICOMRead.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
end
9898

9999
% It appears that DICOM stores the transients weirdly, 1:n/2 are all ONs,
100-
% and n/2+1:n are all OFFS. Reshuffle them below.
100+
% and n/2+1:n are all OFFs. Reshuffle them below.
101101
if size(MRS_struct.fids.data,2) > 1
102102
ind = [1:size(MRS_struct.fids.data,2)/2; size(MRS_struct.fids.data,2)/2+1:size(MRS_struct.fids.data,2)];
103103
ind = ind(:);

DiscernDataType.m

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,19 @@
2525
error('Unrecognized file type! Extension must be .7, .dat, .data, .dcm, .gz, .ima, .nii, .raw, .rda, or, .sdat.');
2626
end
2727

28+
if strcmp(MRS_struct.p.vendor, 'Siemens_rda')
29+
w = warning('query','backtrace');
30+
if strcmp(w.state,'on')
31+
warning('off','backtrace');
32+
end
33+
fprintf('\n');
34+
warning(['The Siemens .rda format is NOT recommended for use in Gannet. ' ...
35+
'If possible, please re-export your data in the TWIX (.dat) format.']);
36+
if strcmp(w.state,'on')
37+
warning('on','backtrace');
38+
end
39+
end
40+
2841
end
2942

3043

ExportToCSV.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,11 @@
7979
csv_name = fullfile(pwd, 'Gannet_output.csv');
8080
if exist(csv_name, 'file')
8181
run_count = 1;
82-
csv_name = fullfile(pwd, ['Gannet_output-' num2str(run_count) '.csv']);
82+
csv_name = fullfile(pwd, ['Gannet_output' num2str(run_count) '.csv']);
8383
while 1
8484
if exist(csv_name, 'file')
8585
run_count = run_count + 1;
86-
csv_name = fullfile(pwd, ['Gannet_output-' num2str(run_count) '.csv']);
86+
csv_name = fullfile(pwd, ['Gannet_output' num2str(run_count) '.csv']);
8787
else
8888
break
8989
end

GEDeIdentify.m

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,11 @@ function GEDeIdentify(fnames)
8484

8585
% Check if P-file can be found
8686
if pfile_fid == -1
87-
fclose(pfile_fid);
88-
fclose(pfile_fid_noID);
8987
error(['The file ' fnames{ii} ' cannot be found.' ...
90-
' Check spelling of filenames (P-files must include an extension in their filename).' ...
91-
' Also check that you are in the right directory.']);
88+
' Check spelling of filenames (P-files must include an extension in their filename).' ...
89+
' Also check that you are in the right directory.']);
9290
end
93-
91+
9492
% Determine P-file version
9593
[pfile_fid, pfile_fid_noID, hdr] = VersionCheck(fnames{ii}, pfile_fid, pfile_fid_noID);
9694

@@ -234,7 +232,7 @@ function GEDeIdentify(fnames)
234232
if ~any(strcmp(num2str(rdbm_rev_num), chkRev))
235233
fclose(pfile_fid);
236234
fclose(pfile_fid_noID);
237-
error('GEDeIdentify does not yet support P-file header revision: %g', rdbm_rev_num);
235+
error('GEDeIdentify.m does not yet support P-file header revision: %g', rdbm_rev_num);
238236
end
239237

240238
switch num2str(rdbm_rev_num)

GERead.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
fid = fopen(fname, 'r', 'ieee-be');
1212
if fid == -1
13-
fclose(fid);
1413
error('File ''%s'' not found!', fname);
1514
end
1615
fseek(fid, 0, 'bof');

0 commit comments

Comments
 (0)