Frame average plugin (4D HyperStack)

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

Frame average plugin (4D HyperStack)

José María Mateos
Hello everyone,

Before I rush to code it, I'd like to know if there is a plugin that does this:

I have a 4D image (3D + time) open as a HyperStack. From that 4D
image, I want to create a 3D image that consists of the average of
different frames (from M to N, specified by the user). I understand
this (http://svg.dmi.unict.it/iplab/imagej/Plugins/Forensics/Frames%20Global%20Average/web/frameglobalaverage.htm)
does something similar to what I want, but does not ask the user for
the starting and ending frames to average.

Thanks a lot,

José.

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

Re: Frame average plugin (4D HyperStack)

Krs5
Hi Jose,

I could not open the website but might Grouped Z Projection (Image > Tools > Grouped Z Projection) do what you want? It asks for starting and ending frame but is smart enough to set the number of images of your z-stack as default and in a macro you can collect the slice information via getDimensions(width, height, channels, slices, frames)


Kees

-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of José María Mateos
Sent: 29 July 2013 15:46
To: [hidden email]
Subject: Frame average plugin (4D HyperStack)

Hello everyone,

Before I rush to code it, I'd like to know if there is a plugin that does this:

I have a 4D image (3D + time) open as a HyperStack. From that 4D image, I want to create a 3D image that consists of the average of different frames (from M to N, specified by the user). I understand this (http://svg.dmi.unict.it/iplab/imagej/Plugins/Forensics/Frames%20Global%20Average/web/frameglobalaverage.htm)
does something similar to what I want, but does not ask the user for the starting and ending frames to average.

Thanks a lot,

José.

--
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: Frame average plugin (4D HyperStack)

José María Mateos
2013/7/31 Straatman, Kees R. (Dr.) <[hidden email]>:
> I could not open the website but might Grouped Z Projection (Image > Tools > Grouped Z Projection) do what you want? It asks for starting and ending frame but is smart enough to set the number of images of your z-stack as default and in a macro you can collect the slice information via getDimensions(width, height, channels, slices, frames)

Thanks for the suggestion, I'll take a look at it.

Best,

José.

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

Re: Frame average plugin (4D HyperStack)

José María Mateos
I ended up coding it. It is very fast, in case anyone wants to use it:

https://github.com/HGGM-LIM/limtools/blob/master/src/main/java/limtools/Average_Frames.java

It is part of a .jar library that I am putting together with
miscelaneous plugins that have been developed (or are being developed
now) in the Medical Imaging Laboratory (http://image.hggm.es). It also
includes the Dynamic Pixel Inspector that I announced some days ago.
The JAR file can be downloaded from
https://github.com/HGGM-LIM/limtools/releases

Best,

José.

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

Re: Frame average plugin (4D HyperStack)

Graeme Ball-2
Hi Jose,

I wrote something similar to average time frames over a window ("Trails"
plugin):-
https://github.com/graemeball/IJ_Temporal

It wasn't working properly with hyperstacks, so I fixed it up over the last
few days - apologies for not mentioning it earlier, but I wanted to get it
working properly first.

Regards,

Graeme


On Fri, Aug 2, 2013 at 11:58 AM, José María Mateos <[hidden email]>wrote:

> I ended up coding it. It is very fast, in case anyone wants to use it:
>
>
> https://github.com/HGGM-LIM/limtools/blob/master/src/main/java/limtools/Average_Frames.java
>
> It is part of a .jar library that I am putting together with
> miscelaneous plugins that have been developed (or are being developed
> now) in the Medical Imaging Laboratory (http://image.hggm.es). It also
> includes the Dynamic Pixel Inspector that I announced some days ago.
> The JAR file can be downloaded from
> https://github.com/HGGM-LIM/limtools/releases
>
> Best,
>
> José.
>
> --
> 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: Frame average plugin (4D HyperStack)

José María Mateos
2013/8/2 Graeme Ball <[hidden email]>:
> I wrote something similar to average time frames over a window ("Trails"
> plugin):-
> https://github.com/graemeball/IJ_Temporal

Thanks a lot, I'll definitely take a look at it.

Best,

José.

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

Re: Frame average plugin (4D HyperStack)

Cammer, Michael
In reply to this post by Graeme Ball-2
I threw this together a few years ago-- only works on stacks (not hyperstacks) and does not deal with frames at the end well (simply ignores them).  For max projections we often add a bunch of blank frames to the beginning and end of stacks.
It is good for making trails and we've used it for running avg for noisy images taken at high speed with spinning disk confocal and find it useful for reconstructed images from SIM where single optical sections are too thin to interpret.
Regards,
Michael Cammer



//==================================================================
macro "Projections of variable width"{
  checkCurrentVersion();
  projtypes = newArray("Max Intensity", "Average Intensity", "Standard Deviation", "Min Intensity", "Median");
  Dialog.create("Projections of variable width");
  Dialog.addMessage("Each slice of the stack is replaced with a projection of the depth\ndefined.");
  Dialog.addChoice("Label", projtypes, "Max Intensity");
  Dialog.addNumber("Slices to project: ", projectiondepth);
  Dialog.show();
  projection = Dialog.getChoice();
  projectiondepth = projection;
  zdepth = Dialog.getNumber();
  projectStackVariableWidth(projection, zdepth);
}  // Projections of variable width

//==================================================================
function projectStackVariableWidth(projtype, zdepth) {
  setBatchMode(true);
  setPasteMode("Copy");
  original = getImageID();
  end = nSlices();
  for (i=1;i<(end-zdepth);i++){
    stop = i + zdepth;
    run("Z Project...", "start="+i+" stop="+stop+" projection=["+projtype+"]");
    run("Select All");
    run("Copy");
    run("Close");
    selectImage(original);
    run("Set Slice...", "slice="+i);
    run("Paste");
  }
  setBatchMode(false);
  run("Select None");
} // end projectStackVariableWidth()













-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Graeme Ball
Sent: Friday, August 02, 2013 8:28 AM
To: [hidden email]
Subject: Re: Frame average plugin (4D HyperStack)

Hi Jose,

I wrote something similar to average time frames over a window ("Trails"
plugin):-
https://github.com/graemeball/IJ_Temporal

It wasn't working properly with hyperstacks, so I fixed it up over the last few days - apologies for not mentioning it earlier, but I wanted to get it working properly first.

Regards,

Graeme


On Fri, Aug 2, 2013 at 11:58 AM, José María Mateos <[hidden email]>wrote:

> I ended up coding it. It is very fast, in case anyone wants to use it:
>
>
> https://github.com/HGGM-LIM/limtools/blob/master/src/main/java/limtool
> s/Average_Frames.java
>
> It is part of a .jar library that I am putting together with
> miscelaneous plugins that have been developed (or are being developed
> now) in the Medical Imaging Laboratory (http://image.hggm.es). It also
> includes the Dynamic Pixel Inspector that I announced some days ago.
> The JAR file can be downloaded from
> https://github.com/HGGM-LIM/limtools/releases
>
> Best,
>
> José.
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
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: Frame average plugin (4D HyperStack)

Cammer, Michael
p.s.
As used for movie of ants; longer paths means faster ants.
http://www.flickr.com/photos/39998519@N00/3863524708/



-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Cammer, Michael
Sent: Friday, August 02, 2013 10:24 AM
To: [hidden email]
Subject: Re: Frame average plugin (4D HyperStack)

I threw this together a few years ago-- only works on stacks (not hyperstacks) and does not deal with frames at the end well (simply ignores them).  For max projections we often add a bunch of blank frames to the beginning and end of stacks.
It is good for making trails and we've used it for running avg for noisy images taken at high speed with spinning disk confocal and find it useful for reconstructed images from SIM where single optical sections are too thin to interpret.
Regards,
Michael Cammer



//==================================================================
macro "Projections of variable width"{
  checkCurrentVersion();
  projtypes = newArray("Max Intensity", "Average Intensity", "Standard Deviation", "Min Intensity", "Median");
  Dialog.create("Projections of variable width");
  Dialog.addMessage("Each slice of the stack is replaced with a projection of the depth\ndefined.");
  Dialog.addChoice("Label", projtypes, "Max Intensity");
  Dialog.addNumber("Slices to project: ", projectiondepth);
  Dialog.show();
  projection = Dialog.getChoice();
  projectiondepth = projection;
  zdepth = Dialog.getNumber();
  projectStackVariableWidth(projection, zdepth); }  // Projections of variable width

//==================================================================
function projectStackVariableWidth(projtype, zdepth) {
  setBatchMode(true);
  setPasteMode("Copy");
  original = getImageID();
  end = nSlices();
  for (i=1;i<(end-zdepth);i++){
    stop = i + zdepth;
    run("Z Project...", "start="+i+" stop="+stop+" projection=["+projtype+"]");
    run("Select All");
    run("Copy");
    run("Close");
    selectImage(original);
    run("Set Slice...", "slice="+i);
    run("Paste");
  }
  setBatchMode(false);
  run("Select None");
} // end projectStackVariableWidth()













-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Graeme Ball
Sent: Friday, August 02, 2013 8:28 AM
To: [hidden email]
Subject: Re: Frame average plugin (4D HyperStack)

Hi Jose,

I wrote something similar to average time frames over a window ("Trails"
plugin):-
https://github.com/graemeball/IJ_Temporal

It wasn't working properly with hyperstacks, so I fixed it up over the last few days - apologies for not mentioning it earlier, but I wanted to get it working properly first.

Regards,

Graeme


On Fri, Aug 2, 2013 at 11:58 AM, José María Mateos <[hidden email]>wrote:

> I ended up coding it. It is very fast, in case anyone wants to use it:
>
>
> https://github.com/HGGM-LIM/limtools/blob/master/src/main/java/limtool
> s/Average_Frames.java
>
> It is part of a .jar library that I am putting together with
> miscelaneous plugins that have been developed (or are being developed
> now) in the Medical Imaging Laboratory (http://image.hggm.es). It also
> includes the Dynamic Pixel Inspector that I announced some days ago.
> The JAR file can be downloaded from
> https://github.com/HGGM-LIM/limtools/releases
>
> Best,
>
> José.
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

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

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

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