This page details the format, in Backus -Naur Form (BNF) , when image statistics are written to a disk file. This is intended for those who wish to build their own syntactically correct parser to interpret Image Statistics files. Image Statistics are written to disk from the Image Statistics frame.
An Image Statistics file
(<image-stats-spec>
) is a plain text file, consisting of
a statistics header
(<image-stats-header-spec>
) followed by an
intensity histogram (<histogram-spec>
).
In the Image Statistics file, white space
is used to separate the elements within an entry. White space may
consist of space characters, tab characters or new-line
characters. The amount of white space is not significant.
Individual elements that may contain white space are enclosed
in double quotes ("). Literal string elements are shown in
non-italic font
below.
<image-stats-spec> ::= |
<image-stats-header-spec><histogram-spec> |
---|---|
<image-stats-header-spec> ::= |
# Image stats written on <date-time-spec> by
Operator ID=<string-spec> |
<date-time-spec> ::= |
"dd mmm yyyy hh:mm:ss.SSS zzzz" |
<version-spec>
is a string of
ASCII text characters enclosed in double quotation marks (")
giving the build version of Jim. The build version is of
the form "MajorVersion_MinorVersion"
, e.g.,
"4.0_a"
<string-spec>
is a string of
ASCII text characters enclosed in double quotation marks (").
<num-spec>
is a numerical value that may be
either in integer or floating point format, depending on the context.
If the image is slice-selected,
the Slice:
field shows the slice that was selected at
the time the image statistics were written. Otherwise the
Slice:
field shows none
.
The intensity histogram (histogram-spec
) is
written in a tab-separated table with two
columns: the first is the pixel intensity value,
and the second is the number of pixels with that intensity. A
single tab character separates the two columns. For
normalised histograms, the sum of all the values
in the second column is equal to 1.0.
An example of the format of the image statics written to disk is shown below:
# Image stats written on "06 Mar 2006 17:10:44.396 GMT+00:00" by Operator ID="xinapse"
# Build version="4.0_a"
# Image source= "/home/xinapse/images/A.PATIENT._001_STUDY_1_SERIES_6"
# Slice: 25
# Number of non-zero pixels: 17932
# Volume of non-zero pixels: 51302.45 cu mm
# Mean pixel intensity: 109.32
# Visible histogram:
0.0 4760.0
1.0 201.0
2.0 105.0
3.0 77.0
...