CIC-methods / FID-A

Toolbox for simulation and processing of in-vivo magnetic resonance spectroscopy (MRS) data
BSD 3-Clause "New" or "Revised" License
80 stars 72 forks source link

Add weight arguments to align subspecs #74

Closed bloyl closed 2 years ago

bloyl commented 2 years ago

HI all,

Not sure what the procedure for PRs is here, but wanted to share this if its of interest.

The issue was that the documentation to op_alignMPSubspecs suggested it aligned focused on water and choline which is not the old behavior.

I added a parameter to allow variable weighting of the spectrum so the user can prioritize certain peaks. I also modified the docstring to match.

This is an api change but should be backward compatible. I'm not sure if there is a testing suite or how to use it if there is one. but if needed I'd happily add a test for this functionality.

Thanks. Luke

jamienear commented 2 years ago

Hi Luke, I love this! Thanks so much for sharing! The concept is likely applicable to the other spectral alignment tools in the toolbox as well (op_alignaverages.m, op_alignscans.m, etc.). Over time I can try to implement this across the board. Regarding testing: I tested it briefly on my end and it seems to work well, so I am merging now. Thanks again!!