StrataQuest Home › StrataQuest Glossary › Image Data Operations
BOM Group

Image Data Operations

Convert, extract, mask and assemble image data

View
Definition
The Image Data group of the Basic Operations Module holds six utilities. Convert 16-bit to 8-bit scales the interval between two limits onto 0–255. Extract channel and Extract strongest channel take one channelLoading... from a 3-channel image. Set channels to RGB and Swap channels build or reorder one. Mask keeps the pixels under a maskLoading...'s white part and sets the rest to a value you choose.
Six utility operations
Bit depth, channels, masking, RGB assembly
Bit-depth conversion
Two limits choose the 16-bit interval kept
Channel manipulation
Extract, swap and reassemble three channels
Masking
Pixels outside the mask get a chosen value

Operations Reference

OperationInputsDescription
Convert 16-bit to 8-bit16-bit grayscale image; Lower limit; Upper limitScales the pixel values of the 16-bit image and converts them to 8-bit, using the interval from Lower limit (the darkest relevant intensity) to Upper limit (the brightest, leaving out unwanted overexposed areas). The result is an 8-bit grayscale image.
Extract channel3-channel image; Channel index (default 1)Outputs the channel at Channel index as a single-channel image. The reference's example extracts the green channel, the 2nd, from a brightfield RGB image.
Extract strongest channel3-channel imageOutputs the one channel with the highest average intensity, as a grayscale image. The color space of the input doesn't matter.
MaskImage; Mask; Value (on black) (default 0)Keeps the pixels under the white part of the mask and sets the pixels under the black part to Value (on black). In the reference's example a color image stays color.
Set channels to RGBChannel - Red, Channel - Green, Channel - Blue (three grayscale images)Copies the three grayscale images into the red, green and blue channels of one RGB image.
Swap channels3-channel image; Channel 1, Channel 2, Channel 3Changes the channel order. Each setting names the input channel index copied to that output channel. The reference's example swaps red and blue.

Two of these are easy to misread. Extract strongest channel doesn't work pixel by pixel. It averages each channel over the whole image, picks the brightest on average, and returns that channel unchanged. And Mask doesn't have to write zeros: Value (on black) sets what replaces the masked-out pixels.

Source: StrataQuest 8.1 Engines Reference, ch. 6.5 (pp. 163–180).

Simplified

Convert 16-bit to 8-bit squeezes a chosen brightness range into 256 levels. Extract channel pulls out one color channel, and Extract strongest channel pulls out whichever channel is brightest on average. Mask blanks everything outside chosen areas. Set channels to RGB builds a color image from three channels, and Swap channels reorders them.

When to Use Which

Bit-Depth Conversion

Use Convert 16-bit to 8-bit when the next step needs 8-bit data. A 16-bit pixel can take 65,536 values and an 8-bit pixel 256, and the reference points out that most images use only part of the 16-bit range. Set Lower limit and Upper limit from the histogramLoading..., as the reference's example does, so the 256 levels cover the signal and not empty range. In imaging generally, any 16-to-8 conversion merges neighboring intensities, so it's worth keeping 16-bit data for measurement where you can; see bit depthLoading....

Channel Extraction

Use Extract channel when you know which channel holds your signal. Use Extract strongest channel when you want whichever channel is brightest on average. It never combines channels, and a different image can give a different winner, so check which channel it chose before you measure on it.

If what you want is the brighter of two signals at each pixel, extract both channels and take Max (every pixel)Loading.... In brightfield, an RGB channel isn't a stain; Color SeparationLoading... produces one image per marker instead.

Masking and Assembly

Apply Mask before any operation that should work on only one region. The mask is typically a CompareLoading... result or another mask built earlier in the same module. Set Value (on black) to something other than 0 when 0 would be mistaken for real signal downstream.

Use Set channels to RGB to rebuild a color view from three grayscale results; the reference's example reassembles a colon sample from its red, green and blue channels. Use Swap channels when channel order doesn't match what the next step requires, for example swapping red and blue. For the channel-by-channel details, see Image channel operationsLoading....

Simplified

Use Convert 16-bit to 8-bit when you need 8-bit data, choosing the range from the histogram. Use Extract channel to work with one channel, Mask to restrict later steps to chosen areas, and Set channels to RGB to build a color view for review.

Connected Terms

Share This Term
Term Connections