wtclarke / mrs_nifti_standard

The NIfTI-MRS data standard: specification, code, and example data.
Other
14 stars 5 forks source link

Error "example_{n}.nii.gz is not a gzip file" #13

Open Microdeep-ZL opened 1 day ago

Microdeep-ZL commented 1 day ago

I tried mrs_tools info example_03.nii.gz but got the following error

$ mrs_tools info example_03.nii.gz 
Traceback (most recent call last):
  File "/home/nmr/.conda/envs/fslmrs/bin/mrs_tools", line 10, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/nmr/.conda/envs/fslmrs/lib/python3.12/site-packages/mrs_tools/__init__.py", line 159, in main
    args.func(args)
  File "/home/nmr/.conda/envs/fslmrs/lib/python3.12/site-packages/mrs_tools/__init__.py", line 171, in info
    data = NIFTI_MRS(file)
           ^^^^^^^^^^^^^^^
  File "/home/nmr/.conda/envs/fslmrs/lib/python3.12/site-packages/nifti_mrs/nifti_mrs.py", line 104, in __init__
    self.image = Image(*args, **kwargs)
                 ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/nmr/.conda/envs/fslmrs/lib/python3.12/site-packages/fsl/data/image.py", line 1261, in __init__
    nibImage   = nib.load(image, **kwargs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/nmr/.conda/envs/fslmrs/lib/python3.12/site-packages/nibabel/loadsave.py", line 115, in load
    raise ImageFileError(msg)
nibabel.filebasedimages.ImageFileError: File /home/nmr/Projects/FSLMRS_test/mrs_nifti_standard/example_data/examples/example_03.nii.gz is not a gzip file

Other example files all have the same error.

After that, I tried to load these files in nibabel in python, and got exactly the same error.

My nibabel version is 5.2.1 what could go wrong?

wtclarke commented 1 day ago

Hi, you need to install git LFS before cloning the repository. Without this the files will just be little stubs.

Sent from Outlook for Androidhttps://aka.ms/AAb9ysg


From: Septem @.> Sent: Friday, October 18, 2024 2:57:37 AM To: wtclarke/mrs_nifti_standard @.> Cc: Subscribed @.***> Subject: [wtclarke/mrs_niftistandard] Error "example{n}.nii.gz is not a gzip file" (Issue #13)

I tried mrs_tools info example_03.nii.gz but got the following error

$ mrs_tools info example_03.nii.gz Traceback (most recent call last): File "/home/nmr/.conda/envs/fslmrs/bin/mrs_tools", line 10, in sys.exit(main()) ^^^^^^ File "/home/nmr/.conda/envs/fslmrs/lib/python3.12/site-packages/mrs_tools/init.py", line 159, in main args.func(args) File "/home/nmr/.conda/envs/fslmrs/lib/python3.12/site-packages/mrs_tools/init.py", line 171, in info data = NIFTI_MRS(file) ^^^^^^^^^^^^^^^ File "/home/nmr/.conda/envs/fslmrs/lib/python3.12/site-packages/nifti_mrs/nifti_mrs.py", line 104, in init self.image = Image(*args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^ File "/home/nmr/.conda/envs/fslmrs/lib/python3.12/site-packages/fsl/data/image.py", line 1261, in init nibImage = nib.load(image, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/nmr/.conda/envs/fslmrs/lib/python3.12/site-packages/nibabel/loadsave.py", line 115, in load raise ImageFileError(msg) nibabel.filebasedimages.ImageFileError: File /home/nmr/Projects/FSLMRS_test/mrs_nifti_standard/example_data/examples/example_03.nii.gz is not a gzip file

Other example files all have the same error.

After that, I tried to load these files in nibabel in python, and got exactly the same error.

My nibabel version is 5.2.1 what could go wrong?

— Reply to this email directly, view it on GitHubhttps://github.com/wtclarke/mrs_nifti_standard/issues/13, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AFJJTTUGDFKC4ADUFLHC4NTZ4CWODAVCNFSM6AAAAABQFI42DWVHI2DSMVQWIX3LMV43ASLTON2WKOZSGU4TMNRRGY3TOMI. You are receiving this because you are subscribed to this thread.Message ID: @.***>