io.github.mianalysis.mia.process.math.Indexer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mia-algorithms Show documentation
Show all versions of mia-algorithms Show documentation
ModularImageAnalysis (MIA) is an ImageJ plugin which provides a modular framework for assembling image and object analysis workflows. Detected objects can be transformed, filtered, measured and related. Analysis workflows are batch-enabled by default, allowing easy processing of high-content datasets.
package io.github.mianalysis.mia.process.math;
/**
* Multidimensional indexing
* Created by sc13967 on 15/08/2016.
*/
public class Indexer {
private int[] dim;
private int[] dim_m;
public Indexer(int[] dim) {
this.dim = dim;
dim_m = new int[this.dim.length];
dim_m[0] = 1;
for (int i=1;i= dim[i]) {
return -1;
}
}
//Adding each coordinate (multiplied by the relevant dimension) to ind
int ind = 0;
for (int i=0;i indexerSize) return null;
int[] coord = new int[dim_m.length];
coord[0] = ind%dim_m[1];
for (int i=1;i