Uniformity Correction Parameters File Format

This page details the format, in Backus -Naur Form (BNF) notation, when uniformity correction parameters are written to file. This is intended for those who wish to build their own syntactically correct parser to interpret the contents of these files. See the BNF section for a description of the notation.

A Uniformity Correction Parameters file (<ucp-spec>) is a plain text file, consisting of a header (<ucp-header-spec>) followed by the correction parameters (<ucp-params-spec>). In the Uniformity Correction Parameters 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.

<ucp-spec> ::= <ucp-header-spec><ucp-params-spec>
<ucp-header-spec> ::= # Uniformity correction parameters written on <date-time-spec> by Operator ID=<string-spec>
# Vendor="Xinapse_Systems_Limited"
# Build version=<version-spec>
# Image source=<string-spec>
# Corrected image=<string-spec>
<ucp-params-spec> ::= Order=<order-spec>
Odd-even=<true-false-spec>
Parameters=<params-spec>
<order-spec> ::= Linear | Cubic | Quadratic
<true-false-spec> ::= true | false
<params-spec> ::= [<num-spec>] | <params-spec><num-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., "8.0_1"

<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.

The number of parameters depends on the Order and odd-even settings. Linear requires 3 parameters; Quadratic requires 9 parameters; and Cubic requires 19 parameters. An additional parameter is required if odd-even slice intensity correction is enabled; if odd-even slice intensity correction is enabled then the final parameter relates to a multiplier for the intensity applied to the odd- and even-numbered slices. The intensities of the odd numbered slice are multiplied by 1.0 + s, and the even numbered slice are multiplied by 1.0 - s, where s is the last parameter in the list.

The other parameters are polynomial coefficients as follows:
Parameter Coefficient Used in model
1 x Linear, Quadratic, Cubic
2 y Linear, Quadratic, Cubic
3 z Linear, Quadratic, Cubic
4 x2 Quadratic, Cubic
5 y2 Quadratic, Cubic
6 z2 Quadratic, Cubic
7 xy Quadratic, Cubic
8 xz Quadratic, Cubic
9 yz Quadratic, Cubic
10 x3 Cubic
11 y3 Cubic
12 z3 Cubic
13 x2y Cubic
14 x2z Cubic
15 y2x Cubic
16 y2z Cubic
17 z2x Cubic
18 z2y Cubic
19 xyz Cubic
The bias field is modelled as the value of the polynomial function plus 1.0, which is then used as a multiplier of the image intensities.

An example of the format of a .ucp file written to disk is shown below:

  

# Uniformity correction parameters written on "10 Jan 2014 18:10:07.720 GMT+00:00" by Operator ID "xinapse"
# Vendor="Xinapse_Systems_Limited"
# Build version="8.0_1"
# Image source="/home/xinapse/T1Head"
# Corrected image="/home/xinapse/T1Head.corr"
Order=Linear
Odd-even=true
Parameters=[2.056020E-4][1.107604E-4][-1.472185E-4][3.925354E-4]

  
Jim Home