How would I apply my Plugin to all of the images in a directory?

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

How would I apply my Plugin to all of the images in a directory?

Avital Steinberg
Hi,
I wrote a plugin that processes one image and saves the resulting image in
a folder. Now I would like to use this plugin to process all of the files
in a selected directory. How would I do that?

Thanks,
Avital

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: How would I apply my Plugin to all of the images in a directory?

Marcel
Hello,

simply rewrite your plugin to loop through all files in a directory. Then save the edited files e.g. with the loop index as part of the name.

Here i found quickly a code example to open all files in a directory:

http://stackoverflow.com/questions/1844688/read-all-files-in-a-folder



Reply | Threaded
Open this post in threaded view
|

Re: How would I apply my Plugin to all of the images in a directory?

Jan Eglinger
In reply to this post by Avital Steinberg
Hi Avital,

On 02.09.2014, 4:27 PM, Avital Steinberg wrote:
> I wrote a plugin that processes one image and saves the resulting image in
> a folder. Now I would like to use this plugin to process all of the files
> in a selected directory. How would I do that?

Provided that your plugin can take the current image as an input, or
that it takes an input parameter pointing to the file to be processed,
you can use any of the scripting languages provided by ImageJ/Fiji to
process a whole folder.

For example, you can use the "Process Folder" template in Fiji's script
editor, via 'Templates > IJ1 Macro > Process Folder' [1].

There's more information on the Fiji wiki:
http://fiji.sc/How_to_apply_a_common_operation_to_a_complete_directory

Hope that gets you started,
Jan

[1]:
https://github.com/imagej/imagej-legacy/blob/master/src/main/resources/script-templates/IJ1_Macro/Process_Folder.ijm

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: How would I apply my Plugin to all of the images in a directory?

Avital Steinberg
In reply to this post by Marcel
Thank you - this is what I did and it works very well!

Avital


On Wed, Sep 3, 2014 at 9:35 AM, Bio7 <[hidden email]>
wrote:

> Hello,
>
> simply rewrite your plugin to loop through all files in a directory. Then
> save the edited files e.g. with the loop index as part of the name.
>
> Here i found quickly a code example to open all files in a directory:
>
> http://stackoverflow.com/questions/1844688/read-all-files-in-a-folder
>
>
>
>
>
>
>
> --
> View this message in context:
> http://imagej.1557.x6.nabble.com/How-would-I-apply-my-Plugin-to-all-of-the-images-in-a-directory-tp5009468p5009475.html
> Sent from the ImageJ mailing list archive at Nabble.com.
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

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