Login  Register

Re: batch processing imagecalculation add

Posted by Fernando Sales on Feb 26, 2008; 4:58pm
URL: http://imagej.273.s1.nabble.com/batch-processing-imagecalculation-add-tp3697049p3697050.html

Hi Herwig!

If i understood your problem, this should be solved with a simple plugin
using stacks. Using the command Open -> Import -> Image Sequence a stack
with all your images will be created.
If the images are in the correct order, you'll not have problems to process
them.
Just make a loop and call imageCalculation inside this.

Try something like this:
public class Test_ implements PlugIn {
  ImagePlus imps;

  public void run(String args) {
    IJ.run("Image Sequence..."); // Open Sequence and make stack

    // Load Stack
    this.imps = ij.WindowManager.getCurrentImage();
    ImageStack stack = imps.getImageStack();

    for (int k = 0; k < stack.getSize()-1; k++) {
      ImagePlus imp1 = new ImagePlus("Name ", stack.getProcessor(k + 1));
      ImagePlus imp2 = new ImagePlus("Name ", stack.getProcessor(k + 2));
     <Input your operations here...>
   }
...
}
}

You can find hints and examples in the tutorial available in:
http://www.imagingbook.com/index.php?id=102
I hope this can be helpful.

Good luck!
Fernando

On Sat, Feb 23, 2008 at 3:59 AM, herwig <[hidden email]> wrote:

> Hi there,
>
> I am pretty new to ImageJ and not good at writing macros.
> I've got 200 images in a folder and would like to add always two
> subsequent
> fotos up.
> Imagecalculation and the add function seem to be suitable for it.
> I've tried to write a little macro which loops through my files (they end
> with an increasing number) but I couldn't work it out so far.
> I couldn't find a solution in the forum either.
>
> I would be greatful for any  suggestion.
>
> cheers,
>
> herwig
> --
> View this message in context:
> http://www.nabble.com/batch-processing-imagecalculation-add-tp15641464p15641464.html
> Sent from the ImageJ mailing list archive at Nabble.com.
>



--
**************************************************
Fernando José Ribeiro Sales
**************************************************
Email: [hidden email]
Tel: (11) 82020303
**************************************************