deleting uneventful frames in a tif stack

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

deleting uneventful frames in a tif stack

jehangir cama
Hi,

I would appreciate any help with this- I have data stored as tif stacks
(eg., a single tif file with 5000 images saved). I want to define two
regions of interest that I can define in the first frame, and which stay
the same throughout the 5000 frames.

Each roi is bright except when dark (approximately) circular objects pass
through (these are the events I want to study). I want to use ImageJ to
delete all the frames in which these dark objects are* absent* (so I want
to modify the tif stack to only keep those frames in which I have these
events).

Is this possible in ImageJ? Ideally, I need to also detect the radius and
intensity of the objects, but the first thing I need to do is get rid of
the extra frames. I'm new to using macros/plugins so if there is anything
close to what I need, I would be grateful for a link.

Thanks and regards

Jehangir

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

Re: deleting uneventful frames in a tif stack

Ed Simmons
On 18/10/2013 11:00, jehangir cama wrote:

> Hi,
>
> I would appreciate any help with this- I have data stored as tif stacks
> (eg., a single tif file with 5000 images saved). I want to define two
> regions of interest that I can define in the first frame, and which stay
> the same throughout the 5000 frames.
>
> Each roi is bright except when dark (approximately) circular objects pass
> through (these are the events I want to study). I want to use ImageJ to
> delete all the frames in which these dark objects are* absent* (so I want
> to modify the tif stack to only keep those frames in which I have these
> events).
>
> Is this possible in ImageJ? Ideally, I need to also detect the radius and
> intensity of the objects, but the first thing I need to do is get rid of
> the extra frames. I'm new to using macros/plugins so if there is anything
> close to what I need, I would be grateful for a link.
>
> Thanks and regards
>
> Jehangir
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Hi Jehangir,

This is certainly possible...

If you difference each image with the previous one, you will obtain
images that show only what has changed. You can then use these images of
the movement to determine what, if anything, is going on inside the ROIs.

In a macro you could do something like this:
Check for the presence of a stack of images with the required ROIs,
Perform the differencing to obtain a new stack of movement images,
Using the locations of the ROIs on the master stack, perform some simple
analysis of the movement stack to get the location of the object(s) of
interest,
Perform further analysis on the frames that show objects of interest
using the images from the master stack...

Do you really need to get rid of the extra frames? Or would you rather
skip past them silently?

Using the Macro recorder in IJ, you can record your actions in the GUI
to simplify wiring a macro in the first place.

Hope that helps,
Ed

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

Re: deleting uneventful frames in a tif stack

jehangir cama
Dear Ed,

Thanks for the reply, the macro recorder is very useful!

The way I normally detect the events is to make an oval roi in one of the
bright regions and plot a z-axis profile. This gives me very obvious events
in the graph that emerges (dips in the intensity with good signal to
noise). Do you know how to extract the frames of interest from this,
possibly by some threshold method? If this is possible it might be easier
(for me at least!) to do it this way.

I was thinking that then maybe I can detect the frames in one roi, then do
the same thing with the other roi, detect the frames, and then delete all
the others... (yes, I would like to delete the others as I have lots and
lots of these stacks, and the analysis will speed up a lot if I only have
the event frames left).

Thanks
Jehangir


On Fri, Oct 18, 2013 at 10:11 AM, Ed Simmons <[hidden email]>wrote:

> On 18/10/2013 11:00, jehangir cama wrote:
>
>> Hi,
>>
>> I would appreciate any help with this- I have data stored as tif stacks
>> (eg., a single tif file with 5000 images saved). I want to define two
>> regions of interest that I can define in the first frame, and which stay
>> the same throughout the 5000 frames.
>>
>> Each roi is bright except when dark (approximately) circular objects pass
>> through (these are the events I want to study). I want to use ImageJ to
>> delete all the frames in which these dark objects are* absent* (so I want
>>
>> to modify the tif stack to only keep those frames in which I have these
>> events).
>>
>> Is this possible in ImageJ? Ideally, I need to also detect the radius and
>> intensity of the objects, but the first thing I need to do is get rid of
>> the extra frames. I'm new to using macros/plugins so if there is anything
>> close to what I need, I would be grateful for a link.
>>
>> Thanks and regards
>>
>> Jehangir
>>
>> --
>> ImageJ mailing list: http://imagej.nih.gov/ij/list.**html<http://imagej.nih.gov/ij/list.html>
>>
> Hi Jehangir,
>
> This is certainly possible...
>
> If you difference each image with the previous one, you will obtain images
> that show only what has changed. You can then use these images of the
> movement to determine what, if anything, is going on inside the ROIs.
>
> In a macro you could do something like this:
> Check for the presence of a stack of images with the required ROIs,
> Perform the differencing to obtain a new stack of movement images,
> Using the locations of the ROIs on the master stack, perform some simple
> analysis of the movement stack to get the location of the object(s) of
> interest,
> Perform further analysis on the frames that show objects of interest using
> the images from the master stack...
>
> Do you really need to get rid of the extra frames? Or would you rather
> skip past them silently?
>
> Using the Macro recorder in IJ, you can record your actions in the GUI to
> simplify wiring a macro in the first place.
>
> Hope that helps,
> Ed
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.**html<http://imagej.nih.gov/ij/list.html>
>



--
PhD Student
Biological and Soft Systems, Dept. of Physics
University of Cambridge
Cavendish Laboratory
JJ Thomson Avenue
Cambridge CB3 0HE

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