![]() |
![]() |
![]() |
Creating a mosaic with an auxiliary file
For those who prefer working with ASCII image lists when creating mosaics, or for those creating mosaics with non-georeferenced images, MrSID Geo allows mosaics to be generated through the use of auxiliary (AUX) files. An auxiliary file is an ASCII image list that can be added to the InBox and encoded as an ordinary mosaic. Three scenarios exist for creating mosaics using auxiliary files:
- Images with georeferencing
- Images without georeferencing
- Georeferenced and non-georeferenced images together
The individual input tiles of an AUX mosaic cannot be cropped.
The output image from an auxiliary file mosaic is written to the directory where the auxiliary file is located. This file is given the same name as the auxiliary file, with a .sid extension.
The auxiliary file can be given any name. To be recognized when using the AUX Files (*.txt) option in the Open dialog box, the file must have a .txt extension. To select an auxiliary file with a different extension, select the All Files (*.*) option.
To add an auxiliary file with a .txt extension:
- Use one of the standard methods for opening a single file to activate the Open dialog box.
- Select AUX Files (*.txt) from the pull-down menu.
- Navigate to the text file which contains the image list and click OK.
- When the auxiliary file is added to the InBox, the Mosaic Type dialog box appears. Select the appropriate image type.
- Click OK.
A text file containing a list of all the images to be used in a mosaic can be obtained at the DOS command line using the
command. From the command line, navigate to the directory containing the images to mosaic. Run the following command:
dir dir /b *.tif >list.txt
The
command compiles a list of the filenames in the current directory; adding
dir tells the list to show the filenames only, with no extra information; *.img, *. tif (or *.jpg, *.bil, *.bip, *.doq, *.lan, depending on the image format) forces the command to look for only the image files you require. The
/b command writes this list out as a text file, named list.txt.
>list.txt By default, this text file is created in the directory containing the images.
Images with georeferencing
For georeferenced images (TIFF images with .tfw files, JPEG images with .jgw files, BIL, BIP, or BSQ images with supported .hdr files, LAN, GeoTiff, ERDAS IMAGINE, or USGS DOQ images), the text in the auxiliary file lists the images comprising the mosaic.
In the following example, a mosaic is created from four TIFF files: image_nw.tif, image_ne.tif, image_sw.tif, and image_se.tif.
First ensure that each image has an associated *.tfw file (the names of the corresponding files must match exactly, differing only in the .tfw file extension). This *.tfw file must be in the same directory as the file to which it refers.
A sample auxiliary file for this project is:
C:\maps\image_nw.tif
C:\maps\image_ne.tif
C:\maps\image_sw.tif
C:\maps\image_se.tif
When a text file is added to the InBox as an auxiliary file, the Mosaic Type dialog box appears, allowing specification of the type of image being encoded.
![]()
Select the correct image format and click OK. Because this example specified TIFF files with corresponding TIFF world files, the TIFF or GeoTIFF (TIFF) option is selected.
When presented with a list of images, MrSID Geo immediately looks for corresponding georeferencing information. The Input File Size and Target File Size reflect both the on-disk size of the source data, and the estimated output file size of the full mosaic. When encoded, the images are combined in a seamless mosaic based on the information given in the georeferencing files.
NOTE MrSID Geo does not recognize auxiliary files with spaces in either the listed file names or in the listed paths. In addition, the first line in the auxiliary file cannot be blank and the last line in the file must be followed by a carriage return.
Images without georeferencing
When creating a mosaic using images that lack georeferencing information, an auxiliary file must be created. In this case, the text file must list the file names and the upper left corner pixel location for each image. Each image must be listed based on the following format:
image_name x-pixel_location y-pixel_location
Only a single space is required between each of the three items in the list. Each image listed must be on a separate text line.
Base the upper left corner pixel location of each image on the location of the image relative to an x=0, y=0 pixel location of the upper left corner of the entire set of images.
Consider an example where a single image is being created from four separate scanned Sun Raster images, each 640 by 480 pixels in size.
The auxiliary file requires the following four lines:
image_nw.ras 0 0
image_ne.ras 640 0
image_sw.ras 0 480
image_se.ras 640 480
The first line in the auxiliary file must not be left blank.
The sample auxiliary file above joins the specified images as follows:
0,0image_nw.ras 640,0image_ne.ras 0,480image_sw.ras 640,480image_se.rasAs with georeferenced mosaics, when the auxiliary file is added to the InBox, the Mosaic Type dialog box appears, allowing specification of the type of image being encoded. Select the correct image format and click OK.
Georeferenced and non-georeferenced images together
You can also encode a mosaic of mixed georeferenced and non-georeferenced images using an auxiliary file.
When using an auxiliary file for a group of mixed georeferenced and non-georeferenced images, MrSID creates the mosaic providing that the x and y pixel resolution in the georeferencing of the input images is 1, -1. If the x and y pixel resolution for the input image is other than 1, -1, MrSID Geo generates an error message specifying that the input georeferenced images cannot be mosaicked due to an incompatibility in the x,y resolution of the input images.
For example, suppose you are mosaicking an input data set that contains 45 GeoTIFFS (georeferenced) and 5 TIFFS (not georeferenced). Instead of reverting back to the input images to generate georeferencing information for the 5 TIFF files, you can create an auxiliary (.txt) file that specifies the coordinates for these 5 files and points MrSID to the georeferencing information for the 45 georeferenced GeoTIFF files. The following example shows an auxiliary file where a georeferenced file will have the absolute path to the input tile and a non-georeferenced file will have the path and the x,y coordinates to position the image in the mosaic.
C:\maps\image_nw.tif
C:\maps\image_ne.tif
C:\maps\image_sw.tif 0 480
C:\maps\image_se.tif 640 480
This mosaic will be created successfully if lines one and four (the x and y pixel dimensions, respectively), in the .tfw world files for the georeferenced files are 1, -1. If these numbers have values other than 1, -1, MrSID Geo generates an error message that the x,y pixel dimensions are not consistent and MrSID Geo cannot perform this operation.
When using an auxiliary file to generate a mosaic, all images will be positioned relative to an x=0 y=0 pixel location in the upper left corner of the entire set of images.
If a group of georeferenced images is assigned an auxiliary file and new x,y coordinates, all input georeferencing information for the files will be overwritten by the coordinates provided in the auxiliary file.
![]() |