[Pkg-exppsy-pynifti] nifti extensions bug?

Michael Hanke michael.hanke at gmail.com
Mon Feb 23 20:48:47 UTC 2009


Hi,

thanks for your report. I'll take a look at it shortly.

Cheers,

Michael


On Mon, Feb 23, 2009 at 03:04:38PM -0500, Kanterakis, Efstathios wrote:
> Dear all,
> I've been using pynifti for quite a while and it has made a big
> difference in our lab. Thanks for continuing to develop and support it.
> Recently I've been playing around with Nifti header extensions and
> discovered a potential bug.
> Seems that extensions which are N*16+8 characters (bytes) in length get
> saved with junk characters appended at the end.
> 
> To re-create the problem, I attach a simple script that creates a blank
> image, adds extensions of a variety of sizes, saves the image and then
> retrieves the extensions back.
> 
> For lengths 8 and 24, with this text as input:
> 12345678
> 123456789012345678901234
> 
> I get the following text back:
> 12345678`Z~\x17'
> 123456789012345678901234!
> 
> When I use Afni's nifti_tool to display header extensions I get:
> > nifti_tool -disp_exts -infiles bug_report.nii
> header file 'bug_report.nii', num_ext = 18
>     ext #0 : ecode = 0, esize = 16, edata = (unknown data type)
>     ext #1 : ecode = 0, esize = 32, edata = (unknown data type)
>     ext #2 : ecode = 0, esize = 32, edata = (unknown data type)
>     ext #3 : ecode = 0, esize = 32, edata = (unknown data type)
>     ext #4 : ecode = 0, esize = 32, edata = (unknown data type)
>     ext #5 : ecode = 0, esize = 32, edata = (unknown data type)
>     ext #6 : ecode = 0, esize = 32, edata = (unknown data type)
>     ext #7 : ecode = 0, esize = 32, edata = (unknown data type)
>     ext #8 : ecode = 0, esize = 32, edata = (unknown data type)
>     ext #9 : ecode = 0, esize = 32, edata = (unknown data type)
>     ext #10 : ecode = 0, esize = 32, edata = (unknown data type)
>     ext #11 : ecode = 0, esize = 32, edata = (unknown data type)
>     ext #12 : ecode = 0, esize = 32, edata = (unknown data type)
>     ext #13 : ecode = 0, esize = 32, edata = (unknown data type)
>     ext #14 : ecode = 0, esize = 32, edata = (unknown data type)
>     ext #15 : ecode = 0, esize = 32, edata = (unknown data type)
>     ext #16 : ecode = 0, esize = 32, edata = (unknown data type)
>     ext #17 : ecode = 0, esize = 48, edata = (unknown data type)
> 
> So pynifti in most cases saves the extensions correctly, as per nifti
> specifications ("esize must be a positive integral multiple of 16"
> http://nifti.nimh.nih.gov/nifti-1/documentation/nifti1fields/nifti1field
> s_pages/extension.html)
> except for the case explained above.
> 
> I attach the nifti file that was created by this script for your
> convenience.
> 
> Looking forward to the next release!
> 
> Thank you very much for your help and efforts
> Regards,
> Stathis Kanterakis
> 
> 
> 
> 
> The information contained in this e-mail message is intended only for the personal and confidential use of the recipient(s) named above. If the reader of this message is not the intended recipient or an agent responsible for delivering it to the intended recipient, you are hereby notified that you have received this document in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail, and delete the original message.


> _______________________________________________
> Pkg-exppsy-pynifti mailing list
> Pkg-exppsy-pynifti at lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/pkg-exppsy-pynifti


-- 
GPG key:  1024D/3144BE0F Michael Hanke
http://apsy.gse.uni-magdeburg.de/hanke
ICQ: 48230050



More information about the Pkg-exppsy-pynifti mailing list