Search in sources :

Example 16 with FilterSet

use of gdsc.smlm.results.filter.FilterSet in project GDSC-SMLM by aherbert.

the class BenchmarkFilterAnalysis method initialise.

/*
	 * (non-Javadoc)
	 * 
	 * @see gdsc.smlm.ga.FitnessFunction#initialise(java.util.List)
	 */
public void initialise(List<? extends Chromosome<FilterScore>> individuals) {
    ga_iteration++;
    ga_scoreIndex = 0;
    ga_scoreResults = scoreFilters(setStrength(new FilterSet(populationToFilters(individuals))), false);
}
Also used : FilterSet(gdsc.smlm.results.filter.FilterSet)

Example 17 with FilterSet

use of gdsc.smlm.results.filter.FilterSet in project GDSC-SMLM by aherbert.

the class BenchmarkFilterAnalysis method findOptimum.

public SearchResult<FilterScore> findOptimum(double[][] points) {
    ga_iteration++;
    SimpleFilterScore max = es_optimum;
    final FilterScoreResult[] scoreResults = scoreFilters(setStrength(new FilterSet(searchSpaceToFilters(points))), false);
    if (scoreResults == null)
        return null;
    for (int index = 0; index < scoreResults.length; index++) {
        final FilterScoreResult scoreResult = scoreResults[index];
        final SimpleFilterScore result = new SimpleFilterScore(scoreResult, true, scoreResult.criteria >= minCriteria);
        if (result.compareTo(max) < 0) {
            max = result;
        }
    }
    es_optimum = max;
    // Add the best filter to the table
    // This filter may not have been part of the scored subset so use the entire results set for reporting
    DirectFilter filter = max.r.filter;
    FractionClassificationResult r = scoreFilter(filter, minimalFilter, ga_resultsList, coordinateStore);
    final StringBuilder text = createResult(filter, r);
    add(text, ga_iteration);
    gaWindow.append(text.toString());
    return new SearchResult<FilterScore>(filter.getParameters(), max);
}
Also used : FilterSet(gdsc.smlm.results.filter.FilterSet) IDirectFilter(gdsc.smlm.results.filter.IDirectFilter) DirectFilter(gdsc.smlm.results.filter.DirectFilter) FractionClassificationResult(gdsc.core.match.FractionClassificationResult) SearchResult(gdsc.smlm.search.SearchResult)

Aggregations

FilterSet (gdsc.smlm.results.filter.FilterSet)17 Filter (gdsc.smlm.results.filter.Filter)9 DirectFilter (gdsc.smlm.results.filter.DirectFilter)7 IDirectFilter (gdsc.smlm.results.filter.IDirectFilter)7 ArrayList (java.util.ArrayList)6 LinkedList (java.util.LinkedList)6 AndFilter (gdsc.smlm.results.filter.AndFilter)5 OrFilter (gdsc.smlm.results.filter.OrFilter)5 PrecisionFilter (gdsc.smlm.results.filter.PrecisionFilter)5 PrecisionHysteresisFilter (gdsc.smlm.results.filter.PrecisionHysteresisFilter)5 SNRFilter (gdsc.smlm.results.filter.SNRFilter)5 SNRHysteresisFilter (gdsc.smlm.results.filter.SNRHysteresisFilter)5 TraceFilter (gdsc.smlm.results.filter.TraceFilter)5 WidthFilter (gdsc.smlm.results.filter.WidthFilter)5 FilenameFilter (java.io.FilenameFilter)5 MaximaSpotFilter (gdsc.smlm.filters.MaximaSpotFilter)4 MultiPathFilter (gdsc.smlm.results.filter.MultiPathFilter)4 GenericDialog (ij.gui.GenericDialog)4 NonBlockingGenericDialog (ij.gui.NonBlockingGenericDialog)4 IOException (java.io.IOException)3