source: trunk/loci/formats/doc/nd2.html @ 3140

Revision 3140, 2.4 KB checked in by melissa, 13 years ago (diff)

Updated ND2 doc and what's new for next release.

Line 
1<html>
2
3<p><b>File format name:</b> Nikon ND2
4<p><b>Maintainer:</b><a href="http://www.nikonusa.com">Nikon</a>
5<p><b>Software that produces these files:</b><a href="http://www.nis-elements.com">NIS Elements</a>
6<p><b>Other software that reads this format:</b>NIS Elements<BR>
7<p><b>Specifications:</b>none :-(
8<p><b>Structure:</b><BR>
9
10** All ND2 files are little-endian.<BR><BR>
11
12Old ND2:<BR><BR>
13
14"Old" ND2 refers to files that were generated before May or June of 2007.
15Basically, the file consists of a series of <a href="http://www.jpeg.org/jpeg2000/">JPEG-2000</a> codestreams, with a block of XML stuck on the end.<BR>
16
17<BR>'file' on an old ND2 file looks like this:<BR><BR>
18
19user@machine:/data/$ file old_nd2.nd2<BR>
20old_nd2.nd2: JPEG 2000 image data<BR>
21
22The first 8 bytes of the file should be: 0x00 00 00 0c 6a 50 20 20<BR><BR>
23
24The only really noteworthy aspect of this format is that the XML block at the end of the file is malformed, so we have to parse it manually (meaning someone at some point may find missing or mislabeled metadata).
25
26<BR><BR>New ND2:<BR><BR>
27
28"New" ND2 refers to files that were generated after May or June of 2007.
29The new format is much preferred to the old format, in that the pixels are stored raw or zlib-compressed (and thus JAI is not required).<BR>
30
31<BR>'file' on a new ND2 file looks like this:<BR><BR>
32
33user@machine:/data/$ file new_nd2.nd2<BR> 
34new_nd2.nd2: PARIX object not stripped<BR>
35
36The file is divided into chunks of the following format:<BR>
37
384 byte header - 0xda ce be 0a<BR>
394 bytes - signed integer (length part 1)<BR>
404 bytes - signed integer (length part 2)<BR>
414 bytes - signed integer (ignored)<BR>
42length pt 1 + length pt 2 bytes of data<BR><BR>
43
44The data portion of each chunk begins with a string identifer terminated by "!"; for pixel data, this is "ImageDataSeq|%n!", where %n is the plane number (indexed from 0).  Otherwise, if the identifier begins with "Image%s!", you can expect a block of XML metadata.  Unlike old ND2, this is valid XML, which we parse using SAX.
45<BR><BR>
46
47<p><b>Other notes:</b><BR>
48- JAI is required for reading old ND2 files<BR>
49- We are aware that it takes too long to read image planes.  This has always been the case, and will continue to be until JAI is improved or we implement a native JPEG2000 solution.<BR>
50- The axis size detection logic is absolutely horrible, but it works.<BR>
51- We were first made aware of "new" ND2 in June 2007 - the precise date it was released is unknown.<BR>
52
53</html>
Note: See TracBrowser for help on using the repository browser.