Re: saving and accessing tiff tags currently unused by ImageJ
Posted by Gabriel Landini on May 01, 2010; 9:18am
URL: http://imagej.273.s1.nabble.com/saving-and-accessing-tiff-tags-currently-unused-by-ImageJ-tp3688437p3688439.html
On Saturday 01 May 2010, you wrote:
> 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.
The new tags, if you implement them, I guess will only by understood by other
programs if they know what they mean and what to do with them.
Without having to modify the tiff encoder/decoder, if you want these tags to
be used by other IJ macros or plugins, perhaps it would be enough to include
the info in the metadata (the "Info" key, we discussed this yesterday) rather
than the tiff header and include some tags or keys so you can later retrieve
their data by parsing the Info property (a string) retrieved via the
getMetadata macro command, the ImpProps plugin or javascript.
In that string you can include the title of the parent image and the
corresponding coordinates that your current image correspond to in the parent
image.
Michael Schmid kindly posted yesterday macro code to get those lists of tags.
The Info property is stored in the TIFF header and saved, but you can also add
other properties to the images that are set via the ImpProps plugin (these are
not saved) that can be used to pass data around between images and scripts
while the images are open.
I hope it helps.
G.