Login  Register

Re: Loading several images

Posted by Jan Eglinger on Jan 17, 2014; 3:24pm
URL: http://imagej.273.s1.nabble.com/Loading-several-images-tp5006154p5006155.html

Hi Francesco,

 >      I would like to write a plugin (not a macro) that read a whole
 > directory of images and process them in order to produce a single
 > image as a result.

you can use the following lines in Java:

     File dir = new File(dirpath);
     File[] list = dir.listFiles();
     for (File file : list) {
         /* do your processing here */
     }

For an example see the following small plugin I wrote to temporarily
mask file names for performing "blind" analyses:

https://github.com/imagejan/imagej-plugins/blob/master/Blind_Experiment/src/main/java/imagejan/plugins/Blind_Experiment.java#L54-65

Hth,
Jan


On 17.01.2014, 3:38 PM, Francesco De Comite wrote:

> Hi all,
>
>      I would like to write a plugin (not a macro) that read a whole
> directory of images and process them in order to produce a single image
> as a result.
> Do I have to use a stack ? Could someone show me a piece of code for
> loading several images
> and prepare them for processing ?
>
>      Regards
>
>      F. De Comité
>

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