wtclarke / fsl_mrs

Mirror of the FSL-MRS gitlab repository
https://git.fmrib.ox.ac.uk/fsl/fsl_mrs
Other
14 stars 8 forks source link

Problem converting and visualizing GE P-file data #2

Closed jamienear closed 2 years ago

jamienear commented 4 years ago

Hi Will! Very excited about FSL-MRS. Thanks to you and Saad for putting this all together.

I had my first stab at installing and testing it today and ran into some issues. Installation (in Mac OSX terminal with a newly created conda environment) seemed to go fine with no errors. But when I tried converting a P-file and visualize the results, I ran into a few errors:

  1. First I tried to inspect the contents of my p-file using the -v option in spec2nii as suggested on the "Data Conversion" wiki page"

spec2nii ge -v P04608.7

and was met with the following error:

usage: spec2nii [-h] [--verbose] {twix,dicom,philips,ge,ismrmrd,text,jmrui,raw} ... spec2nii: error: unrecognized arguments: -v

So then I tried using --verbose instead of -v:

spec2nii ge --verbose P04608.7

and got the following message:

usage: spec2nii [-h] [--verbose] {twix,dicom,philips,ge,ismrmrd,text,jmrui,raw} ... spec2nii: error: unrecognized arguments: --verbose

  1. At this point, I gave up on trying to inspect the data, and just went straight to conversion using:

spec2nii ge P04608.7

When I did this, the command ran to completion (giving a warning that for GE data, the orientation information will not be reliable). All of the expected .nii.gz files were generated, BUT no JSON files were generated.

  1. Lastly, when I tried to visualize the data using:

mrs_vis P04608_frame001.nii.gz

I got the following error message:

Traceback (most recent call last): File "/Users/jnear/miniconda3/envs/fslmrs/bin/mrs_vis", line 158, in main() File "/Users/jnear/miniconda3/envs/fslmrs/bin/mrs_vis", line 127, in main tmpmrs = MRS(FID=f, header=header) File "/Users/jnear/miniconda3/envs/fslmrs/lib/python3.8/site-packages/fsl_mrs/core/MRS.py", line 58, in init self.set_acquisition_params(centralFrequency=header['centralFrequency'],bandwidth=header['bandwidth']) File "/Users/jnear/miniconda3/envs/fslmrs/lib/python3.8/site-packages/fsl_mrs/core/MRS.py", line 147, in set_acquisition_params self.centralFrequency = misc.checkCFUnits(centralFrequency)
File "/Users/jnear/miniconda3/envs/fslmrs/lib/python3.8/site-packages/fsl_mrs/utils/misc.py", line 95, in checkCFUnits if cf<1E5: TypeError: '<' not supported between instances of 'NoneType' and 'float'

I can't tell whether this error is because of the missing JSON files? Or if there something wrong with my installation.

Thanks in advance for your help! Happy to share the offending P-file if necessary.

Jamie

wtclarke commented 4 years ago

Hi Jamie,

Good to hear that people are giving it a go!

I think this is indicative that I need to improve some bits of documentation and modify some of the defaults.

The -v option is only currently implemented for Siemens Twix files. This is so you can see what different MDH flags are available to you to extract. I should make some sensible output for the other formats, but I'm much less familiar with them.

You need to specify the -j option to generate a JSON. Again I should make that default as a JSON file is indeed required and why you get an error with mrs_vis.

Hopefully if you run spec2nii again with the -j option and then run mrs_vis you should get some output. Let me know what happens.

P.s. if you have any good phantom data for validating the orientation code in spec2nii for GE data, I'd be very keen to get my hands on it.

jamienear commented 4 years ago

Thank you Will,

That fixed my first problem! I now have both .nii.gz and .json files for each transient in the series, and mrs_vis plots them with no issues.

As a follow-up for my own curiosity: Why do you generate a separate .nii.gz and .json file for each transient of the acquisition? Why not instead just put all of the transients into a single .nii.gz file (kinda like the way an fMRI time-series is stored as a single .nii.gz file)? Personally, I would might find this cleaner (and less anxiety-inducing) than having many .nii.gz and .json files per acquisition.

Jamie

jamienear commented 4 years ago

P.S. Right now I don’t have any GE phantom data that would be useful for validating orientation data, but I might be able to get you some. Will get back to you about this.

wtclarke commented 3 years ago

Hi Jamie,

Just picking this up again. Did you collect any GE data? I'm pushing forward with the spec2nii tool now that we have a provisional NIfTI MRS format set up.

jamienear commented 3 years ago

Hi Will,

Really sorry for the delay. I did collect these data a while back, but things got busy and I never got around to packaging it up and sending it your way.

Will it still be useful for me to send it? I can send it later today or tomorrow morning if that works for you?

Jamie

From: Will Clarke notifications@github.com Date: Thursday, December 17, 2020 at 12:50 PM To: wexeee/fsl_mrs fsl_mrs@noreply.github.com Cc: Jamie Near, Dr. jamie.near@mcgill.ca, Author author@noreply.github.com Subject: Re: [wexeee/fsl_mrs] Problem converting and visualizing GE P-file data (#2)

Hi Jamie,

Just picking this up again. Did you collect any GE data? I'm pushing forward with the spec2nii tool now that we have a provisional NIfTI MRS format set up.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/wexeee/fsl_mrs/issues/2#issuecomment-747596530, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACHTOQKW2PZQLDDNULNVTNTSVJAFJANCNFSM4OY26B6Q.

wtclarke commented 3 years ago

Yes, it would definitely still be useful. I'm planning to release the next version of spec2nii very soon and it would be great to have the GE orientation working by then.

wtclarke commented 3 years ago

P.s. Thanks for collecting the data!

jamienear commented 3 years ago

No problem!

I just sent you a oneDrive link with all of the data. Please let me know if you don’t receive it or if you have trouble accessing it.

Best wishes, Jamie

From: Will Clarke notifications@github.com Date: Wednesday, January 20, 2021 at 3:53 PM To: wexeee/fsl_mrs fsl_mrs@noreply.github.com Cc: Jamie Near, Dr. jamie.near@mcgill.ca, Author author@noreply.github.com Subject: Re: [wexeee/fsl_mrs] Problem converting and visualizing GE P-file data (#2)

P.s. Thanks for collecting the data!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/wexeee/fsl_mrs/issues/2#issuecomment-763930913, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACHTOQM3SIVTGUMRZEE22B3S247FFANCNFSM4OY26B6Q.

wtclarke commented 3 years ago

Just downloaded the data successfully. Thanks Jamie!

From: Jamie Near notifications@github.com Date: Thursday, 21 January 2021 at 12:36 To: wexeee/fsl_mrs fsl_mrs@noreply.github.com Cc: William Clarke william.clarke@ndcn.ox.ac.uk, Comment comment@noreply.github.com Subject: Re: [wexeee/fsl_mrs] Problem converting and visualizing GE P-file data (#2) No problem!

I just sent you a oneDrive link with all of the data. Please let me know if you don’t receive it or if you have trouble accessing it.

Best wishes, Jamie

From: Will Clarke notifications@github.com Date: Wednesday, January 20, 2021 at 3:53 PM To: wexeee/fsl_mrs fsl_mrs@noreply.github.com Cc: Jamie Near, Dr. jamie.near@mcgill.ca, Author author@noreply.github.com Subject: Re: [wexeee/fsl_mrs] Problem converting and visualizing GE P-file data (#2)

P.s. Thanks for collecting the data!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/wexeee/fsl_mrs/issues/2#issuecomment-763930913, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACHTOQM3SIVTGUMRZEE22B3S247FFANCNFSM4OY26B6Q.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/wexeee/fsl_mrs/issues/2#issuecomment-764613953, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AFJJTTQEJT3M5DV4RELYSVLS3ANULANCNFSM4OY26B6Q.

wtclarke commented 2 years ago

I think there is now reasonable handling of GE sequences in spec2nii, though happy to put more work in if needed. Closing for now.