Image Calculator: Image Slices minus Single Image

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

Image Calculator: Image Slices minus Single Image

Arreis
Is there any way to automate Subtraction of (Image Sequence) - (Single Image) by employing Image Calculator in Macro?

All I can find is the thread for subtraction of single images or subtraction of one image stack to another image stack.

- Love, Arreis
Reply | Threaded
Open this post in threaded view
|

Re: Image Calculator: Image Slices minus Single Image

Straub, Volko A. (Dr.)
Dear Arreiss,

The image calculator can subtract a single image from every image in a
stack. For example, the code below will calculate the average for an
open stack and then subtract it from all images in the stack:

     run("Z Project...", "projection=[Average Intensity]");
     rename("Average");
     imageCalculator("Subtract create 32-bit stack", image,"Average");

There is no need to put this inside a loop and carry out the operation
for each image separately.

Hope this helps,
Volko

On 15/03/2016 03:26, Arreis wrote:

> Is there any way to automate Subtraction of (Image Sequence) - (Single Image)
> by employing Image Calculator in Macro?
>
> All I can find is the thread for subtraction of single images or subtraction
> of one image stack to another image stack.
>
>
>
>
>
> -----
> - Love, Arreis
> --
> View this message in context: http://imagej.1557.x6.nabble.com/Image-Calculator-Image-Slices-minus-Single-Image-tp5015901.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
Reply | Threaded
Open this post in threaded view
|

Re: Image Calculator: Image Slices minus Single Image

Arreis
I see. What I mean is that

img1 as folder (containing 1000 image)

img2 as image0001.png
 
Then I need the img1 - img2 OR in other words all 1000 images minus one image.
- Love, Arreis
Reply | Threaded
Open this post in threaded view
|

Re: Image Calculator: Image Slices minus Single Image

Straub, Volko A. (Dr.)
I can see at least two solutions to your problem. You could just combine all 1000 images into a single stack and use the image calculator to subtract one image (i.e. the one you call img2) from the stack of images created from your 1000 iamges. If you need the images as individual files, it is easy to split the stack afterwards into single images.
Alternatively, open your img2 and then use a loop to circle through all the images in your folder and do the subtraction image by image (a bit like you tried in your original code). However, you need to open the image that you want to subtract before you enter the loop - otherwise you have the problem that you will be asked to select an image for every cycle.
Hope this points you in the right direction.
Volko

PS. Please don't remove previous text when you reply to a post as it makes it impossible for anybody else to follow the discussion.


-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Arreis
Sent: 15 March 2016 07:38
To: [hidden email]
Subject: Re: Image Calculator: Image Slices minus Single Image

I see. What I mean is that

img1 as folder (containing 1000 image)

img2 as image0001.png
 
Then I need the img1 - img2 OR in other words all 1000 images minus one image.




-----
- Love, Arreis
--
View this message in context: http://imagej.1557.x6.nabble.com/Image-Calculator-Image-Slices-minus-Single-Image-tp5015901p5015905.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