imagej / imagej-ops

ImageJ Ops: "Write once, run anywhere" image processing
https://imagej.net/libs/imagej-ops
BSD 2-Clause "Simplified" License
88 stars 42 forks source link

Make DefaultQuantile more efficient #596

Open ctrueden opened 5 years ago

ctrueden commented 5 years ago

The DefaultQuantile op copies the input Iterable into an ArrayList<Double> which is highly inefficient. At minimum, we should use an org.scijava.util.DoubleArray.

As long as we are scrutinizing the performance of DefaultQuantile, let's consider using median of medians or introselect instead. One easy way to go might be to lean on Guava's com.google.common.math.Quantiles for this.

ctrueden commented 4 years ago

Any easy way to call Guava's Quantiles is via ImgLib2's net.imglib2.util.FlatCollections.