Create reduced resolution data set from image file
rsetfile = rsetwrite(File_Name)
rsetfile = rsetwrite(File_Name, output_filename)
rsetfile = rsetwrite(adapter, output_filename)
rsetfile = rsetwrite(File_Name), where File_Name is a TIFF or NITF image file, creates a reduced resolution data set (R-Set) from the specified file. The R-Set file is written to the current working directory with a name based on the input file name. For example, if File_Name is 'VeryLargeImage.tiff', rsetfile will be 'VeryLargeImage.rset'. If an image file contains multiple images, only the first one is used.
rsetfile = rsetwrite(File_Name, output_filename) creates an R-Set from the specified image file, using output_filename as the name of the new file. In this case, rsetfile and output_filename contain the same string.
rsetfile = rsetwrite(adapter, output_filename) creates an R-Set from the specified Image Adapter object, adapter. Image Adapters are user-defined classes that provide rsetwrite a common API for reading a particular image file format. See the documentation for ImageAdapter for more details.
Visualize a very large image by using an R-Set. Replace 'MyReallyBigImage.tif' in the example below with the name of your file:
big_file = 'MyReallyBigImage.tif'; rset_file = rsetwrite(big_file); imtool(rset_file)
Create R-Set files for every TIFF in a directory containing very large images. Put the R-Set files into a temporary directory:
d = dir('*.tif*'); image_dir = pwd; cd(tempdir) for p = 1:numel(d) big_file = fullfile(image_dir, d(p).name); rsetwrite(big_file); end
rsetwrite creates an R-Set file by dividing an image into spatial tiles and resampling the image at different resolution levels. When you open the R-Set file in the Image Tool and zoom in, you view tiles at a higher resolution. When you zoom out, you view tiles at a lower resolution. In this way, clarity of the image and memory usage are balanced for optimal performance. The R-Set file contains a compressed copy of the full-resolution data.
Because R-Set creation can be time consuming, a progress bar shows the status of the operation. If you cancel the operation, processing stops, no file is written, and the rsetfile variable will be empty.
rsetwrite supports NITF image files that are uncompressed and Version 2.0 or higher. It does not support NITF files with more than three bands or with floating point data. Images with more than one data band are OK if they contain unsigned integer data.
While it is possible to create an R-Set from an image where the dimensions are smaller than the size of a single R-Set tile, the resulting R-set file will likely be larger and take longer to load than the original file. The current size of an R-Set tile is 512 x 512 pixels.