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

io_loadspec_IMA.m incompatible with op_leftshift.m by omitting a negative sign #97

Closed dont-ask-why closed 1 year ago

dont-ask-why commented 2 years ago

Found in Line 157 of inputOutput/io_loadspec_IMA.m

By using different operators for the same action, the spectra will flip when op_leftshift is called.

jamienear commented 1 year ago

Hi Ivo,

If I understand you correctly, you are suggesting that there should be a minus sign on line 157?

i.e.: "ppm=-f/(Bo*42.577);"

instead of

"ppm=f/(Bo*42.577);"

Is that correct? Please confirm. I don't think I have any .IMA data that I can test this on.

Thank you, Jamie

dont-ask-why commented 1 year ago

Hi Jamie, see pull request #98 for my entire proposed change. The IMA data I use is read correctly without any changes, so only adding the minus sign would flip the spectrum. This means line 33 additionally has to read the conjugated data for it to be displayed correctly once again. Afterwards, it is also compatible with the op_leftshift function (as it recalculates the ppm with the minus sign).

My IMA data could theoretically be already flipped, meaning reading the conjugated data is unnecessary. However, I find that unlikely. I have tested the process with the corresponding dat files as well, which were not flipped.

Hope that helps, Ivo

dont-ask-why commented 1 year ago

Terribly sorry, pressed the wrong button there. Just wanted to comment, not close.

jamienear commented 1 year ago

Sorry, I dropped this thread. Thank you for these changes. I am merging the pull request now.
-Jamie