How can I read a single band, from a multi-band GeoTiff file?
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (1)
Voir également
Catégories
En savoir plus sur Import, Export, and Conversion dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!