How can I read a single band, from a multi-band GeoTiff file?
9 次查看(过去 30 天)
显示 更早的评论
Hi, i have spent a lot of time to figure out how can i read only a specific band from a geoTiff file.
I have a GeoTiff file with a lot of bands and i need to import to my code, only one of them.
I tried:
imread( 'mybigdata.tif' , 3 );
%Error message : Invalid TIFF image index 3.
tiffreadVolume( 'mybigdata.tif' , 'PixelRegion' , { [1 1 inf] , [1 1 inf] , [3 3] });
%Error message Requested slice 3 is greater than the number of slices (1) in the volume.
if i use X = tiffreadVolume( 'mybigdata.tif' , 'PixelRegion' , { [1 1 inf] , [1 1 inf] , [1 1] });
Name Size Bytes Class Attributes
X 1698x1493x1x13 131825928 single
I can see the 13 bands in this example, in 4th dimension for some reason, but i dont know how to read only the one of them
if i use X = imread( 'mybigdata.tif' ); , the whole image is imported again:
Name Size Bytes Class Attributes
X 1698x1493x13 131825928 single
My tiff file was created using: geotiffwrite.
Any ideas?
Thanks in Advance.
0 个评论
回答(1 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!