saving and accessing tiff tags currently unused by ImageJ
Posted by Bill Christens-Barry on May 01, 2010; 1:48am
URL: http://imagej.273.s1.nabble.com/saving-and-accessing-tiff-tags-currently-unused-by-ImageJ-tp3688437.html
Frequently, I save both a cropped image and its uncropped parent. Later, I often want to precisely register the cropped version with its uncropped parent or some other image, for which I need to know the offsets between the two images. One way this could be done would be to write the needed x- and y-offsets in the header of the cropped image file, and then expose them for use when an image is opened.
There are several candidate tiff tags that seem suitable for this (e.g. x- and y-position tags, 286 and 287 respectively), but they aren't currently implemented in TiffEncoder or TiffDecoder. I'm wondering how I can use these tags so that the offset information can be utilized for registration in ImageJ and in other programs. In particular, if I modify the TiffEncoder source so that the tag information gets saved in a newly created cropped image file, what will happen if I open such an image file with a version of ImageJ that has not been modified? Will TiffDecode simply ignore this tag it knows nothing about?
Of course, such offsets in an image file are only meaningful in relation to some other file (one it is intended to be registered to), so I'll need to think through how to best make use of offset information. But for now, can anyone describe how this problem is usually approached or offer suggestions for how I should be thinking about it? Tiff tags 286 and 287 are in resolution (i.e. distance) units, while what I'd really like is to directly use pixel units; are other tiff tags more appropriate for this? Have I missed some existing capability in ImageJ that would facilitate this?
Thanks.
Bill