All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.mianalysis.mia.process.activecontour.energies.EnergyCollection Maven / Gradle / Ivy

Go to download

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.

There is a newer version: 1.6.8
Show newest version
//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;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy