setheadermax


Purpose:

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.

The program will also identify the current header file type (type 1, type 2, or type 3) and the current header global maximum.


Usage:

setheadermaxfilename [max]

where the following definitions apply:

filename
name of the 16 bit header file to be reviewed or altered (.hdr or .img optional)
max
the maximum 16 bit pixel value represented in the file
NOTE:
If no max is specified, the program will identify the current file type and global maximum

For type 1 16 bit files, legal values for max range from 1 to 65535

For type 2 16 bit files, legal values for max range from 1 to 32767

For type 3 16 bit files, legal values for max range from -32767 to 32767


Examples:

setheadermax mri1

setheadermax mri1 18000


Comments:


Error messages: (alphabetical)

See also: Generic error messages

____ only modifies files with 16 bits/pixel...
  • According to the header file (.hdr file), the file that you have specified does not have 16 bits/pixel.
  • If the header file is wrong, use scanheader to review its contents and then makeaheader to generate a corrected header.
this file's type cannot be evaluated
  • The file that you have specified has a header minimum less than -32768, a header maximum greater than 65535, or the difference between the header maximum and the minimum exceeds 65535.
  • Use scanheader to review the global maximum and minimum in the header.
  • You should remake a corrected header using makeaheader.
Type 1 files cannot have negative maxima ...
  • The header of the file specified is judged to be a type 1 file based on a current header global maximum of greater than 32767. You have requested that the global maximum be set to a negative value. Only type 3 files can have negative header global maxima.
  • If this is actually a type 3 file, you need to remake the header using makeaheader. It is a good idea to review the current values first using scanheader.
Type 2 files cannot have negative maxima ...
  • The header of the file specified is judged to be a type 2 file based on a current header global minimum of greater than 0. You have requested that the global maximum be set to a negative value. Only type 3 files can have negative header global maxima.
  • If this is a type 3 file, you will need to remake the header using makeaheader. It is a good idea to review the current values first using scanheader.
Type 3 files cannot have maxima greater than 32767...
  • The header of the file specified is judged to be a type 3 file based on a current header global minimum 0. You have requested that the global maximum be set to a value greater than 32767 which is accessible only to type 1 files).
  • If this is a type 1 file, you will need to remake the header using makeaheader. It is a good idea to review the current values first using scanheader.
value ___ is out of range for all possible header types
  • You have requested a header global maximum greater than 65535 which is inaccessible with 16 bit data.
WARNING: You have converted a type 1 file to a type 2 file...
  • Don't panic, as long as you have followed the rule about not setting the header global maximum to a value less than the true global maximum, you can ignore this warning. The header maximum was previously greater than 32767 indicating that the file must be type 1. Now the header global maximum is less than 32768, indicating a type 2 file. If the value that you have given is truly the global maximum, then this conversion will have no effect.
  • If the true global maximum is greater than this value, review the comments section and reset the global maximum back to the correct value (if the correct value is greater than 32767, you will get the next warning message when you reset the value.
WARNING: You have converted a type 2 file to a type 1 file...
  • Unless you are deliberately trying to recover from a previous incorrect use of this program, you probably will want to undo what you just did. If the file really was a type 2 file to start with, raising the header global maximum will result in even fewer significant bits in your 8 bit representation than you would have with a global maximum of 32767, so set it back to this value or lower. As an additional incentive to set it back, don't forget that any numbers that were previously negative and therefore not defined and ignored have now become huge (greater than 32767) positive numbers. Setting the value back below 32767 will automatically evoke the preceding error message.


See also:


Modified: December 11, 1996

© 1995-6 Roger P. Woods, M.D.(rwoods@ucla.edu)