Re: tiff dumper

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

Re: tiff dumper

ctrueden
Hi Jonathan,

I really like your plugin, and I would like to use it to find the
> magnification tag in my SEM images and use that value to automatically set
> the scale. I don't know anything about java and a little about python. Is
> there an easy way to parse through the tags returned by tiff dumper to get
> the magnification value?
>

It should be straightforward to modify the plugin to do something else with
the key/value pairs that it prints in the dumpIFDs method. You could add
something like:

IJ.runMacro("Scale Bar...", "width=8 height=16 font=56 color=White
> background=None location=[Lower Right] bold");
>

(I got this line by using the Macro Recorder to record the command Analyze >
Tools > Scale Bar...)

But you would also need to define the physical calibration of the image
first. And knowing the lens magnification value is not sufficient to
determine the calibration, is it?

-Curtis

P. S. The Bio-Formats Importer plugin can parse the physical size of the
image from your file, and set it in the ImageJ properties, if it is present,
at which point you could then configure a scale bar. Would that solve your
problem?

P. P. S. I have CCed the ImageJ list in case anyone else has better advice,
and so that others can benefit from the discussion.

On Sat, Jul 24, 2010 at 6:27 PM, Jonathan Abbott <[hidden email]>wrote:

> I really like your plugin, and I would like to use it to find the
> magnification tag in my SEM images and use that value to automatically set
> the scale. I don't know anything about java and a little about python. Is
> there an easy way to parse through the tags returned by tiff dumper to get
> the magnification value?
>
> Thank you,
>
>
> Jonathan Abbott
> [hidden email]
>
> It's kind of fun to do the impossible.
>  - Walt Disney
>
>
Reply | Threaded
Open this post in threaded view
|

Re: tiff dumper

ctrueden
Hi Jonathan,

Nice script. As you note, the microscopy-specific metadata is all stored
under a custom TIFF tag, either 34680 for the S-FEG or 34682 for the Helios
NanoLab.

So the best way to proceed is for Bio-Formats to properly parse these tags
and populate the metadata accordingly. We have filed a ticket for this work
in our bug tracking system and CCed you, so you will receive emails
notifying you of any progress. For details, see:

  http://www.loci.wisc.edu/trac/java/ticket/526

In the meantime, your Python script is a good interim solution.
Unfortunately, I have no idea why invoking the Tiff Dumper first makes it
work—might be a bug or limitation in the plugin class loading logic?

-Curtis

On Fri, Jul 30, 2010 at 11:24 AM, Jonathan Abbott <[hidden email]>wrote:

> The attachement got scrubbed from my last post, here is a link to the file.
>
> http://dl.dropbox.com/u/4257156/Set_Scale_from_TIFF.py
>
>
> Jonathan Abbott
> [hidden email]
>
> It's kind of fun to do the impossible.
>   - Walt Disney
>
> On Jul 29, 2010, at 5:07 PM, Curtis Rueden wrote:
>
> Hi Jonathan,
>
> I really like your plugin, and I would like to use it to find the
>> magnification tag in my SEM images and use that value to automatically set
>> the scale. I don't know anything about java and a little about python. Is
>> there an easy way to parse through the tags returned by tiff dumper to get
>> the magnification value?
>>
>
> It should be straightforward to modify the plugin to do something else with
> the key/value pairs that it prints in the dumpIFDs method. You could add
> something like:
>
> IJ.runMacro("Scale Bar...", "width=8 height=16 font=56 color=White
>> background=None location=[Lower Right] bold");
>>
>
> (I got this line by using the Macro Recorder to record the command Analyze
> > Tools > Scale Bar...)
>
> But you would also need to define the physical calibration of the image
> first. And knowing the lens magnification value is not sufficient to
> determine the calibration, is it?
>
> -Curtis
>
> P. S. The Bio-Formats Importer plugin can parse the physical size of the
> image from your file, and set it in the ImageJ properties, if it is present,
> at which point you could then configure a scale bar. Would that solve your
> problem?
>
> P. P. S. I have CCed the ImageJ list in case anyone else has better advice,
> and so that others can benefit from the discussion.
>
> On Sat, Jul 24, 2010 at 6:27 PM, Jonathan Abbott <[hidden email]>wrote:
>
>> I really like your plugin, and I would like to use it to find the
>> magnification tag in my SEM images and use that value to automatically set
>> the scale. I don't know anything about java and a little about python. Is
>> there an easy way to parse through the tags returned by tiff dumper to get
>> the magnification value?
>>
>> Thank you,
>>
>>
>> Jonathan Abbott
>> [hidden email]
>>
>> It's kind of fun to do the impossible.
>>  - Walt Disney
>>
>>
>
>