Login  Register

RE: Adding Filenames to images in a video

Posted by haraldverbraak on Jan 20, 2014; 9:16am
URL: http://imagej.273.s1.nabble.com/Adding-Filenames-to-images-in-a-video-tp5006173p5006190.html

Hi Wayne,

 

Thanks for the macro.

 

ImageJ is giving an error in this macro that is associated with “Overlay.setPosition(i)”, though.

 

I cannot figure out what causes the error. Have you seen this before?

 

Regards,

Harald

 

From: Rasband, Wayne (NIH/NIMH) [E] [via ImageJ] [mailto:ml-node+[hidden email]]
Sent: Sunday, January 19, 2014 7:45 PM
To: Harald Verbraak
Subject: Re: Adding Filenames to images in a video

 

On Jan 17, 2014, at 6:03 PM, haraldverbraak wrote:

> Dear all,
>
> I am making a video of a stack of images by clicking File>Import>Image
> Sequence.
>
> Now I want to add the filename to each of these images in the video, but I
> do not know how I can do this.

Here is a macro that adds file names to a stack of images imported using File>Import>Image Sequence.

-wayne

  setFont("SansSerif", 14);
  setColor("white");
  Overlay.remove;
  for (i=1; i<=nSlices; i++) {
     setSlice(i);
     name = getMetadata("Label");
     index = indexOf(name, "\n");
     if (index>0)
        name = substring(name, 0, index);
     Overlay.drawString(name, 5, 20);
     Overlay.setPosition(i);
  }
  Overlay.show;

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html


If you reply to this email, your message will be added to the discussion below:

http://imagej.1557.x6.nabble.com/Adding-Filenames-to-images-in-a-video-tp5006173p5006182.html

To unsubscribe from Adding Filenames to images in a video, click here.
NAML


-- The information contained in this communication and any attachments is confidential and may be privileged, and is for the sole use of the intended recipient(s). Any unauthorized review, use, disclosure or distribution is prohibited. Unless explicitly stated otherwise in the body of this communication or the attachment thereto (if any), the information is provided on an AS-IS basis without any express or implied warranties or liabilities. To the extent you are relying on this information, you are doing so at your own risk. If you are not the intended recipient, please notify the sender immediately by replying to this message and destroy all copies of this message and any attachments. ASML is neither liable for the proper and complete transmission of the information contained in this communication, nor for any delay in its receipt.