Makebasis function

Hi team.

I hope you are well. Quick question. I want to replicate the functionality of LCModel’s makebasis function for a friend that’s using LCModel in Windows. From my understanding this function just stitches together the .RAW basis files alongside some header information. Has anybody attempted writing a standalone function for this?

Best wishes,

Hi Ioannis,

You’re correct that we don’t need makebasis. We have a function for Osprey that takes FID-A simulations and writes them out into a .basis file (osprey/io_writelcmBASIS.m at develop · schorschinho/osprey · GitHub). It shouldn’t be too hard to use osprey/io_writelcmraw.m at develop · schorschinho/osprey · GitHub to read .raw files into the FID-A format and then write them out (you will need to modify io_writelcmBASIS.m a little to cut out the intermediate Osprey step).


As always, thanks much Georg.

1 Like

I think I am back to the drawing table.
I am having a hard time understanding what LCModel’s makebasis function does. By looking at the scripts kindly provided above, to create a .basis file, what you basically have to do is fft the fids of the basis sets (with some shifting if needed).

I am using a phantom example to probe into this further (acetate and lactate with dss). I created basis fids for these and used the above script to create a .basis file. This was tested against creating two .RAW files for the basis set and using LCModel’s makebasis function.

However, the two results are different. I might be doing something wrong but I am curious to see what you all think.

Best wishes,

Can you share what is different?

I would never build basis sets from phantom measurements. We can simulate those much better than we could ever measure them.

LCModel does in fact do a lot of little tweaks in makebasis, precisely because it was designed to act on phantom solutions, i.e. it looks for frequency and phase reference peaks (I believe it’s formate aside from DSS). Obviously, we don’t do any of that in our scripts - simply because we don’t use phantom solutions any more.

1 Like

Apologies for being a bit vague. The basis set that I mentioned is indeed from simulations (I am so used to using “phantom” terminology because I was playing with acetate and lactate).

So, for the first path, I simulated acetate and lactate (with dss) and I created those fids. Then, I applied the writelcmBASIS scripts to create a .basis file. The second path was for me to write those fids to .RAW files and use makebasis to create a .basis file. The final result was slightly different but I will need to check again. I think I might be going down a rabbit hole but I am relieved to know that you are using the writelcmBASIS for creating the .basis file.