io.github.mianalysis.mia.process.activecontour.energies.EnergyCollection 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.
//TODO: Implement greedy energy minimisation algorithm
package io.github.mianalysis.mia.process.activecontour.energies;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import io.github.mianalysis.mia.process.activecontour.physicalmodel.Vertex;
/**
* Created by Stephen on 07/09/2016.
*/
public class EnergyCollection {
Set energies = new HashSet();
public Iterator iterator() {
return energies.iterator();
}
public int size() {
return energies.size();
}
public void add(Energy energy) {
energies.add(energy);
}
public void remove(Energy energy) {
energies.remove(energy);
}
public double getEnergy(Vertex node) {
double energy = 0;
Iterator iterator = iterator();
while (iterator.hasNext()) {
energy += iterator.next().getEnergy(node);
}
return energy;
}
}