Import Text Image


The Import Text Image command reads into Mira an image in which the pixels are stored as ASCII text fields separated by "white space" (any sequence of tabs, spaces, and new-lines). This command can import "traditional" images that contain every pixel value as well as sparse images in which the values are not all of the possible pixel coordinates.

The file contents are assumed to consist of values separated by white-space (spaces, tabs, new lines). Each separated value is termed a "field", beginning with field number 1, then field 2, etc. Like the pixel values, the image parameters (columns, rows, etc.) may be read from fields in the file, or they may be specified directly.

The number of columns and rows and the image description can be read from the file or entered explicitly. The selection is made by clicking the bullet for Field# or Value for each parameter. For example, the number of image columns may be stored in field 3 (the 3rd field after the beginning of the file) or you may set it to a value like "256" if the image has 256 columns. The image description is also read from the file or entered manually. If read from the file, be careful that you count each word as a field unless the description string is quote-delimited, like "this is a quote delimited string". If the description is quote delimited, then the entire string inside the quotes is considered to be a single field.

Import Text Image Parameters

File

The file containing the image to import. Click the [...] button on the right side of the control to browse for the file.

Profile

The name of the parameter profile to apply. This sets the values of all command preferences except the File.

Columns

Specifies the number of columns.

Rows

Specifies the number of rows.

Description

Up to 68 characters of text describing the image. This is stored as an OBJECT keyword.

File Contains Quoted Strings

Check this option to interpret a multi-word description as a single field. The only way to load multi-word descriptions from the file is by using "" around the string. If this option is not checked, be sure to count each word as a field if it occurs before any other field.

Start at Field

Specifies the index of the first field containing pixel data, beginning with field 1. For example, if the pixel data begins at the second field in the file, enter 2.

Pixel Representation

Specifies the format of each pixel data field in the file. The file may contain a sequence of pixel values or each pixel may be specified along with its coordinates, such as column and row.

Pixel Coordinate Origin at (0,0)

Mira uses 1-based coordinates. If the file is formatted with the coordinate and value for each pixel, then Mira needs to know if the data were saved as pixel (1,1) at the image origin or pixel (0,0) at the image origin,

Extension

Specifies the file extension part of the file name. This controls whether the image is to be considered a FITS image or a TIFF image by Mira when you save it to a file.

Importing Sparse Images

By selecting the appropriate Pixel Representation option, this command can read images consisting of sequential pixel values or sparse images. The term "sparse" is taken from matrix terminology, and the image is considered a matrix of pixel values at (column,row) coordinates. A sparse image may be imported from a text file which contains coordinate information so that the pixel values may be assigned to their appropriate positions in the image matrix. To import an image as "sparse", you must select one of the Pixel Representations that includes the coordinate along with the pixel value. The imported sparse image will have a background matrix of 0-value into which is inserted the pixel values read from the file.

Related Topics

Import Binary Image, Export Text Image