Fiji, bug with io.Nrrd_Writer?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Fiji, bug with io.Nrrd_Writer?

Colin Poczatek
Hello,

I believe that there's a bug in how io.Nrrd_Writer writes a .nrrd
header.  This isn't actually reproducable from within ImageJ/Fiji but I
think it's real/valid.  To reproduce you need Fiji and the unu command
line tools [1].  This happens with the latest version of Fiji and unu/teem.

1) Open blobs.gif, then File -> Save As -> Nrrd

2) call some unu commands on blobs.nrrd

3) "unu head blobs.nrrd" reads the header and sends it to standard out:

NRRD0004
# Created by Nrrd_Writer at Wed Apr 10 11:02:47 EDT 2013
type: uint8
encoding: raw
endian: big
dimension: 2
sizes: 256 254
space dimension: 2
space directions: (1.0,0,0) (0,1.0,0)
space units: "pixel" "pixel"

4) "unu data blobs.nrrd" should skip the header and write the data to
standard out, but fails with:

unu data: error reading header:
[nrrd] nrrdLoad: trouble reading "blobs.nrrd"
[nrrd] nrrdRead: trouble
[nrrd] _nrrdRead: trouble reading NRRD file
[nrrd] _nrrdFormatNRRD_read: trouble parsing space directions info
"(1.0,0,0) (0,1.0,0)"
[nrrd] _nrrdReadNrrdParse_space_directions: trouble getting space vector
1 of 2
[nrrd] _nrrdSpaceVectorParse: space dimension is 2, but seem to have 3
coefficients

Other unu commands fail with the same error.

5) I can't seem to find it explicitly in the file spec [2], but I think
that all "space" tags need to agree in terms of size, and the notation
used in the spec (like ' space units: "<unit[0]>" "<unit[1]>" ...
"<unit[dim-1]>" ') seems to imply it.

ie this header seems valid (changing the 'space directions:' field):

unu head new.nrrd

NRRD0004
# Created by Nrrd_Writer at Wed Apr 10 11:02:47 EDT 2013
type: uint8
encoding: raw
endian: big
dimension: 2
sizes: 256 254
space dimension: 2
space directions: (1.0,0) (0,1.0)
space units: "pixel" "pixel"

Or this header (changing 'space dimension:' and 'space units:')

unu head new2.nrrd

NRRD0004
# Created by Nrrd_Writer at Wed Apr 10 11:02:47 EDT 2013
type: uint8
encoding: raw
endian: big
dimension: 2
sizes: 256 254
space dimension: 3
space directions: (1.0,0,0) (0,1.0,0)
space units: "pixel" "pixel" "pixel"


I would think that the way io.Nrrd_Writing is writing is "wrong" but I
don't completely understand what these 'space' fields mean...

Thanks,
Collin

[1] http://teem.sourceforge.net/unrrdu/index.html
and download page
http://teem.sourceforge.net/download/index.html

[2] http://teem.sourceforge.net/nrrd/format.html#spacedirections


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html