Reading image j header from tiff file info using matlab


#1

I cannot seem to locate where in the matlab tiff file or Tiff obect one can locate the overlay data supplied in the header. Any suggestions?


#2

Are you sure overlays are supplied in the header? I would have thought they would be supplied as their own slice.


#3

As mentioned in 3: Image Types: Lossy Compression and Metadata↑, overlays are saved in the header of tif images, and do not need to be saved externally when using TIFF, the default file format of ImageJ. The major advantages of overlays are summarized below:

from: https://imagej.nih.gov/ij/docs/guide/146-11.html


#4

I see. I have looked at some TIFFs I have with overlays. It looks like ImageJ uses the custom tag numbers 50838 and 50839 to store the information. It isn’t clear how it is encoded though. From what I can gather, 50838 is stored as a long and 50839 is stored as a byte. The number of 50838 tags appears to be the number of overlays plus 2 (for 40 or fewer overlays) or 3 (for more than 40 overlays).


#5

i had wondered about that… it seems that matlab does not recognize these particular tags. i found another individual with a question about getting matlab to recognize these tags which hadn’t gotten any responses. i am considering work arounds. thanks for the help!


#6

Yeah. Unfortunately, Matlab’s Tiff object class doesn’t provide full access/control; let alone access/control over custom tags. I believe (though I could be wrong) that they recently expanded the class’s capabilities but I haven’t upgraded to a new version in a while.