**PURPOSE**- Applies contrast stretching to an image/volume. Example.

**SEE ALSO****CE FIT**[Contrast Enhancement - FIT the histogram] **CE HI**[Contrast Enhancement - Histogram Equalization] **CE LAH**[Contrast Enhancement - Local Area Histogram] **TH**[Threshold - Set pixels above/below Threshold to Threshold] **HI**[Histogram - output in Results file] **AR SCA**[Arithmetic scaling of image]

**USAGE**- .OPERATION: CE ST

- .INPUT FILE: PIC001

[Enter name of image to be processed.].OUTPUT FILE: PIC002

[Enter name of file receiving the output image.].SINGLE, AUTOMATIC OR DOUBLE MAPPING? (S/A/D): S

[Option 'S' for single mode stretching (= normal mode)

The contrast is linearly stretched between bottom and top density specified. These values can be determined from a histogram output (see 'HI').Option 'A' for automatic single mode stretching.

The contrast is linearly stretched between bottom and top density. These values are determined from an integral threshold specification in the following way: the integrals over the histogram from the right- and left-hand sides are compared with a specified fraction of the total histogram area (= total number of points). The bottom and top densities are defined as the density values where the left- and right-hand integrals, respectively, become equal to the specified fraction.Option 'D' for Double mode stretching.

The contrast is linearly stretched in two sections of the histogram specified by BOTTOM1, TOP1, BOTTOM2, TOP2.] - If 'S' (Single) SPIDER asks:

.BOTTOM DENSITY VALUE: .5

[Enter density value that is to be mapped to 0.0].TOP DENSITY VALUE: 1.2

[Enter density value that is to be mapped to 2.0][The contrast stretched image will then be computed and put into PIC002. The density, mapping function, and the histograms before and after stretching will be printed out.]

- If 'A' (Automatic) SPIDER asks:
.INTEGRAL THRESHOLD PERCENT: .5

[Enter percentage of total histogram area to be used for definition of top and bottom density.].PRINT RESULTING HISTOGRAM (Y/N): Y

[Indicate if the histogram of the stretched image is to be computed and printed out.][The contrast stretched image will then be computed and put into PIC002. The following info will be printed out: 1. The histogram before stretching, if this is newly computed.

2. The density mapping function.

3. The histogram after stretching if this option is chosen.

- If 'D' (Double Mapping) SPIDER asks:
.BOTTOM1: 0.1

[Enter density value of first lobe to be mapped into 0.].TOP1: 0.3

[Enter density value of first lobe to be mapped into 2.].BOTTOM2: 0.6

[Enter value of second lobe to be mapped into 0.].TOP2: 0.8

[Enter value of second lobe to be mapped into 2.][SPIDER checks if BOTTOM1 < TOP1 < BOTTOM2 < TOP2. If the values are not ordered in this way, an error message will be printed out. As in A.1. and A.2., the contrast stretched image will then be computed and put into PIC002. The density mapping function and the histograms before and after stretching will be printed out.]

**SUBROUTINES**- ENHANC, GRAPHS, EHIST, HIST

**CALLER**- UTIL2

© Copyright Notice / Enquiries: spider@wadsworth.org