フィルターのクリア

Does anyone know how to check if a tiff file is uint16 vs. int16?

5 ビュー (過去 30 日間)
Andrew Landau
Andrew Landau 2019 年 1 月 21 日
回答済み: Andrew Landau 2019 年 1 月 21 日
s = cast(rand(100),'int16');
u = cast(rand(100),'uint16');
saveastiff(s,fullfile(fpath,'s.tif'));
saveastiff(u,fullfile(fpath,'u.tif'));
Let's say I have those - if I use imread it can tell which one is signed and which is unsigned. I wrote my own tifreader that's much faster (using fread) but don't know how to figure out if the samples are signed vs. unsigned.
Most functions (imread, tiff.read()) do this inside compiled mex functions so I can't figure out where they check.
Thanks

採用された回答

Andrew Landau
Andrew Landau 2019 年 1 月 21 日
imfinfo returns a field called SampleFormat that describes the data type

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Import and Export についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by