apply_map

PURPOSE

apply_map applies a map to an image, or a set of maps to a set of images.  For instance, it can be used to warp one image to match another image, given a pairwise map between those two images (which is generated by the register program).  It can also be used to generate an aligned stack of images, given a set of maps placing those images in absolute space (which are generated by the align program).  A third use is to generate a composite 2-D image from a set of images, given a set of maps placing those images in absolute space (which are again generated by the align program).

Although the input images can be resampled directly to the output image, it is also possible to supply an intensity map for each image (generated by gen_imaps), which provides a means to adjust the contrast and brightness in a smooth way across the image.  This can be used to reduce stitching artifacts caused by intensity variations in the component images.

TYPICAL USAGE

 apply_map -image_list  images.lst     \
-images images/ \
-masks masks/ \
-maps maps/ \
-output aligned_images/

COMMAND LINE OPTIONS

-black float_value

Sets the value in the input images that will turn into black (pixel value 1) in the output images

-compress

If specified, the output images will be compressed using the Adobe deflate compression with a horizontal differencing predictor

-image image_name

Only process the specified image name

-image_list images.lst

Specifies the file that contains the list of names of the images to apply the maps to.

-images directory/

Specifies the directory containing the input images.

-imap_scale float_value

Specifies the scale factor between the intensity maps and the images.  E.g., if the value is 4, the imaps are at one-quarter the resolution of the actual images..  Default value is 1.

-imaps directory/

Specifies the directory containing the intensity maps.  Intensity maps are used for gradually adjusting the brightness/contrast over an entire image.  Each pair of values in the intensity map sets the black/white levels at a particular position in the corresponding input image/

-label string

Requests that a label be included on the output image.  If all images are overlaid, then just the string is used as the label text; otherwise, the string is concatenated with the image name to form the label text.

-label_location widthxheight+offset_x+offset_y

Sets the width and height of the label and specifies the position of the upper left corner within the output image.

-map_scale float_value

Specifies the scale factor between the image maps and the images.  E.g., if the value is 8, the maps are at one-eighth the resolution of the actual images.  Default value is 1.

-maps directory/

Specifies the directory containing the map files.

-mask_scale float_value

Specifies the scale factor between the image masks and the images.  E.g., if the value is 8, the masks are at one-eighth the resolution of the actual images.  Default value is 1

-masks directory/

Specifies the directory containing the mask files.

-memory int_value

Specifies the maximum amount of memory in MB  to use while constructing the output image.

-output directory/

Specifies the directory where output images should be placed.

-overlay

requests that all images be overlaid into a single output image.

-pgm

requests that output images be written as .pgm files.  The default is .tif.

-reduction int_factor

requests that the output images be reduced in size by the specified factor.  This is useful when oversampling to avoid writing extremely large output files.

-region widthxheight+offset_x+offset_y

specifies that only the given region within the output image space should be generated and output.  All values are expressed in integral pixel units within the output image space.

-rotation float_rotation

specifies that the output image is to be rotated by the specified amount; this rotation is given in degrees and positive is counter-clockwise.  This transformation is actually applied to the maps before the actual rendering is done so that there is no resampling penalty when using this option.

-rotation_center float_x,float_y

specified the center of rotation when using the -rotation option.   The x and y values are coordinates within the output image space.

-source_map source.map

requests that a source map be written out to the specified file.  A source map allows one to identify what image was used as a source for a particular pixel within the output image.  Obviously, it would consume a lot of space to record this information for every pixel in the output image, so typically this is done for every 64th pixel in x and y (i.e., for only one out of 4096 pixels in the output image).  See the -source_map_level option for how to change this.

-source_map_level int_level

specifies the resolution level of the source map to be output.  This is the base 2 logarithm of the inteval between pixels.  For example, to have a grid point in the source map every 32 pixels, set this to 5.  The default value is 6.

-target_maps directory/

requests that a target map be written out within the specified directory for every source image.  The target map allows one to identify where a pixel in the source image got mapped to in the output image.  Obviously, it would consume a lot of space to record this information for every pixel in the source images, so typically this is done for every 64th pixel in x and y.  See the -target_maps_level option for how to change this.

-target_maps_level int_level

specifies the resolution level of every target map to be output.  This is the base 2 logarithm of the inteval between pixels.  For example, to have a grid point in the source map every 32 pixels, set this to 5.  The default value is 6.

-tile int_tile_widthxint_tile_height

requests that the output image be tiled and written out as individual tile files instead of as one large output file.  This is especially useful when the output image would be so large as to not fit into physical memory in the computer.  The width and height is expressed in pixels.   See also the -tree option.

-tree

If this option is given, then the tile files that are output are organized in a tree-style directory structure.  That is, each column of tiles is stored in its own subdirectory within the output directory.

-white float_value

sets the value in the input images that will turn into white (pixel value 255) in the output images

 

 

 

Copyright © 2020 National Center for Multiscale Modeling of Biological Systems. All Rights Reserved.