Search in sources :

Example 1 with WidthFilter

use of uk.ac.sussex.gdsc.smlm.results.filter.WidthFilter in project GDSC-SMLM by aherbert.

the class CreateFilters method logDemoFilters.

private void logDemoFilters() {
    comment(TITLE + " example template filters");
    IJ.log("");
    comment("Filters are described using XML");
    comment("Filter attibutes that take the form 'min:max:increment' will be enumerated");
    comment("Note: This example is a subset. All filters are described in the user manual");
    IJ.log("");
    comment("Single filters");
    IJ.log("");
    demo(new SnrFilter(10), "10:20:1");
    demo(new PrecisionFilter(30), "30:50:2");
    IJ.log("");
    comment("Combined filters");
    IJ.log("");
    demo(new AndFilter(new SnrFilter(10), new WidthFilter(2)), "10:20:1", "1.5:2.5:0.2");
    demo(new OrFilter(new PrecisionFilter(30), new AndFilter(new SnrFilter(10), new WidthFilter(2))), "30:40:2", "10:20:1", "1.5:2.5:0.2");
    IJ.log("");
}
Also used : AndFilter(uk.ac.sussex.gdsc.smlm.results.filter.AndFilter) PrecisionFilter(uk.ac.sussex.gdsc.smlm.results.filter.PrecisionFilter) SnrFilter(uk.ac.sussex.gdsc.smlm.results.filter.SnrFilter) OrFilter(uk.ac.sussex.gdsc.smlm.results.filter.OrFilter) WidthFilter(uk.ac.sussex.gdsc.smlm.results.filter.WidthFilter)

Example 2 with WidthFilter

use of uk.ac.sussex.gdsc.smlm.results.filter.WidthFilter in project GDSC-SMLM by aherbert.

the class FreeFilterResults method logDemoFilters.

private static void logDemoFilters(String title) {
    comment(title + " example filters");
    IJ.log("");
    comment("Filters are described using XML");
    comment("Multiple filters can be combined using AND/OR filters");
    IJ.log("");
    comment("Single filters");
    IJ.log("");
    demo(new WidthFilter(2));
    demo(new WidthFilter2(0.7, 2));
    demo(new XyWidthFilter(2));
    demo(new XyWidthFilter2(0.7, 2));
    demo(new SbrFilter(15));
    demo(new ShiftFilter(0.7));
    demo(new EShiftFilter(0.8));
    demo(new SignalFilter(1000));
    demo(new SnrFilter(10));
    demo(new AnrFilter(11));
    demo(new PrecisionFilter(30));
    demo(new PrecisionFilter2(30));
    demo(new SnrHysteresisFilter(50, 1, 2, 1, 10, 20));
    demo(new PrecisionHysteresisFilter(2, 0, 1, 0, 20, 30));
    demo(new TraceFilter(0.5, 1));
    demo(new CoordinateFilter(15.5f, 234.5f, 80.99f, 133f));
    demo(new MultiFilter(30, 45f, 0.7, 1.5, 0.5, 0.6, 45, -10, 10));
    demo(new MultiFilter2(30, 45f, 0.7, 1.5, 0.5, 0.6, 45, -10, 10));
    demo(new MultiHysteresisFilter(2, 0, 1, 0, 20, 10, 40f, 20f, 0.8, 0.2, 1.2, 0.4, 0.3, 0.8, 20, 30));
    demo(new MultiHysteresisFilter2(2, 0, 2, 1, 20, 10, 40f, 20f, 0.8, 0.2, 1.2, 0.4, 0.3, 0.8, 20, 30));
    comment("Combined filters");
    IJ.log("");
    demo(new AndFilter(new SnrFilter(10), new WidthFilter(2)));
    demo(new OrFilter(new SnrFilter(10), new PrecisionFilter(30)));
    demo(new OrFilter(new AndFilter(new SnrFilter(10), new PrecisionFilter(30)), new TraceFilter(0.5, 1)));
}
Also used : PrecisionFilter(uk.ac.sussex.gdsc.smlm.results.filter.PrecisionFilter) AnrFilter(uk.ac.sussex.gdsc.smlm.results.filter.AnrFilter) SnrFilter(uk.ac.sussex.gdsc.smlm.results.filter.SnrFilter) MultiHysteresisFilter2(uk.ac.sussex.gdsc.smlm.results.filter.MultiHysteresisFilter2) OrFilter(uk.ac.sussex.gdsc.smlm.results.filter.OrFilter) SbrFilter(uk.ac.sussex.gdsc.smlm.results.filter.SbrFilter) MultiFilter(uk.ac.sussex.gdsc.smlm.results.filter.MultiFilter) XyWidthFilter(uk.ac.sussex.gdsc.smlm.results.filter.XyWidthFilter) SnrHysteresisFilter(uk.ac.sussex.gdsc.smlm.results.filter.SnrHysteresisFilter) XyWidthFilter(uk.ac.sussex.gdsc.smlm.results.filter.XyWidthFilter) WidthFilter(uk.ac.sussex.gdsc.smlm.results.filter.WidthFilter) AndFilter(uk.ac.sussex.gdsc.smlm.results.filter.AndFilter) EShiftFilter(uk.ac.sussex.gdsc.smlm.results.filter.EShiftFilter) WidthFilter2(uk.ac.sussex.gdsc.smlm.results.filter.WidthFilter2) XyWidthFilter2(uk.ac.sussex.gdsc.smlm.results.filter.XyWidthFilter2) MultiFilter2(uk.ac.sussex.gdsc.smlm.results.filter.MultiFilter2) PrecisionHysteresisFilter(uk.ac.sussex.gdsc.smlm.results.filter.PrecisionHysteresisFilter) XyWidthFilter2(uk.ac.sussex.gdsc.smlm.results.filter.XyWidthFilter2) PrecisionFilter2(uk.ac.sussex.gdsc.smlm.results.filter.PrecisionFilter2) TraceFilter(uk.ac.sussex.gdsc.smlm.results.filter.TraceFilter) SignalFilter(uk.ac.sussex.gdsc.smlm.results.filter.SignalFilter) CoordinateFilter(uk.ac.sussex.gdsc.smlm.results.filter.CoordinateFilter) EShiftFilter(uk.ac.sussex.gdsc.smlm.results.filter.EShiftFilter) ShiftFilter(uk.ac.sussex.gdsc.smlm.results.filter.ShiftFilter) MultiHysteresisFilter(uk.ac.sussex.gdsc.smlm.results.filter.MultiHysteresisFilter)

Example 3 with WidthFilter

use of uk.ac.sussex.gdsc.smlm.results.filter.WidthFilter in project GDSC-SMLM by aherbert.

the class FilterAnalysis method addSnrFilters.

private void addSnrFilters(List<FilterSet> filterSets) {
    if (!settings.snrFilter) {
        return;
    }
    for (double w = settings.minWidth; w <= settings.maxWidth; w += settings.incWidth) {
        final WidthFilter wf = new WidthFilter((float) w);
        final List<Filter> filters = new LinkedList<>();
        for (int snr = settings.minSnr; snr <= settings.maxSnr; snr++) {
            filters.add(new AndFilter(wf, new SnrFilter(snr)));
        }
        filterSets.add(new FilterSet(filters));
    }
}
Also used : AndFilter(uk.ac.sussex.gdsc.smlm.results.filter.AndFilter) FilterSet(uk.ac.sussex.gdsc.smlm.results.filter.FilterSet) Filter(uk.ac.sussex.gdsc.smlm.results.filter.Filter) AndFilter(uk.ac.sussex.gdsc.smlm.results.filter.AndFilter) PrecisionFilter(uk.ac.sussex.gdsc.smlm.results.filter.PrecisionFilter) SnrHysteresisFilter(uk.ac.sussex.gdsc.smlm.results.filter.SnrHysteresisFilter) WidthFilter(uk.ac.sussex.gdsc.smlm.results.filter.WidthFilter) SnrFilter(uk.ac.sussex.gdsc.smlm.results.filter.SnrFilter) OrFilter(uk.ac.sussex.gdsc.smlm.results.filter.OrFilter) PrecisionHysteresisFilter(uk.ac.sussex.gdsc.smlm.results.filter.PrecisionHysteresisFilter) TraceFilter(uk.ac.sussex.gdsc.smlm.results.filter.TraceFilter) SnrFilter(uk.ac.sussex.gdsc.smlm.results.filter.SnrFilter) LinkedList(java.util.LinkedList) WidthFilter(uk.ac.sussex.gdsc.smlm.results.filter.WidthFilter)

Example 4 with WidthFilter

use of uk.ac.sussex.gdsc.smlm.results.filter.WidthFilter in project GDSC-SMLM by aherbert.

the class FilterAnalysis method addSnrHysteresisFilters.

private void addSnrHysteresisFilters(List<FilterSet> filterSets) {
    if (!settings.hysteresisSnrFilter) {
        return;
    }
    for (double w = settings.minWidth; w <= settings.maxWidth; w += settings.incWidth) {
        final WidthFilter wf = new WidthFilter((float) w);
        for (int snrGap = settings.minSnrGap; snrGap <= settings.maxSnrGap; snrGap += settings.incSnrGap) {
            final List<Filter> filters = new LinkedList<>();
            for (int snr = settings.minSnr; snr <= settings.maxSnr; snr++) {
                filters.add(new AndFilter(wf, new SnrHysteresisFilter(2, 0, 1, 0, snr, snrGap)));
            }
            filterSets.add(new FilterSet(filters));
        }
    }
}
Also used : AndFilter(uk.ac.sussex.gdsc.smlm.results.filter.AndFilter) FilterSet(uk.ac.sussex.gdsc.smlm.results.filter.FilterSet) Filter(uk.ac.sussex.gdsc.smlm.results.filter.Filter) AndFilter(uk.ac.sussex.gdsc.smlm.results.filter.AndFilter) PrecisionFilter(uk.ac.sussex.gdsc.smlm.results.filter.PrecisionFilter) SnrHysteresisFilter(uk.ac.sussex.gdsc.smlm.results.filter.SnrHysteresisFilter) WidthFilter(uk.ac.sussex.gdsc.smlm.results.filter.WidthFilter) SnrFilter(uk.ac.sussex.gdsc.smlm.results.filter.SnrFilter) OrFilter(uk.ac.sussex.gdsc.smlm.results.filter.OrFilter) PrecisionHysteresisFilter(uk.ac.sussex.gdsc.smlm.results.filter.PrecisionHysteresisFilter) TraceFilter(uk.ac.sussex.gdsc.smlm.results.filter.TraceFilter) LinkedList(java.util.LinkedList) SnrHysteresisFilter(uk.ac.sussex.gdsc.smlm.results.filter.SnrHysteresisFilter) WidthFilter(uk.ac.sussex.gdsc.smlm.results.filter.WidthFilter)

Aggregations

AndFilter (uk.ac.sussex.gdsc.smlm.results.filter.AndFilter)4 OrFilter (uk.ac.sussex.gdsc.smlm.results.filter.OrFilter)4 PrecisionFilter (uk.ac.sussex.gdsc.smlm.results.filter.PrecisionFilter)4 SnrFilter (uk.ac.sussex.gdsc.smlm.results.filter.SnrFilter)4 WidthFilter (uk.ac.sussex.gdsc.smlm.results.filter.WidthFilter)4 PrecisionHysteresisFilter (uk.ac.sussex.gdsc.smlm.results.filter.PrecisionHysteresisFilter)3 SnrHysteresisFilter (uk.ac.sussex.gdsc.smlm.results.filter.SnrHysteresisFilter)3 TraceFilter (uk.ac.sussex.gdsc.smlm.results.filter.TraceFilter)3 LinkedList (java.util.LinkedList)2 Filter (uk.ac.sussex.gdsc.smlm.results.filter.Filter)2 FilterSet (uk.ac.sussex.gdsc.smlm.results.filter.FilterSet)2 AnrFilter (uk.ac.sussex.gdsc.smlm.results.filter.AnrFilter)1 CoordinateFilter (uk.ac.sussex.gdsc.smlm.results.filter.CoordinateFilter)1 EShiftFilter (uk.ac.sussex.gdsc.smlm.results.filter.EShiftFilter)1 MultiFilter (uk.ac.sussex.gdsc.smlm.results.filter.MultiFilter)1 MultiFilter2 (uk.ac.sussex.gdsc.smlm.results.filter.MultiFilter2)1 MultiHysteresisFilter (uk.ac.sussex.gdsc.smlm.results.filter.MultiHysteresisFilter)1 MultiHysteresisFilter2 (uk.ac.sussex.gdsc.smlm.results.filter.MultiHysteresisFilter2)1 PrecisionFilter2 (uk.ac.sussex.gdsc.smlm.results.filter.PrecisionFilter2)1 SbrFilter (uk.ac.sussex.gdsc.smlm.results.filter.SbrFilter)1