Stack Position ("slice" number) always 1 when doing Batch Process on Virtual Stack

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

Stack Position ("slice" number) always 1 when doing Batch Process on Virtual Stack

askewchan
My batch processing results do not seem to keep track of which image (stack
position) the result is from.  This is what I'm doing:

"Import > Image Sequence ... " and select "Virtual Stack"

From "Set Measurements ..." I select "Stack Position"

Finally, I run a macro via "Process > Batch > Virtual stack ..."

My results appear, and every single entry in the "Slice" column reads "1",
even though there are several images in my virtual stack.  In my case, there
are also several results lines per image (I am using "Analyze Particles" and my
results are the size and position of each particle.  I need to know which image
the result is from, but there are not always the same number of particles per
image.

I am using virtual stack because I don't have enough memory to run an ordinary
stack, but I'm not sure that I fully understand the difference.

I have ImageJ64 1.46r, Java 1.6.0_33.

I believe the pertinent lines from my macro are:
    run("Set Measurements...", "area centroid stack redirect=None decimal=2");
    run("Analyze Particles...",
        "size=50-300 circularity=0.75-1.00 display stack show=Nothing");

Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: Stack Position ("slice" number) always 1 when doing Batch Process on Virtual Stack

Michael Schmid
Hi Askewchan,

the purpose of Process > Batch > Virtual stack is manipulation of images; it creates a new image from each stack slice, to allow you doing things like changing the size of each image and saving it.
(If you change the size of a virtual stack as a whole, you would need memory for all images).

Analyze Particles works for stacks (also virtual stacks) and gives you the correct slice number (and label, i.e., filename, if checked in  Set Measurements). Just add 'stack' to the arguments (Macros>Record will show you).
So there is no need to use Process > Batch > Virtual stack.

If you want to have some additional processing steps, I would propose to write a simple macro that loops over the stack slices:
  for (i=1; i<nSlices; i++) {
    setSlice(i);
    ... do whatever you like, including Analyze particles on the slice ...
  }

Michael
________________________________________________________________
On Jul 16, 2012, at 21:36, askewchan wrote:

> My batch processing results do not seem to keep track of which image (stack
> position) the result is from.  This is what I'm doing:
>
> "Import > Image Sequence ... " and select "Virtual Stack"
>
> From "Set Measurements ..." I select "Stack Position"
>
> Finally, I run a macro via "Process > Batch > Virtual stack ..."
>
> My results appear, and every single entry in the "Slice" column reads "1",
> even though there are several images in my virtual stack.  In my case, there
> are also several results lines per image (I am using "Analyze Particles" and
> my
> results are the size and position of each particle.  I need to know which
> image
> the result is from, but there are not always the same number of particles
> per
> image.
>
> I am using virtual stack because I don't have enough memory to run an
> ordinary
> stack, but I'm not sure that I fully understand the difference.
>
> I have ImageJ64 1.46r, Java 1.6.0_33.
>
> I believe the pertinent lines from my macro are:
>    run("Set Measurements...", "area centroid stack redirect=None
> decimal=2");
>    run("Analyze Particles...",
>        "size=50-300 circularity=0.75-1.00 display stack show=Nothing");
>
> Thanks!
>
>
> --
> View this message in context: http://imagej.1557.n6.nabble.com/Stack-Position-slice-number-always-1-when-doing-Batch-Process-on-Virtual-Stack-tp4999443.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: Stack Position ("slice" number) always 1 when doing Batch Process on Virtual Stack

askewchan
Thanks, Michael!  I think I got it working.  I just quickly split the
macro into two parts (one to process the images with Batch Process,
and one to analyze).


On Tue, Jul 17, 2012 at 6:06 AM, Michael Schmid-3 [via ImageJ]
<[hidden email]> wrote:

> Hi Askewchan,
>
> the purpose of Process > Batch > Virtual stack is manipulation of images; it
> creates a new image from each stack slice, to allow you doing things like
> changing the size of each image and saving it.
> (If you change the size of a virtual stack as a whole, you would need memory
> for all images).
>
> Analyze Particles works for stacks (also virtual stacks) and gives you the
> correct slice number (and label, i.e., filename, if checked in  Set
> Measurements). Just add 'stack' to the arguments (Macros>Record will show
> you).
> So there is no need to use Process > Batch > Virtual stack.
>
> If you want to have some additional processing steps, I would propose to
> write a simple macro that loops over the stack slices:
>   for (i=1; i<nSlices; i++) {
>     setSlice(i);
>     ... do whatever you like, including Analyze particles on the slice ...
>   }
>
> Michael
> ________________________________________________________________
> On Jul 16, 2012, at 21:36, askewchan wrote:
>
>> My batch processing results do not seem to keep track of which image
>> (stack
>> position) the result is from.  This is what I'm doing:
>>
>> "Import > Image Sequence ... " and select "Virtual Stack"
>>
>> From "Set Measurements ..." I select "Stack Position"
>>
>> Finally, I run a macro via "Process > Batch > Virtual stack ..."
>>
>> My results appear, and every single entry in the "Slice" column reads "1",
>> even though there are several images in my virtual stack.  In my case,
>> there
>> are also several results lines per image (I am using "Analyze Particles"
>> and
>> my
>> results are the size and position of each particle.  I need to know which
>> image
>> the result is from, but there are not always the same number of particles
>> per
>> image.
>>
>> I am using virtual stack because I don't have enough memory to run an
>> ordinary
>> stack, but I'm not sure that I fully understand the difference.
>>
>> I have ImageJ64 1.46r, Java 1.6.0_33.
>>
>> I believe the pertinent lines from my macro are:
>>    run("Set Measurements...", "area centroid stack redirect=None
>> decimal=2");
>>    run("Analyze Particles...",
>>        "size=50-300 circularity=0.75-1.00 display stack show=Nothing");
>>
>> Thanks!
>>
>>
>> --
>> View this message in context:
>> http://imagej.1557.n6.nabble.com/Stack-Position-slice-number-always-1-when-doing-Batch-Process-on-Virtual-Stack-tp4999443.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
>
>
> ________________________________
> If you reply to this email, your message will be added to the discussion
> below:
> http://imagej.1557.n6.nabble.com/Stack-Position-slice-number-always-1-when-doing-Batch-Process-on-Virtual-Stack-tp4999443p4999462.html
> To unsubscribe from Stack Position ("slice" number) always 1 when doing
> Batch Process on Virtual Stack, click here.
> NAML