Normalizing the Acquired Image Clause Samples
Normalizing the Acquired Image. The ‘AsFile’ method of the ‘AcqImage’ interface can also be used to ‘normalize’ acquired image data. For example, say an image is acquired which has minimum and maximum pixel values of 134 and 213 respectively. If this is saved as a 16-bit PNG file and then displayed in the Browser it will typically be seen as a completely black image. For display purposes the image can be ‘stretched out’, e.g. using the previous figures the minimum intensity value (134) will be mapped to 0 and the maximum intensity value (213) mapped to 65535 when saving as a normalized 16 bit image. This will allow the image to be easily displayed in a Browser without any processing in the client code (hint – such processing is JavaScript / VBScript is not straightforward). The normalize variation of ‘AsFile’ is illustrated by the following code fragment where the current acquired image is stored first as a PNG file exactly as it was acquired from the Microscope Server and then secondly it is stored as a normalized image. So the image will only be saved in normalized format if the optional third parameter is set to -1. And lastly, the normalize trick is of course available to all clients, not just Scripting clients. For a full example, see section CCD Acquisition and Display Example below.
