Basic Python function to read LCModel COORD data : return is a dict containing:
ppm
: points on the ppm scaledata
: data to be fit, on the ppm scalecompleteFit
: the model fit, including baselinebaseline
: the modelled baseline (not present ifNOBASE
is set, which is the default for mega-press and certain other modes)
In response to: https://forum.mrshub.org/t/questions-about-lcmodel-coordinate-files/1141
Note that this does not extract other parameters from the COORD file, and does not attempt to read individual metabolite fits (where NEACH
is specified)
For MATLAB, consider:
- https://github.com/chenkonturek/MRS_MRI_libs/blob/master/MRS_lib/io/mrs_readLcmodelCOORD.m
- https://github.com/CIC-methods/FID-A/blob/master/inputOutput/io_readlcmcoord.m
- https://github.com/CIC-methods/FID-A/blob/master/inputOutput/io_readlcmcoord_getBackground.m
I believe versions of the above may also be incorporated into Osprey https://github.com/schorschinho/osprey