rsetwrite

Create R-Set file from image file

Description

example

rsetfile = rsetwrite(filename) creates a reduced resolution dataset (R-Set) file from the specified input. The input file must be a TIFF or NITF image file. The function writes the generated R-Set file to the current working folder and has same file name as the input but with a rset extension.

rsetfile = rsetwrite(filename,rsetfilename) specifies the name of R-Set file using rsetfilename.

example

rsetfile = rsetwrite(adapter,rsetfilename) creates an R-Set file named rsetfilename from an ImageAdapter object, adapter. An ImageAdapter object is a user-defined object that provides rsetwrite function with a common API to read a particular image file format. For more details on ImageAdapter objects, see the ImageAdapter class.

Examples

collapse all

Load a TIFF image file into the workspace.

filename = 'mandi.tif';

Create an R-Set file from the image file. The function creates the R-Set in the current working folder.

rsetfile = rsetwrite(filename);

Display the R-Set file by using the imtool function.

imtool(rsetfile)

Zoom in on the R-Set by 65% to view the spatial tiles.

imtool(rsetfile,'InitialMagnification',65);

Load a file containing an ImageAdapter object into the workspace.

load('MandiImageAdapter.mat')

Specify a name for the R-Set file to be created.

rsetfilename = 'MandiRSet';

Create an R-Set file from the ImageAdapter object. The function creates the R-Set in the current working folder.

rsetfile = rsetwrite(adapter,rsetfilename)
rsetfile = 
'MandiRSet'

Display the R-Set file using the imtool function.

imtool(rsetfile)

Zoom in on the R-Set by 53% to view the spatial tiles.

imtool(rsetfile,'InitialMagnification',53)

Input Arguments

collapse all

Name of a TIFF or NITF image file, specified as a character vector or string scalar.

Data Types: char | string

Name for the output R-Set file, specified as a character vector or string scalar. If rsetfilename is not specified, filename sets the name of R-Set file, rsetfile.

Data Types: char | string

Image adapter object, specified as an ImageAdapter object.

Output Arguments

collapse all

Name of the R-Set file, returned as a string scalar. This value specifies the name of the file to which the R-Set is stored.

Algorithms

rsetwrite creates an R-Set by dividing an image into spatial tiles and resampling the image at different resolution levels. The R-Set file contains a compressed copy of the full-resolution image data. You can use the imtool function to open the R-Set file and zoom in to view the tiles at a higher resolution. When you zoom out, the function displays tiles at a lower resolution. In this way, an R-Set file balances clarity of the image and memory usage for optimal performance.

Note

  • When creating an R-Set, a progress bar shows the status of the completion. If you cancel the creation process before it is complete, the function does not create an R-Set and returns an empty rsetfile.

  • rsetwrite supports NITF image files that are uncompressed and Version 2.0 or higher. This function does not support NITF files with more than three data bands or with floating-point data. Images with more than one data band are accepted if they contain unsigned integer data.

  • You can create an R-Set from an image whose dimensions are smaller than the size of a single R-Set tile. But, the resulting R-Set file might be larger and take longer to load than the original file. The current size of a tile in an R-Set is 512-by-512 pixels.

Introduced in R2009a