MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / median

Method median

ij/src/main/java/ij/plugin/ZProjector.java:669–676  ·  view source on GitHub ↗
(float[] a)

Source from the content-addressed store, hash-verified

667 }
668
669 float median(float[] a) {
670 Arrays.sort(a);
671 int middle = a.length/2;
672 if ((a.length&1)==0) //even
673 return (a[middle-1] + a[middle])/2f;
674 else
675 return a[middle];
676 }
677
678 // do average projection, ignoring NaNs
679 @AstroImageJ(reason = "Add support for virtual stacks", modified = true)

Callers 1

doMedianProjectionMethod · 0.95

Calls 1

sortMethod · 0.45

Tested by

no test coverage detected