- Use the "imread" function to read the original TIFF file and extract the first page's "GPSInfo" metadata using a library like the "Tiff" class.
- Apply the necessary normalization
- Use the imwrite function to create a new TIFF file for the normalized images.
- After writing each normalized image to the new TIFF file, use a custom function to add the "GPSInfo" metadata to the first page of the new TIFF file.
manipulating multipage TIFF file
10 ビュー (過去 30 日間)
古いコメントを表示
I have a geo-refenreced TIFF file with 14 pages corresponding to 14 wavelengths. I want to normalize the image at each wavelength and create a new TIFF file with the normalized images. So far no problem. My problem is that the first page in my original TIFF includes a field called "GPSInfo" that I need to pass along to the new TIFF file. Imwrite does not seem to support the inclusion of such information in a TIFF file. Any suggestions?
Thanks
0 件のコメント
回答 (1 件)
Dheeraj
2023 年 9 月 6 日
Hi,
Writing custom metadata like "GPSInfo" you can use a combination of functions from the MATLAB File Exchange and the built-in functions as "imwrite" does not support the inclusion of such information in a TIFF file.
for i = 1:14 %Iterating through all pages
% Create a new file with normalised images, let it be newNormalisedPage
% Add "GPSInfo" metadata to the first page of the new TIFF file
if i == 1
new_tiff = Tiff( newNormalisedPage , 'r+');
new_tiff.setTag('GPSInfo', gps_info);
new_tiff.close();
end
end
Also refer to https://in.mathworks.com/help/matlab/ref/imwrite.html?searchHighlight=imwrite&s_tid=srchtitle_support_results_1_imwrite for better understanding of imwrite capabilities.
参考
カテゴリ
Help Center および File Exchange で Image Data についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!