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


next up previous contents index
Next: imagefromarray - Constructor Up: image - Tool Previous: imagecalc - Constructor


imageconcat - Constructor



Package general
Module images
Tool image


Construct an AIPS++ image by concatenating images


Synopsis
imageconcat(outfile, infiles, axis, relax, tempclose, overwrite)


Arguments

outfile in Output image file name
    Allowed: String
    Default: unset
infiles in List of input AIPS++ image files to concatenate; wild cards accepted
    Allowed: String or vector of strings
axis in Concatenation pixel axis
    Allowed: positive integer
    Default: Spectral axis if there is one
relax in Relax constraints that axis coordinate descriptors match
    Allowed: Bool
    Default: F
tempclose in Keep all lattices closed until needed
    Allowed: Bool
    Default: T
overwrite in Overwrite (unprompted) pre-existing output file ?
    Allowed: T or F
    Default: F


Returns
Image tool



Description

This constructor is used to concatenate two or more input AIPS++ images into one output image. For example, if you have two image cubes which are contiguous along one axis (say a spectral axis) and you would like to glue them together along this axis, then this constructor is the appropriate thing to use.

If outfile is given, the image is written to the specified disk file. If outfile is unset, the Image tool actually references all of the input files. So if you deleted any of the input image disk files, it would render this tool useless. When you destroy this tool (with the done function) the reference connections are broken.

The input and output images must be of the same dimension. Therefore, if you wish to concatenate 2-D images into a 3-D image, the 2-D images must have a third axis (of length unity) so that the output image coordinates are known along the concatenation axis.

The input images are concatenated in the order in which they are listed. Therefore, the Coordinate System of the output image is given by that of the first input image. The input images are checked to see that they are contiguous along the concatenation axis and an error is generated if they are not. In addition, the coordinate descriptors (e.g. reference pixel, reference value etc) for the non-concatenation axes must be the same or an error will result.

The input disk image files may be in native AIPS++, FITS, or Miriad formats. Look here for more information on foreign images.

The contiguous criterion and coordinate descriptor equality criteria can be relaxed by setting relax=T whereupon only warnings will be issued. Dimension and shape must still be the same though. When the concatenation axis is not contiguous (but still monotonically increasing or decreasing) and relax=T, a tabular coordinate will be used to correctly describe the axis. But be aware that it means adjacent pixels are not regularly spaced. However, functions like toworld and topixel will correctly interconvert world and pixel coordinates.

In giving the input image names, the infiles argument can be a single string if you wild card it with standard shell symbols. For example, infiles='cena_???.*', where the ``?'' represents one character and ``*'' any number of characters.

Otherwise, you must input a vector of strings such as infiles="cena1 cena2 cena3". An input such as infiles='files1,file2' will be interpreted as one string naming one file and you will get an error. The reason for this is that although the latter could be parsed to extract two file names by recognizing comma delimiters, it is not possible because an expression such as infiles='cena.{a,b}' (meaning files of name ``cena.a'' and ``cena.b'') would confuse such parsing (you would get two files of name cena.{a and b}.

You can look at the Coordinate System of the output image with summary to make sure it's correct.

The argument tempclose is, by default, True. This means that all internal reference copies of the input images are kept closed until they are needed. Then they are opened temporarily and then closed again. This enables you to effectively concatenate as many images as you like without encountering any operating system open file number limits. However, it comes at some performance loss, because opening and closing all those files takes time. If you are concatenating a smallish number of files, you might use tempclose=F. This will leave all internal reference copies permanently open, but performance, if you don't hit the file limit, will be better.



Example
- im := imageconcat(outfile='bigimage', infiles=''im1 im2 im3'', axis=3, relax=T, tempclose=F)
The image files im1, im2, and im3 are concatenated along the third axis to form the output image file bigfile. Only warnings are issued if axis descriptors mismatch. Access to the output image is provided via the tool called im.



Example
- im := imageconcat(infiles='$ADATA/cena*.1344')
All images whose file names begin with cena and terminate with .1344 that reside in the directory given by the translation of the environment variable $ADATA are concatenated along the spectral axis if there is one. The image must be contiguous along the spectral axis and all image coordinate descriptors must match. If there is no spectral axis an error will result. Because an output file name is not given, the Image tool just references the input files, it does not copy them.





next up previous contents index
Next: imagefromarray - Constructor Up: image - Tool Previous: imagecalc - Constructor   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