Thanks Wayne! If I wanted to use the integrated sum instead of the
mean can I simply type "integrated sum" in where the scripts says
"mean"?
Thanks again,
-Aaron.
On 2/9/12, Rasband, Wayne (NIH/NIMH) [E] <
[hidden email]> wrote:
> On Feb 9, 2012, at 8:20 AM, Aaron Hendrickson wrote:
>
>> Hello,
>>
>> I have two stack where I want to measure the mean pixel intensity of
>> each slice in the first stack then divide the second stack (with the
>> same number of slices) by the list of mean intensities. In other
>> words, divide the first slice in stack two by the mean intensity of
>> the first slice in stack one, divide the second slice in stack two by
>> the mean intensity of the second slice in stack one, so on and so
>> forth. Is there a plugin that can perform this task?
>
> Here is a macro that does it.
>
> -wayne
>
> n = nSlices;
> if (nImages!=2 || nSlices<2)
> exit("Two stacks expected");
> means = newArray(n);
> for (i=0; i<n; i++) {
> setSlice(i+1);
> getStatistics(area, mean);
> means[i] = mean;
> }
> run("Put Behind [tab]");
> if (n!=nSlices)
> exit("Stacks must be the same size");
> for (i=0; i<n; i++) {
> setSlice(i+1);
> mean = means[i];
> run("Divide...", "value=&mean slice");
> }
>