Open Samples question!

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

Open Samples question!

Sandro de Luelmo
Hi all ImageJ users!  Do anyone know if its possible to put your own pictures under File>Open Samples? Just to make it easier to find them and process them.
 
Regards
Sandro de Luelmo Lundquist
 
---------------------------------

Stava rätt! Stava lätt! Yahoo! Mails stavkontroll tar hand om tryckfelen och mycket mer! Få den på http://se.mail.yahoo.com
Reply | Threaded
Open this post in threaded view
|

Re: Open Samples question!

Wayne Rasband
> Hi all ImageJ users!  Do anyone know if its possible to put your own
> pictures under File>Open Samples? Just to make it easier to find them
> and process them.

There is no easy way to do this but what you can do is add a similar
menu to the tool bar. Adding the following macro code to
ImageJ/macros/StartupMacros.txt adds a menu to the tool bar that lists
the images in the SampleImages directory in your home directory. You
will need to be running ImageJ 1.38b or later.

   var imagesDir = getDirectory("home")+"SampleImages"+File.separator;
   var imageList = getImageList();
   var iCmds = newMenu("Images Menu Tool", imageList);

   macro "Images Menu Tool - C037T0b11IT4b09mTcb09g" {
        open(imagesDir +getArgument());
   }

   function getImageList() {
       list = newArray("'<home-dir>/SampleImages' directory not found");
       if (!File.exists(imagesDir))
            return list;
      else
          return  getFileList(imagesDir);
   }

-wayne