Frame Projector

This plugin projects the images in the frame direction into a lower dimension using different methods.


Fred Damen


When run as a plugin from the gui the correct image is used; identified on top line. A subset of the slices and frames can be used as the source data; see syntax for Make Substacks…. The following summary methods as provided:

Sum Arithmetic Sum
Mean Arithmetic Mean (μ)
StdDev Standard Deviation (σ) - computed using the slow method for numerical accuracy
ZScore Z Score (μ/σ) - akin to Signal to Noise (SNR)
CV Coefficient of Variation (σ/μ)
Minimum Minimum
Maximum Maximum
Median Median
Center Weighted arithmetic mean around the median - resilient to outliers
Product Product (nΠsi/n)
GeoMean Geometric Mean - prescaled product
LinReg Linear least squares regression - frames returned m, b, r2
TheilSen Theil Sen Regression with Center estimator - frames m, b
Fit CurveFitter fitting - frames are model parameters, r2, Ψ2
Deviation Appends a frame with the appropriate deviation from an appropriate selected summary.
If the first slice of every frame has a Short Label that can be split by the regex ” = |=| ”, e.g., var = fval, and the list has unique elements, the float fval values will be used in the fittings instead of the frame number.

There are also static methods provided, with the same names, albeit, all lower case, with two syntaxis: method(ImagePlus,slices,frames), method(ImagePlus); save fit(…, int), fit(…, String).

Nota bene: Works even when there is only one slice in the Z direction.



ImagePlus aslAcquired = . . .
ImagePlus tag = F_Project.mean(aslAcquired,”all”,”1-100-2”);
ImagePlus ctl = F_Project.mean(aslAcquired,”all”,”2-100-2”);
ImagePlus asl = ctl.duplicate();
(new ImageCaculator()).run(“Subtract 32-bit stack”, asl, tag);
(new ImageCaculator()).run(“Divide 32-bit stack”, asl, ctl);


/* Assuming many b-values */
ImagePlus dwiAcquired = . . .
ImagePlus dwi = dwiAcquired.duplicate();
for(int f-0; f<dwiAcquired.getNFrames(); f++)
(new ImageCalculator()).run(“Divide 32-bit stack”, dwi, SubHyperstackMaker.makeSubhyperstack(imp,”1”,”1-”+dwi.getNSlices(),dwiAcquired));

ImagePlus adc_etal =,”Exponential”);

OR with more resilience to outliers . . ., “Log”, ””);
ImagePlus adc_etal = F_Project.theilsen(dwi);


Place the file in your plugins directory, then compile&run; or just place the class file in your prugins directory and refresh the menus / restart ImageJ.


GPL distribution licence.


  • 1 April 2018 - Initial Version.
plugin/stacks/frame_projector/start.txt · Last modified: 2018/06/01 21:45 by fred
Back to top
CC Attribution-Noncommercial-Share Alike 3.0 Unported = chi`s home Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0