jip image format

In addition to NIFTI-formatted data files, one can use a “native” jip format that consists of a header-less binary file with a separate keyword-delimited ASCII header file. The header file always uses the extension “.hdr”, whereas the image data file can either use an extension that specifies the data storage format directly, or a non-standard extension (or no extension) with the understanding that the header file will specify the format of data contained in the image file. Defined extensions for image files include:


        .bshort        for short integers (16 bits; data range=-32,768 to 32767)
        .bfloat         for floating point numbers (32 bits)
        .blong         for long integers; generally no advantage over floats
        .ushort        for unsigned short integers (16 bits; data range = 0 to 65535).


Alternatively, the format can be specified inside the ASCII header file by

        storage-type short (or float / long / unsigned short / unsigned char)


Typically, the first option above is used, so files will exist as pairs (e.g., “data.bfloat” and “data.hdr”). The second option (inclusion of the data storage type inside the file) facilitates reading header-less files that have been created by other software (e.g., Bruker image files) by simply creating an additional small header file.


While all file types above are supported on input, only .bshort and .bfloat are supported on output.


Header files must give the 4 dimensions plus other information like the resolution, coordindate origin, and step direction of the coordinate system.  A typical header file looks like this:

      x 64                                  # optionally, use "matrix 64 50 42"
      y 50                                  #  or even "matrix 64 50 42 200"
      z 42
      t 200                                  # number of time points
      resolution 0.25 0.25 0.5 3 # usually millimeter units and seconds
      origin -8 12 6.2                  # the (i,j,k)=(0,0,0) point has this coordinate value
      direction 1 -1 -1                 # directions of coordinate increments
      byte-order 1                       # specifies PC byte-order
      data-type magnitude         # “complex”, “real-imaginary”, “magnitude-phase”
      information:                       # ignore everything after this keyword
      TR 1200
      TE 10
      segments 16
      blah, blah, blah

Default values:  resolution 1 1 1 0  (the default time resolution is set to 0!)
                          origin 0 0 0
                          direction 1 1 1
                          data-type magnitude

Joseph B. Mandeville, Athinoula A. Martinos Center for Biomedical Imaging at MGH/MIT/Harvard