Skip to content

Commit

Permalink
Merge pull request #699 from HJZollner/develop
Browse files Browse the repository at this point in the history
Add LCModel support for GABA-edited MEGA-PRESS
  • Loading branch information
HJZollner authored Mar 8, 2024
2 parents d52f75a + f4a5eae commit c5542e1
Show file tree
Hide file tree
Showing 16 changed files with 823 additions and 306 deletions.
28 changes: 14 additions & 14 deletions GUI/osp_updateFitWindow.m
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function osp_updateFitWindow(gui)
% No info panel string for the water fit range
waterFitRangeString = '';
% Where are the metabolite names stored?
basisSetNames = MRSCont.fit.results.(gui.fit.Style).fitParams{1,gui.controls.Selected}.name;
basisSetNames = MRSCont.fit.results.(gui.fit.Style).fitParams{1,gui.controls.Selected,subspectrum}.name;
% Smaller fonts for the results
resultsFontSize = 9;
case 'Osprey'
Expand Down Expand Up @@ -99,10 +99,10 @@ function osp_updateFitWindow(gui)
switch MRSCont.opts.fit.method
case 'LCModel'
if strcmp(gui.fit.Names{gui.fit.Selected}, 'ref') || strcmp(gui.fit.Names{gui.fit.Selected}, 'w')
RawAmpl = MRSCont.fit.results.(gui.fit.Style).fitParams{1,gui.controls.Selected}.h2oarea .* MRSCont.fit.scale{1,gui.controls.Selected};
RawAmpl = MRSCont.fit.results.(gui.fit.Style).fitParams{1,gui.controls.Selected,subspectrum}.h2oarea .* MRSCont.fit.scale{1,gui.controls.Selected};
else
RawAmpl = MRSCont.fit.results.(gui.fit.Style).fitParams{1,gui.controls.Selected}.ampl .* MRSCont.fit.scale{1,gui.controls.Selected};
CRLB = MRSCont.fit.results.(gui.fit.Style).fitParams{1,gui.controls.Selected}.CRLB;
RawAmpl = MRSCont.fit.results.(gui.fit.Style).fitParams{1,gui.controls.Selected,subspectrum}.ampl .* MRSCont.fit.scale{1,gui.controls.Selected};
CRLB = MRSCont.fit.results.(gui.fit.Style).fitParams{1,gui.controls.Selected,subspectrum}.CRLB;
end
case 'Osprey'
RawAmpl = MRSCont.fit.results.(gui.fit.Style).fitParams{basis,gui.controls.Selected,subspectrum}.ampl .* MRSCont.fit.scale{1,gui.controls.Selected};
Expand All @@ -125,19 +125,19 @@ function osp_updateFitWindow(gui)
switch MRSCont.opts.fit.method
case 'LCModel'
if strcmp(gui.fit.Names{gui.fit.Selected}, 'ref') || strcmp(gui.fit.Names{gui.fit.Selected}, 'w')
RawAmpl = MRSCont.fit.results{1,gui.controls.act_x}.(gui.fit.Style).fitParams{gui.controls.Selected}.h2oarea .* MRSCont.fit.scale{gui.controls.Selected};
RawAmpl = MRSCont.fit.results{1,gui.controls.act_x}.(gui.fit.Style).fitParams{gui.controls.Selected,subspectrum}.h2oarea .* MRSCont.fit.scale{gui.controls.Selected};
else
RawAmpl = MRSCont.fit.results{1,gui.controls.act_x}.(gui.fit.Style).fitParams{gui.controls.Selected}.ampl .* MRSCont.fit.scale{gui.controls.Selected};
CRLB = MRSCont.fit.results{1,gui.controls.act_x}.(gui.fit.Style).fitParams{gui.controls.Selected}.CRLB;
RawAmpl = MRSCont.fit.results{1,gui.controls.act_x}.(gui.fit.Style).fitParams{gui.controls.Selected,subspectrum}.ampl .* MRSCont.fit.scale{gui.controls.Selected};
CRLB = MRSCont.fit.results{1,gui.controls.act_x}.(gui.fit.Style).fitParams{gui.controls.Selected,subspectrum}.CRLB;
end
case 'Osprey'
RawAmpl = MRSCont.fit.results{1,gui.controls.act_x}.(gui.fit.Style).fitParams{basis,gui.controls.Selected}.ampl .* MRSCont.fit.scale{gui.controls.Selected};
end
ph0 = MRSCont.fit.results{1,gui.controls.act_x}.(gui.fit.Style).fitParams{basis,gui.controls.Selected}.ph0;
ph1 = MRSCont.fit.results{1,gui.controls.act_x}.(gui.fit.Style).fitParams{basis,gui.controls.Selected}.ph1;
ph0 = MRSCont.fit.results{1,gui.controls.act_x}.(gui.fit.Style).fitParams{basis,gui.controls.Selected,subspectrum}.ph0;
ph1 = MRSCont.fit.results{1,gui.controls.act_x}.(gui.fit.Style).fitParams{basis,gui.controls.Selected,subspectrum}.ph1;
if ~strcmp(gui.fit.Names{gui.fit.Selected}, 'ref') && ~strcmp(gui.fit.Names{gui.fit.Selected}, 'w')
refShift = MRSCont.fit.results{1,gui.controls.act_x}.(gui.fit.Style).fitParams{basis,gui.controls.Selected}.refShift;
refFWHM = MRSCont.fit.results{1,gui.controls.act_x}.(gui.fit.Style).fitParams{basis,gui.controls.Selected}.refFWHM;
refShift = MRSCont.fit.results{1,gui.controls.act_x}.(gui.fit.Style).fitParams{basis,gui.controls.Selected,subspectrum}.refShift;
refFWHM = MRSCont.fit.results{1,gui.controls.act_x}.(gui.fit.Style).fitParams{basis,gui.controls.Selected,subspectrum}.refFWHM;
switch MRSCont.opts.fit.method
case 'Osprey'
iniph0 = MRSCont.fit.results{1,gui.controls.act_x}.(gui.fit.Style).fitParams{basis,gui.controls.Selected}.prelimParams.ph0;
Expand All @@ -151,10 +151,10 @@ function osp_updateFitWindow(gui)
switch MRSCont.opts.fit.method
case 'LCModel'
if strcmp(gui.fit.Names{gui.fit.Selected}, 'ref') || strcmp(gui.fit.Names{gui.fit.Selected}, 'w')
RawAmpl = MRSCont.fit.results{gui.controls.act_x,gui.controls.act_y}.(gui.fit.Style).fitParams{gui.controls.Selected}.h2oarea .* MRSCont.fit.scale{gui.controls.Selected};
RawAmpl = MRSCont.fit.results{gui.controls.act_x,gui.controls.act_y}.(gui.fit.Style).fitParams{gui.controls.Selected,subspectrum}.h2oarea .* MRSCont.fit.scale{gui.controls.Selected};
else
RawAmpl = MRSCont.fit.results{gui.controls.act_x,gui.controls.act_y}.(gui.fit.Style).fitParams{gui.controls.Selected}.ampl .* MRSCont.fit.scale{gui.controls.Selected};
CRLB = MRSCont.fit.results{gui.controls.act_x,gui.controls.act_y}.(gui.fit.Style).fitParams{gui.controls.Selected}.CRLB;
RawAmpl = MRSCont.fit.results{gui.controls.act_x,gui.controls.act_y}.(gui.fit.Style).fitParams{gui.controls.Selected,subspectrum}.ampl .* MRSCont.fit.scale{gui.controls.Selected};
CRLB = MRSCont.fit.results{gui.controls.act_x,gui.controls.act_y}.(gui.fit.Style).fitParams{gui.controls.Selected,subspectrum}.CRLB;
end
case 'Osprey'
RawAmpl = MRSCont.fit.results{gui.controls.act_x,gui.controls.act_y}.(gui.fit.Style).fitParams{basis,gui.controls.Selected,subspectrum}.ampl .* MRSCont.fit.scale{gui.controls.Selected};
Expand Down
8 changes: 4 additions & 4 deletions exampledata/sdat/MEGA/jobSDAT_MEGA.m
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
opts.SubSpecAlignment.mets = 'L2Norm'; % OPTIONS: - 'L2Norm' (default)
% - 'L1Norm'
% - 'none'

opts.UnstableWater = 0;
%Perform eddy-current correction on the metabolite data (raw) or metabolite
%-nulled data (mm). This can either be done similar for all data sets by
%supplying a single value or specified for each dataset individually by supplying
Expand All @@ -126,10 +126,10 @@
% - [] array

% Save LCModel-exportable files for each spectrum?
opts.saveLCM = 0; % OPTIONS: - 0 (no, default)
opts.saveLCM = 1; % OPTIONS: - 0 (no, default)
% - 1 (yes)
% Save jMRUI-exportable files for each spectrum?
opts.savejMRUI = 0; % OPTIONS: - 0 (no, default)
opts.savejMRUI = 1; % OPTIONS: - 0 (no, default)
% - 1 (yes)

% Save processed spectra in vendor-specific format (SDAT/SPAR, RDA, P)?
Expand Down Expand Up @@ -184,7 +184,7 @@
% - 1 (yes, default)

% How do you want to model the co-edited macromolecules at 3 ppm for GABA-edited MRS?
opts.fit.coMM3 = 'freeGauss'; % OPTIONS: - {'3to2MM'} (default)
opts.fit.coMM3 = '3to2MM'; % OPTIONS: - {'3to2MM'} (default)
% - {'3to2MMsoft'}
% - {'1to1GABA'}
% - {'1to1GABAsoft'}
Expand Down
Loading

0 comments on commit c5542e1

Please sign in to comment.