Skip to content

Commit

Permalink
Update callLCModel.m
Browse files Browse the repository at this point in the history
Does not need MRSCont as input (allows the function to be used more universally as a helper function).
  • Loading branch information
schorschinho committed Apr 8, 2024
1 parent 926f389 commit 1d974ed
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
14 changes: 6 additions & 8 deletions fit/code/LCMwrapper/LCModelWrapper.m
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,12 @@
end
end

callLCModel(MRSCont, MRSCont.opts.fit.lcmodel.controlfileA{kk},[pathLCModelBinary filesep bin]);

% Save the parameters and information about the basis set

MRSCont.fit.results.metab.fitParams{1,kk,1} = readLCMFitParams(MRSCont, 'A', kk);

if MRSCont.flags.isMEGA
callLCModel(MRSCont, MRSCont.opts.fit.lcmodel.controlfileDiff1{kk},[pathLCModelBinary filesep bin]);
% Call LCModel and read in the LCModel output files
if MRSCont.flags.isUnEdited
callLCModel(MRSCont.opts.fit.lcmodel.controlfileA{kk}, [pathLCModelBinary filesep bin]);
MRSCont.fit.results.metab.fitParams{1,kk,1} = readLCMFitParams(MRSCont, 'A', kk);
elseif MRSCont.flags.isMEGA
callLCModel(MRSCont.opts.fit.lcmodel.controlfileDiff1{kk}, [pathLCModelBinary filesep bin]);
MRSCont.fit.results.metab.fitParams{1,kk,2} = readLCMFitParams(MRSCont, 'diff1', kk);
end
end
2 changes: 1 addition & 1 deletion fit/code/LCMwrapper/callLCModel.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function callLCModel(MRSCont, controlFile,pathLCModelBinary)
function callLCModel(controlFile, pathLCModelBinary)
% Wrapper function for LCModel binary

callLCMCommand = ['"' pathLCModelBinary '" < "' controlFile '"'];
Expand Down

0 comments on commit 1d974ed

Please sign in to comment.