Login  Register

Re: Adding Filenames to images in a video

Posted by Rasband, Wayne (NIH/NIMH) [E] on Jan 19, 2014; 6:43pm
URL: http://imagej.273.s1.nabble.com/Adding-Filenames-to-images-in-a-video-tp5006173p5006182.html

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