Processing math: 100%

NDF2TIFF

Converts an NDF to an 8-bit TIFF-6.0-format file.

Description:

This application converts an NDF to a Tag Image File Format (TIFF). One- or two-dimensional arrays can be handled and various methods of scaling the data are provided.

The routine first finds the brightest and darkest pixel values required by the particular scaling method in use. It then uses these to determine suitable scaling factors and converts the image into an 8-bit representation which is then output to a simple greyscale TIFF-6.0 file.

If the ‘high’ scaling value is less than the ‘low’ value, the output image will be a negative. Bad values are set to 0 for positives and 255 for negatives.

Usage:

ndf2tiff in out [scale] {low =?high =?percentiles =?[nbins =?]sigmas =?

Parameters:

HIGH = _DOUBLE (Read)
The array value that scales to 255 in the TIFF file. It is only required if SCALE is "Scale". All larger array values are set to 255 when HIGH is greater than LOW, otherwise all array values less than HIGH are set to 255. The dynamic default is the maximum data value. There is an efficiency gain when both LOW and HIGH are given on the command line, because the extreme values need not be computed. The highest data value is suggested in prompts.
IN = NDF (Read)
The name of the input NDF data structure (without the .sdf extension). The suggested default is the current NDF if one exists, otherwise it is the current value.
LOW = _DOUBLE (Read)
The array value that scales to 0 in the TIFF file. It is only required if SCALE is "Scale". All smaller array values are also set to 0 when LOW is less than HIGH, otherwise all array values greater than LOW are set to 0. The dynamic default is the minimum data value. There is an efficiency gain when both LOW and HIGH are given on the command line, because the extreme values need not be computed. The lowest data value is suggested in prompts.
MSG_FILTER = LITERAL (Read)
The output message filtering level, QUIET, NORMAL or VERBOSE. If set to verbose, the scaling limits used will be displayed. [NORMAL]
NUMBIN = _INTEGER (Read)
The number of histogram bins used to compute percentiles for scaling. It is only used if SCALE is "Percentiles". [2048]
OUT = _CHAR (Read)
The name of the TIFF file to be generated. A .tif name extension is added to any output filename that does not contain it. Any existing file with the same name will be overwritten.
PERCENTILES( 2 ) = _REAL (Read)
The percentiles that define the scaling limits. For example, [25,75] would scale between the quartile values. It is only required if SCALE is "Percentiles".

SCALE = LITERAL (Read)

The type of scaling to be applied to the array. The options, which may be abbreviated to an unambiguous string and are case-insensitive, are described below.
  • "Range" — The image is scaled between the minimum and maximum data values. (This is the default.)
  • "Faint" — The image is scaled from the mean minus one standard deviation to the mean plus seven standard deviations.
  • "Percentiles" — The image is scaled between the values corresponding to two percentiles.
  • "Scale" — You define the upper and lower limits between which the image is to be scaled. The application suggests the maximum and the minimum values minimum values when prompting.
  • "Sigmas" — The image is scaled between two standard-deviation limits.
["Range"]
SIGMAS( 2 ) = _REAL (Read)
Only required if SCALE is "Sigmas". The standard-deviation bounds that define the scaling limits. To obtain values either side of the mean both a negative and a positive value are required. Thus [-2,3] would scale between the mean minus two and the mean plus three standard deviations. [3,-2] would give the negative of that.

Results Parameters

SCAHIGH = _DOUBLE (Write)
The array value scaled to the maximum colour index for display.
SCALOW = _DOUBLE (Write)
The array value scaled to the minimum colour index for display.

Examples:

ndf2tiff old new
This converts the NDF called old (in file old.sdf) to the TIFF file called new.tif.
ndf2tiff horse horse pe
This converts the NDF called horse (in file horse.sdf) into a TIFF file horse.tif using percentile scaling. The user will be prompted for the percentiles to use.

Notes:

This application generates only 256 grey levels and does not use any image colour lookup table so absolute data values may be lost.

No compression is applied.

Related Applications

Convert: TIFF2NDF.