MATLAB Answers

How can I get filenames for individual images in a multi-page tiff stack?

5 ビュー (過去 30 日間)
Charlene Zhi Lin Ong
Charlene Zhi Lin Ong 2019 年 9 月 4 日
コメント済み: Neuropragmatist 2019 年 9 月 6 日
Hi all,
I am having trouble figuring out how to recover the original file names of the images in a multi-page tiff stack. I am able to see the filenames of the individual images in ImageJ (Beside the counter for the number of images). However, I am clueless how to recover the filenames from Matlab. I need to match the image to the corresponding data, hence I need its original filename.
Thank you!
Cheers,
Charlene

  0 件のコメント

サインインしてコメントする。

回答 (2 件)

Neuropragmatist
Neuropragmatist 2019 年 9 月 4 日

  4 件のコメント

表示 1 件の古いコメント
Neuropragmatist
Neuropragmatist 2019 年 9 月 4 日
OK, can you upload a sample of one of your files?
Charlene Zhi Lin Ong
Charlene Zhi Lin Ong 2019 年 9 月 4 日
Hi Metioche,
I can't unfortunately due to confidentiality issues. But thank you for the information and I will look into that! Thank you so much both of you for your help!;)
Neuropragmatist
Neuropragmatist 2019 年 9 月 6 日
You could make a dummy file that just contains random data or blank images? Unless you don't have access to the image source.
All we really want to see is the file structure not the contents.
M.

サインインしてコメントする。


Guillaume
Guillaume 2019 年 9 月 4 日
Probably with:
filepath = 'C:\somewhere\somefile.tiff'
infos = imfinfo(filepath); %should return a Px1 structure where P is the number of pages
pagenames = {infos.Filename} %you don't have to extract the field into a cell array.

  3 件のコメント

Charlene Zhi Lin Ong
Charlene Zhi Lin Ong 2019 年 9 月 4 日
Hi Guillaume,
Thanks for your quick reply!
So this doesn't work, I have tried it, the pagenames for all the individual images are the same as the name of the multi-page tiff stack. What I will be looking for is the filename of the individual page.
Thank you so much for helping, really appreciate it!
Guillaume
Guillaume 2019 年 9 月 4 日
Have a look at the other fields of the structure infos, then. The information you're looking for may be in another field.
Otherwise, you may be able to get the information you need by using matlab's direct interface to the libtiff library: Tiff. Unfortunately, that requires good familiarity with the details of the tiff format. A multipage tiff is a tiff file with multiple image file directories (IFD) so you would have to navigate the directories to get at the metadata of each.
If you need help with that we would need a sample multipage image. The actual image content is irrelevant so if you can generate one with no confidential information, you could upload it.
Charlene Zhi Lin Ong
Charlene Zhi Lin Ong 2019 年 9 月 5 日
Hi Guillaume,
Yes I checked other fields too and I can't find it. Sure I will look into the Tiff format! About the sample multipage tiff file, I think I could try generating one of my own and playing around with it, and if I manage to sort it out, I will also post for the community=)

サインインしてコメントする。

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by