Finding name of single frames when reading a Tiff stack file

조회 수: 8 (최근 30일)
bruno stricker
bruno stricker 2023년 8월 10일
댓글: Walter Roberson 2023년 8월 23일
I have a stack tiff file 'test.tif' where each frame has a name ('frame_A', 'frame_B', etc). How can I retrieve those names when reading in the .tif file?
I tried with
info = imfinfo('test.tif')
but unfortunately it does not solve the issue.
  댓글 수: 5
DGM
DGM 2023년 8월 22일
The most direct way to get an answer is to provide an example of the file you're working with.
The forum editor won't let you attach a TIFF, but you can zip it or append a fake extension.
bruno stricker
bruno stricker 2023년 8월 22일
Here is an example file. The names that i would like to detect, visible in ImageJ, are:
IMGP9827
IMGP9829
IMGP9830
IMGP9832

댓글을 달려면 로그인하십시오.

채택된 답변

Stephen23
Stephen23 2023년 8월 23일
편집: Stephen23 2023년 8월 23일
This is what GIMP found hidden amongst the EXIF data:
It looks like some tool has added some non-standard EXIF meta-data. Note that hidden amongst those digits are the character codes of IMGP9827, etc. No other EXIF tool I tried with that file could identify that non-standard meta-data.
Lets try with MATLAB:
unzip('test_stack.zip')
S = imfinfo('test_stack.tif')
S = 4×1 struct array with fields:
Filename FileModDate FileSize Format FormatVersion Width Height BitDepth ColorType FormatSignature ByteOrder NewSubFileType BitsPerSample Compression PhotometricInterpretation StripOffsets SamplesPerPixel RowsPerStrip StripByteCounts XResolution YResolution ResolutionUnit Colormap PlanarConfiguration TileWidth TileLength TileOffsets TileByteCounts Orientation FillOrder GrayResponseUnit MaxSampleValue MinSampleValue Thresholding Offset ImageDescription UnknownTags
S.UnknownTags % interesting, what are these hidden amongst the EXIF meta-data?
ans = 2×1 struct array with fields:
ID Offset Value
ans = [] ans = [] ans = []
S(1).UnknownTags.Value % aaahhh...
ans = 1×7
20 24 24 24 24 20 8
ans = 1×144
73 74 73 74 108 97 98 108 0 0 0 4 112 114 111 112 0 0 0 2 0 73 0 77 0 71 0 80 0 57
V = S(1).UnknownTags(2).Value % that looks promising...
V = 1×144
73 74 73 74 108 97 98 108 0 0 0 4 112 114 111 112 0 0 0 2 0 73 0 77 0 71 0 80 0 57
T = char(nonzeros(V).') % ignore null characters
T = 'IJIJlabl□prop□IMGP9827.JPGIMGP9829.JPGIMGP9830.JPGIMGP9832.JPGUniqueNametrue'
C = regexpi(T,'\w+\.JPG','match')
C = 1×4 cell array
{'IMGP9827.JPG'} {'IMGP9829.JPG'} {'IMGP9830.JPG'} {'IMGP9832.JPG'}
  댓글 수: 2
bruno stricker
bruno stricker 2023년 8월 23일
wow, thanks so much! It works like a charm!
Walter Roberson
Walter Roberson 2023년 8월 23일
I came to the same conclusion as @Stephen23 .
I was trying to figure out what the rule was for representing the file names when I got called away for the rest of the evening.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Walter Roberson
Walter Roberson 2023년 8월 22일
Individual TIFF frames do not have "names". If you were to read in a bunch of image files and combine them into a TIFF file, then the file names would not typically be stored.
The program that created the TIFF file might potentially have stored the names as Image Description https://www.awaresystems.be/imaging/tiff/tifftags/imagedescription.html or as Page Name https://www.awaresystems.be/imaging/tiff/tifftags/pagename.html or Copyright https://www.awaresystems.be/imaging/tiff/tifftags/copyright.html . Or as 9c9b XPTitle (Windows) or 9c9c XPComment (Windows) or 9c9f XPSubject (Windows)
At first File Source https://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/filesource.html seems plausible from the name, but it is a numeric tag with value 3 to indicate DSC (Digital Still Camera)

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

태그

제품


릴리스

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by