Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 1488
News FAQ
Search Home


next up previous contents index
Next: image.boundingbox - Function Up: image - Tool Previous: image.addnoise - Function


image.convolve - Function



Package general
Module images
Tool image


Convolve image with a Glish array or another image


Synopsis
convolve(outfile, kernel, scale, region, mask, overwrite, async)


Arguments

outfile in Output image file name
    Allowed: String
    Default: unset
kernel in Convolution kernel - array or image filename
    Allowed: Numeric Glish array or string
scale in Scale factor
    Allowed: Float
    Default: Autoscale
region in Region of interest
    Allowed: Region tool
    Default: Whole image
mask in OTF mask
    Allowed: Boolean LEL expression or mask region
    Default: None
overwrite in Overwrite (unprompted) pre-existing output file ?
    Allowed: T or F
    Default: F
async in Run asynchronously?
    Allowed: Bool
    Default: !dowait


Returns
Image tool or fail



Description

This function does Fourier-based convolution of an image file by the given kernel.

If outfile is given, the image is written to the specified disk file. If outfile is unset, the Image tool is associated with a temporary image. This temporary image may be in memory or on disk, depending on its size. When you destroy the Image tool (with the done function) this temporary image is deleted.

The kernel is provided as a multi-dimensional Glish array or as the filename of a disk-based image file. The provided kernel can have less dimensions than the image being convolved. In this case, it will be padded with degenerate axes. An error will result if the kernel has more dimensions than the image. No additional scaling of the kernel is provided yet.

The scaling of the output image is determined by the argument scale. If you leave it unset, then the kernel is normalized to unit sum. If you do not leave scale unset, then the convolution kernel will be scaled (multipled) by this value.

Masked pixels will be assigned the value 0.0 before convolution.

The output mask is the combination (logical OR) of the default input pixel mask (if any) and the OTF mask. Any other input pixel masks will not be copied. Use function maskhandler if you need to copy other masks too.

See also the other convolution functions convolve2d, sepconvolve and hanning.



Example
- dowait := T
- r1 := drm.quarter()
- im := image('pks1333-33.6cm')
- kernel := mykernel(...)                          # Your code to generate the kernel
- im2 := im.convolve(kernel=kernel, region=r1)     # Makes temporary image
-
- im3 := im.convolve (kernel=im.name(F))           # Convolve by self





next up previous contents index
Next: image.boundingbox - Function Up: image - Tool Previous: image.addnoise - Function   Contents   Index
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc., Washington, D.C.

Return to AIPS++ Home Page
2006-08-01