setheadermax
This program will reset the global maximum in the header
of a 16 bit file to increase the number of significant
figures retained if the file is loaded by an 8 bit version of the AIR package.
It will also optionally identify the current header file type
(type 1, type 2, or
type 3) and the current header global maximum.
Warning: If you have moved data from a big-endian machine to a little-endian machine (e.g., from a Sun to a PC) or vice versa,
applying this program to the header file of such data will result in a failure to byte-swap
the image data when loading it into AIR and other programs that use the header information
to detect the need to byte-swap. You may be able to work around this problem by using the
AIR program reorient to make a copy of the data (which will
be fully byte-swapped during copying) and then applying this program the resulting header file.
setheadermax
filename
[max]
- where the following definitions apply:
-
- filename
- name of the 16 bit header file to be reviewed or altered
- max
- the maximum 16 bit pixel value represented in the file
setheadermax mri1
- Used without a maximum value, the program will indicate the current file type and
the current global maximum. Type 1 files with global
maxima less than 32767 will always be misidentified as
type 2 files. As long as the
global maximum truly is less than 32767, this misidentification is irrelevant because
the binary representation of numbers between 0 and 32767 is identical for type 1 and
type 2 data (assuming that your machine uses 2's complement representation of negative
values).
setheadermax mri1 18000
- This will set the header maximum value in file mri.hdr to 18000. When file mri1 is
loaded by an 8 bit version of any AIR program, the value 18000 will be mapped to an 8
bit pixel value of 255 and all lower values will be mapped proportionately. If there are
actual values greater than 18000, they will be incorrrectly mapped.
- This program will only modify the headers of
16 bit files
- You should never assign a global maximum in the header that is smaller than the
true global maximum of the file. Doing so will result in values greater than the
header global maximum being mapped incorrectly to values less than the header global
maximum.
- It is possible to interconvert type 1 and
type 2 files by changing whether the global maximum
is greater or less than 32767. This has no effect on files with all values in the range
0 to 32767 since binary representation of both file types is identical in this range
(assuming 2's complement representation of negative integers).
So long as you follow the rule of never assigning a global maximum in the header that is
smaller than the true global maximum of the file, you should not be able to generate any
errors.
- If your display package uses the header information, changing the header maximum
may alter the way that files are displayed. Specifically, lowering the global maximum
may make all of the pixels appear proportionately brighter.
- The only effect that changing the global maximum has with regard to the AIR package
is that is alters the way that 16 bit files are converted to when AIR has been compiled
for 8 bit internal representation. If you are using a 16 bit version of AIR, this program
is irrelevant.
- See the warning above regarding the use of this program on data that has been moved
from big-endian to little-endian machines or vice versa.
See also: Generic error messages
- setheadermax only modifies files with 16 bits/pixel; this file has ____ bits/pixel
-
- This program only works for 16 bit files
- value ____ is out of possible range for all header types
-
- supply a value in the appropriate range
Modified: July 22, 2002
© 2001-2002 Roger P. Woods, M.D.(rwoods@ucla.edu)