Package sc.fiji.snt.analysis.curation
Class PlausibilityCheck.SignalQuality
java.lang.Object
sc.fiji.snt.analysis.curation.PlausibilityCheck.DeepCheck
sc.fiji.snt.analysis.curation.PlausibilityCheck.SignalQuality
- Enclosing class:
PlausibilityCheck
Assesses local image signal quality around traced paths and flags
those in regions with poor contrast. For each path, voxel intensities
are sampled in a local neighborhood; signal and background are
separated by percentile thresholds, and the contrast ratio
(signal median / background median) is computed.
This check requires image data to be provided via
setImage(RandomAccessibleInterval) before scanning.
If no image is set, the check returns an empty list.
Reference: Zhang et al., Nature Methods (2024), doi:10.1038/s41592-024-02401-8.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final doubleSentinel value indicating the threshold should be inferred from image stats. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoublegetName()doublebooleanhasImage()booleanmeasure(Collection<Path> paths) Computes the full distribution of this check's metric acrosspaths, without applying the warning threshold.voidprepareImage(net.imglib2.RandomAccessibleInterval<? extends net.imglib2.type.numeric.RealType<?>> rai) Sets the image and computes its full-volume min/max stats by scanning every voxel.scan(Collection<Path> paths) Scans a collection of paths for plausibility issues.voidsetImage(net.imglib2.RandomAccessibleInterval<? extends net.imglib2.type.numeric.RealType<?>> image) Provides the image data for signal quality assessment.voidsetImageStats(double min, double max) Sets image-level statistics used to auto-compute the contrast threshold whengetMinContrast()==AUTO_THRESHOLD.voidsetMinContrast(double contrast) Sets the minimum signal-to-background contrast ratio below which a path is flagged.Methods inherited from class sc.fiji.snt.analysis.curation.PlausibilityCheck.DeepCheck
impactKind, isEnabled, setEnabled
-
Field Details
-
AUTO_THRESHOLD
public static final double AUTO_THRESHOLDSentinel value indicating the threshold should be inferred from image stats.- See Also:
-
-
Constructor Details
-
SignalQuality
public SignalQuality()
-
-
Method Details
-
getName
- Specified by:
getNamein classPlausibilityCheck.DeepCheck- Returns:
- a short human-readable name for this check
-
setMinContrast
public void setMinContrast(double contrast) Sets the minimum signal-to-background contrast ratio below which a path is flagged. Set toAUTO_THRESHOLDto infer from image statistics.- Parameters:
contrast- ratio ≥ 1.0, orAUTO_THRESHOLD
-
getMinContrast
public double getMinContrast()- Returns:
- the current minimum contrast threshold
-
setImage
public void setImage(net.imglib2.RandomAccessibleInterval<? extends net.imglib2.type.numeric.RealType<?>> image) Provides the image data for signal quality assessment.- Parameters:
image- the image (3D RAI);nullto clear
-
setImageStats
public void setImageStats(double min, double max) Sets image-level statistics used to auto-compute the contrast threshold whengetMinContrast()==AUTO_THRESHOLD.- Parameters:
min- image minimum intensitymax- image maximum intensity
-
prepareImage
public void prepareImage(net.imglib2.RandomAccessibleInterval<? extends net.imglib2.type.numeric.RealType<?>> rai) Sets the image and computes its full-volume min/max stats by scanning every voxel. Use this instead ofsetImage(net.imglib2.RandomAccessibleInterval<? extends net.imglib2.type.numeric.RealType<?>>)+setImageStats(double, double)when the caller wants the resolved auto-threshold to reflect the actual image range, independent of any lazily-populated stats elsewhere.Should always be called from a worker thread.
- Parameters:
rai- the image data;nullclears the image and stats.
-
hasImage
public boolean hasImage()- Returns:
- whether image data has been provided
-
scan
Description copied from class:PlausibilityCheck.DeepCheckScans a collection of paths for plausibility issues.- Specified by:
scanin classPlausibilityCheck.DeepCheck- Parameters:
paths- the paths to scan- Returns:
- list of warnings (empty if no issues found)
-
getResolvedThreshold
public double getResolvedThreshold()- Returns:
- the resolved threshold (auto-derived from image stats when the spinner is set to
AUTO_THRESHOLD). Exposed so the curation UI can draw the marker at the effective cutoff even in auto mode.
-
hasValidStats
public boolean hasValidStats()- Returns:
- true when a full-volume scan has populated the min/max
intensity stats (i.e.,
prepareImage(net.imglib2.RandomAccessibleInterval<? extends net.imglib2.type.numeric.RealType<?>>)has run). Used by sibling checks (e.g.,PlausibilityCheck.UncertainTerminal) to decide whether to borrow this check's resolved threshold or scan the volume themselves.
-
measure
Description copied from class:PlausibilityCheck.DeepCheckComputes the full distribution of this check's metric acrosspaths, without applying the warning threshold. Default implementation returnsPlausibilityCheck.Measurements.EMPTY; subclasses override to enable per-check histogram popups in the Curation Assistant.- Overrides:
measurein classPlausibilityCheck.DeepCheck- Parameters:
paths- the paths to evaluate;nullor empty yieldsPlausibilityCheck.Measurements.EMPTY.- Returns:
- a
PlausibilityCheck.Measurementsrecord; nevernull.
-