Image canvas window: "subtitle" infos from macro

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

Image canvas window: "subtitle" infos from macro

seb-7
Hi all,

Is there any macro command to get the "text line" which is displayed in
an image canvas just below the title (what I called a "subtitle")?

here is the screen capture of what I improperly called subtitle...
http://xfer.curie.fr/get/dFa1ZfXZYEX/subtitle.jpg

I thought I could get it with getMetadata but obviously I'm wrong.
(I would like to use it write a set of macros to log selections
coordinates and associated channel using the Image5D plugin also)

Thanks!

sebastien
Reply | Threaded
Open this post in threaded view
|

Re: Image canvas window: "subtitle" infos from macro

Wayne Rasband
Starting with ImageJ 1.38m, macros can get the subtitle of the current
image using

     subtitle = getImageInfo("subtitle");

Unfortunately, this will not work as expected with Image5D until
Joachim updates it to override the new createSubtitle() method in the
ImageWindow class.

-wayne

On Mar 8, 2007, at 5:24 PM, seb wrote:

> Hi all,
>
> Is there any macro command to get the "text line" which is displayed
> in an image canvas just below the title (what I called a "subtitle")?
>
> here is the screen capture of what I improperly called subtitle...
> http://xfer.curie.fr/get/dFa1ZfXZYEX/subtitle.jpg
>
> I thought I could get it with getMetadata but obviously I'm wrong.
> (I would like to use it write a set of macros to log selections
> coordinates and associated channel using the Image5D plugin also)
>
> Thanks!
>
> sebastien
>
Reply | Threaded
Open this post in threaded view
|

Re: Image canvas window: "subtitle" infos from macro

ctrueden
In reply to this post by seb-7
Hi Sebastien,

I do not believe there is a method to directly obtain this
information, because it is assembled on the fly. For normal ImageJ
windows, the subtitle is assembled in the
ij.gui.ImageWindow.drawInfo(Graphics) method from several sources. You
could, however, copy that method into your own program to generate the
string (or a variant thereof) yourself.

For Image5D, the string is generated in the
i5d.gui.Image5DWindow.drawInfo(Graphics) method, which is similar to
the regular ImageJ version, but with the extra dimensional information
inserted as well.

Another option is that for single ImagePlus objects, you can use
ImagePlus.getTitle() to get the "label" string, which is what appears
in parentheses in the subtitle. There is a corresponding macro command
"getTitle" that does this in a macro. For ImageStacks, you can use
ImageStack.getSliceLabel(int) or ImageStack.getSliceLabels() to get
the label string for each individual slice. I do not know if there is
a macro command corresponding to the getSliceLabel methods.

Lastly, if you read your data with the Bio-Formats Importer plugin,
the slice labels are set to contain the dimensional information
(channel, focal plane and timepoint).

-Curtis

On 3/8/07, seb <[hidden email]> wrote:

> Hi all,
>
> Is there any macro command to get the "text line" which is displayed in
> an image canvas just below the title (what I called a "subtitle")?
>
> here is the screen capture of what I improperly called subtitle...
> http://xfer.curie.fr/get/dFa1ZfXZYEX/subtitle.jpg
>
> I thought I could get it with getMetadata but obviously I'm wrong.
> (I would like to use it write a set of macros to log selections
> coordinates and associated channel using the Image5D plugin also)
>
> Thanks!
>
> sebastien
>