Search in sources :

Example 31 with Filter

use of ini.trakem2.utils.Filter in project TrakEM2 by trakem2.

the class RegularizedAffineLayerAlignment method exec.

/**
 * Stateful.  Changing the parameters of this instance.  Do not use in parallel.
 *
 * @param layerSet
 * @param firstIn
 * @param lastIn
 * @param ref
 * @param propagateTransformBefore
 * @param propagateTransformAfter
 * @param fov
 * @param filter
 */
public final void exec(final LayerSet layerSet, final int firstIn, final int lastIn, final int ref, final boolean propagateTransformBefore, final boolean propagateTransformAfter, final Rectangle fov, final Filter<Patch> filter) throws Exception {
    final int first = Math.min(firstIn, lastIn);
    final int last = Math.max(firstIn, lastIn);
    /* always first index first despite the method would return inverse order if last > first */
    final List<Layer> layerRange = layerSet.getLayers(first, last);
    final HashSet<Layer> fixedLayers = new HashSet<Layer>();
    if (ref - first >= 0)
        fixedLayers.add(layerRange.get(ref - first));
    Utils.log(layerRange.size() + "");
    exec(layerRange, fixedLayers, propagateTransformBefore, propagateTransformAfter, fov, filter);
}
Also used : Layer(ini.trakem2.display.Layer) Point(mpicbg.models.Point) HashSet(java.util.HashSet)

Aggregations

Layer (ini.trakem2.display.Layer)18 ArrayList (java.util.ArrayList)15 Patch (ini.trakem2.display.Patch)14 Point (mpicbg.models.Point)13 Rectangle (java.awt.Rectangle)11 HashSet (java.util.HashSet)10 NotEnoughDataPointsException (mpicbg.models.NotEnoughDataPointsException)9 ImagePlus (ij.ImagePlus)8 AffineTransform (java.awt.geom.AffineTransform)7 Future (java.util.concurrent.Future)7 PointMatch (mpicbg.models.PointMatch)7 ExecutorService (java.util.concurrent.ExecutorService)6 AffineModel2D (mpicbg.models.AffineModel2D)6 SimilarityModel2D (mpicbg.models.SimilarityModel2D)6 GenericDialog (ij.gui.GenericDialog)5 Area (java.awt.geom.Area)5 ImageProcessor (ij.process.ImageProcessor)4 Collection (java.util.Collection)4 HashMap (java.util.HashMap)4 Project (ini.trakem2.Project)3