Main Content

nitfread

Read image from NITF file

Description

X = nitfread(filename) reads the first image from the National Imagery Transmission Format (NITF) file specified by filename.

example

X = nitfread(filename,idx) reads the image with index number idx from an NITF file that contains multiple images.

X = nitfread(___,'PixelRegion',regions) additionally specifies regions of the image to be read from an NITF file.

Examples

collapse all

To run this example, replace the name of the file with the name of an NITF file on your system. You can find sample NITF files on the web.

Read the second image from an NITF file containing multiple images. The example reads a subset of the image data starting at (row,column) location (100, 200), reading every other value until location (105, 205).

subsec = {[100 2 105],[200 2 205]}

ntfdata = nitfread('your_file.ntf',2,'PixelRegion',subsec);

Input Arguments

collapse all

Name of the NITF file, specified as a character vector. The file must be in the current folder or in a folder on the MATLAB® path, or filename must contain the full path to the file.

Data Types: char

Index number of the image in the NITF file, specified as a positive integer.

Data Types: double

Regions of image to be read from the NITF file, specified as a 2-column cell array. The first column specifies row indices and the second column specifies column indices of the regions. Each element in the cell array is a 2-element vector of positive integers of the form [start stop] or a 3-element vector of positive integers of the form [start increment stop].

Example: {[100 150],[200 250]} — read pixels starting at row/column location (100, 200) and ending at location (150, 250)

Example: {[100 2 150],[200 2 250]} — read every other pixel starting at row/column location (100, 200) and ending at location (150, 250)

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | cell

Output Arguments

collapse all

Image data from the NITF file, returned as a numeric array.

Tips

  • nitfread supports version 2.0 and 2.1 NITF files, and NSIF 1.0 files. Image submasks and NITF 1.1 files are not supported.

Extended Capabilities

Version History

Introduced in R2007b

expand all