Support for multi page TIFF PAGENAME tags

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Support for multi page TIFF PAGENAME tags

Michael Ellis
I'm working with multi page TIFF files where each page has a PAGENAME (tag 285) stored in the page IFD. GraphicConverter finds and displays these page tags correctly but ImageJ does not.

Looking at TiffDecoder.java it's clear that the PAGENAME tag is not supported, however there is support for channel names within the ImageJ proprietary META_DATA tag.

I tried to have a stab at picking up the PAGENAME tags by adding the this code to TiffDecoder

--- class TiffDecoder ---
        public static final int PAGENAME = 285; //MPE

--- TiffDecoder.OpenIFD() ----
case PAGENAME: //MPE
        {
        String pageName = bytes != null ? new String(bytes) : null;
        if (fi.sliceLabels == null)
                fi.sliceLabels = new String[] {pageName};
        }
        break;

--- TiffDecoder.OpenIFD .getName() ---
        case PAGENAME: // MPE
                name = "PageName";
                break;
---------------------------------

This does indeed pickup the PAGENAME strings, but from there on, I can see no obvious way of having ImageJ honour them.

I tried to emulate how the META_DATA tag was being handle by creating an array of all the PAGENAME strings from each of the individual FileInfos generated and storing them with the first Fileinfo, and setting fi[0].nImages to the number of pages but that caused subsequent reading of the image data to e corrupted.

Can anyone suggest a possible solution having ImageJ honour TIFF PAGENAME tags?

Although the PAGENAME tag, if not common place, it is at least part of the TIFF standard. It also seems reasonable, that since (in the absence of ImageJ META_DATA tag)  individual COLOR_MAPS stored in the IFDs are utilised when a multipage TIFF is read and converted to a Composite image,  then, is there any reason why the PAGENAME could not also be picked up too (again providing priority to any ImageJ META_DATA sliceLables where present)?


Michael Ellis
Digital Scientific UK Ltd.