Last modified: December 2013

Jump to: Description · Examples · Bugs · See Also

AHELP for CIAO 4.11 ChIPS v1


Context: images


Add or delete a channel from the image.


remove_image_channel(id, channel)

set_image_channel([id,] filename, channel)
set_image_channel([id,] numpy array, channel)
set_image_channel([id,] image array, nx, ny, channel)


The function arguments.

Argument Description
channel The red, green, blue, or alpha (opacity) channel. The valid arguments are: chips_red, chips_green, chips_blue, and chips_alpha.
filename The name of the image file to use; see add_image.
numpy array The image pixel values as a NumPy array; see add_image.
image array, nx, ny The image pixel values as an array and its size; see add_image.
id A ChipsId structure identifying the item.

The remove_image_channel command deletes the specifed channel from the image. This command can only be used with true color images; an error is returned if the images is pseudocolor.

A different channel filter can be loaded for the image with the set_image_channel command.


Example 1

chips> add_image("soft.fits", "med.fits", "hard.fits")
chips> remove_image_channel(chips_red)

Load three image files to create a truecolor image. Then remove the contribution of the red image, soft.fits, from the display.

Example 2

chips> image = read_file("input.fits")
chips> pixels = get_piximgvals(image)
chips> alpha = pixels * 0
chips> index = np.where(pixels > 0)
chips> alpha[index] = 1
chips> set_image_channel(alpha, chips_alpha)

An alpha filter is created based on the pixel values in the image "input.fits". The set_image_channel command is used to set the alpha channel in the current image.


See the bugs pages on the ChIPS website for an up-to-date listing of known bugs.

See Also

chips_helix, imextent
add_image, current_image, delete_image, display_image, get_image, hide_image, load_colormap, print_image, set_image, shuffle_image