[Neuroimaging] nibabel: probelm reading a nii.gz

Reynolds, Richard C. (NIH/NIMH) [E] reynoldr at mail.nih.gov
Mon Jul 24 13:39:39 EDT 2017


Hi Gabriel,


It is simple to modify with the nifti_tool program (from

the nifticlib library), but I don't know whether you have

that, e.g.


   nifti_tool -mod_hdr -mod_field magic 'n+1' \

                  -infiles C1_Rel_thres40.0.nii -prefix NEW.nii


I don't actually use these python tools, but just

thought to report on the NIFTI problem, expecting

that the software that generated your dataset might

need a little fix.


- rick


________________________________
From: Gabriel Reynés <greynell at gmail.com>
Sent: Monday, July 24, 2017 9:43 AM
To: Neuroimaging analysis in Python
Subject: Re: [Neuroimaging] nibabel: probelm reading a nii.gz

Thank Richard,

Is there any way to modify this? The nii file would be better, but if not the code. I tried to follow the code of nibabel load function but I am geting lost.


Thanks


Bests,


Gabriel

On Mon, Jul 24, 2017 at 2:50 PM, Reynolds, Richard C. (NIH/NIMH) [E] <reynoldr at mail.nih.gov<mailto:reynoldr at mail.nih.gov>> wrote:

Hi Gabriel,


The magic string in the header is stored as

"\0n+1", rather than "n+1\0".


- rick


________________________________
From: Gabriel Reynés <greynell at gmail.com<mailto:greynell at gmail.com>>
Sent: Sunday, July 23, 2017 6:49:05 AM
To: Neuroimaging analysis in Python
Subject: Re: [Neuroimaging] nibabel: probelm reading a nii.gz

Hi,

I uploaded to drive the nii.gz and the unziped .nii. Here is the link to download: https://drive.google.com/file/d/0B1t55gf3wT7fSURVemRaYVl2S0k/view?usp=sharing

Thanks for helping.

Bests,


Gabriel

On Sun, Jul 23, 2017 at 12:16 AM, Matthew Brett <matthew.brett at gmail.com<mailto:matthew.brett at gmail.com>> wrote:
Hi,

Can you put the image somewhere where we/I can get it?

Cheers,

Matthew

On 22 Jul 2017 18:31, "Gabriel Reynés" <greynell at gmail.com<mailto:greynell at gmail.com>> wrote:
Hello,

I have some troubles reading a nii.gz with nibabel. I get the error: "nibabel.filebasedimages.ImageFileError: Cannot work out file type of"

So far I tried to unzip the file to a nii, but I did not achieve anything. The image is not corrupt as I can see it using ImageJ.
It only contains a mask, so maybe is lacking some field nibabel is searching for? I just need the mask to post-process the image, so I don't need any other field.

Any idea how to solve this problem?


Thank you for your time,

Gabriel

_______________________________________________
Neuroimaging mailing list
Neuroimaging at python.org<mailto:Neuroimaging at python.org>
https://mail.python.org/mailman/listinfo/neuroimaging



_______________________________________________
Neuroimaging mailing list
Neuroimaging at python.org<mailto:Neuroimaging at python.org>
https://mail.python.org/mailman/listinfo/neuroimaging



_______________________________________________
Neuroimaging mailing list
Neuroimaging at python.org<mailto:Neuroimaging at python.org>
https://mail.python.org/mailman/listinfo/neuroimaging


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/neuroimaging/attachments/20170724/71a47358/attachment.html>


More information about the Neuroimaging mailing list