Class ConsensusSetCriterion
java.lang.Object
net.preibisch.mvrecon.process.splitting.ConsensusSetCriterion
- All Implemented Interfaces:
OctTreeSplitCriterion
Criterion based on multi-consensus RANSAC sets.
Stops splitting when EITHER:
1. The number of unique detections is at or below a threshold (e.g., 12), OR
2. All corresponding views have correspondences from only ONE consensus set
(even if many detections, they belong to a single coherent transformation)
Continues splitting only if:
- Unique detections > threshold AND any view has >1 consensus set
Note: consensusSetId = -1 (single-consensus mode) is treated as its own set.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface net.preibisch.mvrecon.process.splitting.OctTreeSplitCriterion
OctTreeSplitCriterion.SplitCorrespondence -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConsensusSetCriterion(SpimData2 spimData, Set<String> labels, int minCorrespondences, ConsensusSetCriterion.ToleranceMode toleranceMode, double toleranceValue) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic doublecomputeOutlierRatio(List<OctTreeSplitCriterion.SplitCorrespondence> correspondences) Compute the aggregate outlier ratio across all view pairs.intdoubleOverride to validate that correspondences have multi-consensus information.static ConsensusSetCriterionqueryGUI(ij.gui.GenericDialog gd, SpimData2 data) Query GUI components and create ConsensusSetCriterion instance.static ConsensusSetCriterionqueryGUI(ij.gui.GenericDialog gd, SpimData2 data, Set<Integer> driveByChannelIds) Query GUI components and create ConsensusSetCriterion instance.doublescoreSplit(List<OctTreeSplitCriterion.SplitCorrespondence> child1, List<OctTreeSplitCriterion.SplitCorrespondence> child2) Score a candidate binary split.static booleansetupGUI(ij.gui.GenericDialog gd, SpimData2 data) Setup GUI components for consensus set criterion.static booleansetupGUI(ij.gui.GenericDialog gd, SpimData2 data, Set<Integer> driveByChannelIds) Setup GUI components for consensus set criterion.booleanshouldSplit(List<OctTreeSplitCriterion.SplitCorrespondence> correspondences) Evaluates whether to continue splitting based on pre-filtered correspondences.
-
Field Details
-
CRITERION_NAME
- See Also:
-
TOLERANCE_CHOICES
-
defaultMinCorrespondences
public static int defaultMinCorrespondences -
defaultLabelChoices
public static int[] defaultLabelChoices -
defaultToleranceMode
-
defaultToleranceValue
public static double defaultToleranceValue
-
-
Constructor Details
-
ConsensusSetCriterion
public ConsensusSetCriterion(SpimData2 spimData, Set<String> labels, int minCorrespondences, ConsensusSetCriterion.ToleranceMode toleranceMode, double toleranceValue) Constructor.- Parameters:
spimData- The SpimData2 containing interest pointslabels- Set of interest point labels to considerminCorrespondences- Threshold - regions with more unique detections should be splittoleranceMode- How to handle multiple consensus sets (NONE, PERCENTAGE, COUNT)toleranceValue- The tolerance value (percentage or count, depending on mode)
-
-
Method Details
-
shouldSplit
Description copied from interface:OctTreeSplitCriterionEvaluates whether to continue splitting based on pre-filtered correspondences. The correspondences have already been filtered to only include those within the current interval.- Specified by:
shouldSplitin interfaceOctTreeSplitCriterion- Parameters:
correspondences- The correspondences within the current interval- Returns:
- true if this region should be split further, false if it should remain as-is
-
computeOutlierRatio
public static double computeOutlierRatio(List<OctTreeSplitCriterion.SplitCorrespondence> correspondences) Compute the aggregate outlier ratio across all view pairs. For each pair, the dominant consensus set (highest count) is "inlier", everything else is "outlier". Returns totalOutliers / (totalDominant + totalOutliers), or 0.0 if there are no correspondences. -
scoreSplit
public double scoreSplit(List<OctTreeSplitCriterion.SplitCorrespondence> child1, List<OctTreeSplitCriterion.SplitCorrespondence> child2) Description copied from interface:OctTreeSplitCriterionScore a candidate binary split. Lower is better. Used as tiebreaker in chooseBestSplitDimension when multiple dimensions produce the same number of clean children.- Specified by:
scoreSplitin interfaceOctTreeSplitCriterion- Parameters:
child1- Correspondences in the first childchild2- Correspondences in the second child- Returns:
- Score (lower = better split). Default: 0 (no preference).
-
description
- Specified by:
descriptionin interfaceOctTreeSplitCriterion- Returns:
- A description of this criterion and its parameters for logging/display
-
loadCorrespondences
public List<OctTreeSplitCriterion.SplitCorrespondence> loadCorrespondences(mpicbg.spim.data.sequence.ViewId viewId) Override to validate that correspondences have multi-consensus information. Throws RuntimeException if consensusSetId is -1 (single-consensus mode).- Specified by:
loadCorrespondencesin interfaceOctTreeSplitCriterion- Parameters:
viewId- The ViewId to load correspondences for- Returns:
- List of correspondences for this view
-
getMinCorrespondences
public int getMinCorrespondences() -
getToleranceMode
-
getToleranceValue
public double getToleranceValue() -
getLabels
- Specified by:
getLabelsin interfaceOctTreeSplitCriterion- Returns:
- The set of interest point labels to consider for correspondences
-
getSpimData
- Specified by:
getSpimDatain interfaceOctTreeSplitCriterion- Returns:
- The SpimData2 used by this criterion (needed for accessing timepoints, views, etc.)
-
setupGUI
Setup GUI components for consensus set criterion.- Parameters:
gd- The GenericDialog to add components todata- The SpimData2- Returns:
- true if setup successful, false if no interest points available
-
setupGUI
public static boolean setupGUI(ij.gui.GenericDialog gd, SpimData2 data, Set<Integer> driveByChannelIds) Setup GUI components for consensus set criterion.- Parameters:
driveByChannelIds- if non-null, label availability counts are computed only over views of these driving channels (so labels that exist in every driving view are not flagged as "only available for X/Y Views" because of mirrored channels).
-
queryGUI
Query GUI components and create ConsensusSetCriterion instance.- Parameters:
gd- The GenericDialog with user inputdata- The SpimData2- Returns:
- ConsensusSetCriterion instance or null if configuration invalid
-
queryGUI
public static ConsensusSetCriterion queryGUI(ij.gui.GenericDialog gd, SpimData2 data, Set<Integer> driveByChannelIds) Query GUI components and create ConsensusSetCriterion instance.- Parameters:
driveByChannelIds- must match the value passed tosetupGUI(ij.gui.GenericDialog, net.preibisch.mvrecon.fiji.spimdata.SpimData2)so the label choices are parsed against the same (channel-restricted) view set.
-