Contents || Index
11/15/2007

Note on Xray Map Data Type

back to the Tool

The pixel array of the simulated image is one of these three data types:

  1. Byte -  Value range is 0 - 255
  2. Integer - Value range is 0 - 65535
  3. Long integer (not implemented)  Values can exceed 65535.  I have not implemented this data type since root-n (the signal variability) is less than 0.4%.

Since low visibility usually implies low counts, most of the time the map will have byte pixels, which is the customary data type for black and white images.

For most cases, the data type of the map need not be specified.  You might want to specify integer for the data type, if the intensity for one or more objects is close to 255.  This is because the poisson noise added to the intensity (Actually, a random Poisson deviate is generated from the intensity) will result in occurances of values above 255, which will be clipped to 255, if the map array is a byte array, but which will have the proper values if the array is an integer array.

If you do not specify the optional data-type parameter in the "map" line of the input file, Lispix looks for the maximum intensity in the file, and makes the image with the appropriate pixel type.  This is OK for the noise-free map, but may not be OK for the map with Poisson noise, depending on whether or not any of the pixels exceed the 255 (or 65535) limit.  If any intensities of objects (or background) are close to, but less than the 255 (or 65535) limit, you may want to force the data type of the map to be word (or long integer) to accomodate all of the pixel values once noise is added.  On the other hand, you may not want to, if the number of clipped pixels is not significant.

Also, if the overlap-method is add then it is possible for objects that overlap to add their intensities together and exceed the map pixel data type (in which case Lispix will error out - Lispix does not check for this at present), or come close enough to the limit to cause clipping when Poisson noise is added.

For example where the number of clipped pixels is significant, consider the small map with a disc at the center, below.  The intensity of the disc is set to 255, so that when poisson noise is added, some of the values will exceed 255.  For the map with byte pixels, Lispix clips the larger values to 255.  This makes the disc look less noisy than it should, because the brighter gray levels have been clipped.  For the map with the integer pixels, the pixels have their proper values (10 - 313 in this case), and only a few pixels have the value 255.  The disc in this image looks more gray than its counterpart on the left, because the values have been scaled for display, so that 313 is bright white for the right image, while it is 255 for the left image.

   Data type not specified. Data type specfied as integer
input text file ;;; Sample disc in center of small map
map dimensions 200 200 background 30
disc position 100 100 radius 50 intensity 255
;;; Sample disc in center of small map
map dimensions 200 200 background 30 data-type integer
disc position 100 100 radius 50 intensity 255

maps displayed normally

values of 255 shown in red

Most of these pixels exceed 255, but have been clipped to fit in the byte array.

These pixels really are 255. Pixels not colored red are either less than 255 or greater than 255.