Skip to content

Commit 1ba4049

Browse files
committed
Several minor changes
- Updated README.md - Coil combination of TWIX data now performed using GLS - Added support for new JHU universal sequence for Siemens data - Turned off warnings of iteration limits in SpectralRegistrationHERMES.m - Some cosmetic changes
1 parent 7612074 commit 1ba4049

File tree

5 files changed

+109
-151
lines changed

5 files changed

+109
-151
lines changed

GERead.m

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@
300300
MetabData = ShapeData(:,:,refframes+2:end,:) * mult / 2;
301301

302302
totalframes = totalframes - (refframes + 1);
303-
303+
304304
MRS_struct.p.nrows(ii) = totalframes;
305305
MRS_struct.p.Navg(ii) = dataframes * nex;
306306
MRS_struct.p.Nwateravg(ii) = refframes * nex;
@@ -335,20 +335,20 @@
335335

336336
ShapeData = reshape(raw_data, [2 MRS_struct.p.npoints(ii) totalframes nreceivers]);
337337

338-
[X1,X2] = ndgrid(1:refframes, 1:nechoes);
339-
X1 = X1'; X1 = X1(:);
340-
X2 = X2'; X2 = X2(:);
341-
Y1 = (-1).^(MRS_struct.p.GE.noadd(ii) * (X1-1));
342-
Y1 = permute(repmat(Y1, [1 MRS_struct.p.npoints(ii) 2 nreceivers]), [3 2 1 4]);
343-
Y2 = 1 + (totalframes/nechoes) * (X2-1) + X1;
338+
[X1,X2] = ndgrid(1:refframes, 1:nechoes);
339+
X1 = X1'; X1 = X1(:);
340+
X2 = X2'; X2 = X2(:);
341+
Y1 = (-1).^(MRS_struct.p.GE.noadd(ii) * (X1-1));
342+
Y1 = permute(repmat(Y1, [1 MRS_struct.p.npoints(ii) 2 nreceivers]), [3 2 1 4]);
343+
Y2 = 1 + (totalframes/nechoes) * (X2-1) + X1;
344344
WaterData = Y1 .* ShapeData(:,:,Y2,:) * multw;
345345

346-
[X1,X2] = ndgrid(1:dataframes, 1:nechoes);
347-
X1 = X1'; X1 = X1(:);
348-
X2 = X2'; X2 = X2(:);
349-
Y1 = (-1).^(MRS_struct.p.GE.noadd(ii) * (X1-1));
350-
Y1 = permute(repmat(Y1, [1 MRS_struct.p.npoints(ii) 2 nreceivers]), [3 2 1 4]);
351-
Y2 = 1 + refframes + (totalframes/nechoes) * (X2-1) + X1;
346+
[X1,X2] = ndgrid(1:dataframes, 1:nechoes);
347+
X1 = X1'; X1 = X1(:);
348+
X2 = X2'; X2 = X2(:);
349+
Y1 = (-1).^(MRS_struct.p.GE.noadd(ii) * (X1-1));
350+
Y1 = permute(repmat(Y1, [1 MRS_struct.p.npoints(ii) 2 nreceivers]), [3 2 1 4]);
351+
Y2 = 1 + refframes + (totalframes/nechoes) * (X2-1) + X1;
352352
MetabData = Y1 .* ShapeData(:,:,Y2,:) * mult;
353353

354354
totalframes = totalframes - (refframes + 1) * nechoes; % RTN 2017
@@ -362,30 +362,32 @@
362362
WaterData = permute(WaterData, [3 1 2]);
363363

364364
% Generalized least squares method (An et al., JMRI, 2013, doi:10.1002/jmri.23941)
365-
[nCh, nPts, nReps] = size(WaterData);
366-
noise_pts = false(1,nPts);
365+
[nCh, nPts, nReps] = size(WaterData);
366+
noise_pts = false(1,nPts);
367367
noise_pts(ceil(0.75*nPts):end) = true;
368-
noise_pts = repmat(noise_pts, [1 nReps]);
369-
tmpWaterData = reshape(WaterData, [nCh nPts*nReps]);
368+
noise_pts = repmat(noise_pts, [1 nReps]);
369+
tmpWaterData = reshape(WaterData, [nCh nPts*nReps]);
370370

371-
e = tmpWaterData(:,noise_pts);
372-
Psi = e*e';
371+
e = tmpWaterData(:,noise_pts);
372+
Psi = e*e';
373373
WaterData_avg = mean(WaterData,3);
374-
S = WaterData_avg(:,1);
375-
w = (S'*(Psi\S))^-1 * S' / Psi;
376-
WaterData = w.' .* WaterData;
374+
S = WaterData_avg(:,1);
375+
w = (S'*(Psi\S))^-1 * S' / Psi;
376+
WaterData = w.' .* WaterData;
377+
377378
MRS_struct.fids.data_water = mean(squeeze(sum(WaterData,1)),2);
378379

379-
[nCh, nPts, nReps] = size(MetabData);
380-
noise_pts = false(1,nPts);
380+
[nCh, nPts, nReps] = size(MetabData);
381+
noise_pts = false(1,nPts);
381382
noise_pts(ceil(0.75*nPts):end) = true;
382-
noise_pts = repmat(noise_pts, [1 nReps]);
383-
tmpMetabData = reshape(MetabData, [nCh nPts*nReps]);
383+
noise_pts = repmat(noise_pts, [1 nReps]);
384+
tmpMetabData = reshape(MetabData, [nCh nPts*nReps]);
384385

385-
e = tmpMetabData(:,noise_pts);
386-
Psi = e*e';
387-
w = (S'*(Psi\S))^-1 * S' / Psi;
386+
e = tmpMetabData(:,noise_pts);
387+
Psi = e*e';
388+
w = (S'*(Psi\S))^-1 * S' / Psi;
388389
MetabData = w.' .* MetabData;
390+
389391
MRS_struct.fids.data = squeeze(sum(MetabData,1));
390392

391393
end

GannetPreInitialise.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
MRS_struct.p.mat = 0; % Save MRS_struct as a .mat file
3939
MRS_struct.p.csv = 0; % Extract useful data from MRS_struct and export them to a .csv file (applies to GannetFit,
4040
% GannetSegment and GannetQuantify)
41-
MRS_struct.p.append = 0; % Append PDF outputs into one PDF (separately for each module) (requires export_fig in the Gannet
41+
MRS_struct.p.append = 1; % Append PDF outputs into one PDF (separately for each module) (requires export_fig in the Gannet
4242
% folder to be added to the search path and GhostScript to be installed)
4343
MRS_struct.p.hide = 0; % Do not display output figures
4444

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ __It is highly recommended that you only add the main SPM12 folder (_spm12_) to
6060

6161
## Compatibility
6262

63-
Gannet is currently being developed in MATLAB R2021a in macOS 11.4 Big Sur. While reasonable effort is made to ensure legacy and cross-OS compatibility, an error-free user experience is not guaranteed.
63+
Gannet is currently being developed in MATLAB R2022b in macOS 12.6 Monterey. While reasonable effort is made to ensure legacy and cross-OS compatibility, an error-free user experience is not guaranteed.
6464

6565
## Supported file formats
6666

0 commit comments

Comments
 (0)