Class CurationTags

java.lang.Object
sc.fiji.snt.analysis.curation.CurationTags

public final class CurationTags extends Object
Reserved cur:* path tags used to record a path's review status after it has been examined in the Curation Assistant.

SNT's custom tags are encoded as {tag} suffixes on a path's name string (see PathManagerUI#applyCustomTags), which means they get stored in .traces files and show up in the Path Manager's tag-filter dropdown. This utility provides typed helpers for the curation-specific subset so callers (scripts, training-data exporters) don't have parse path names.

Two states are supported:

  • POSITIVE: the path was reviewed and accepted; suitable as a positive training example.
  • NEGATIVE: the path was reviewed and rejected; suitable as a negative example for QC-classifier training.
  • UNSURE: the path was reviewed but tagged for follow-up review
Author:
Tiago Ferreira
  • Field Details

    • POSITIVE

      public static final String POSITIVE
      Tag value applied to paths accepted during review.
      See Also:
    • NEGATIVE

      public static final String NEGATIVE
      Tag value applied to paths rejected during review.
      See Also:
    • UNSURE

      public static final String UNSURE
      Tag value applied to paths flagged for follow-up review. Useful for batch workflows where some paths need a second pass before being committed to a training set.
      See Also:
  • Method Details

    • markPositive

      public static void markPositive(Path path)
      Tags path as a positive (accepted) review example.
    • markNegative

      public static void markNegative(Path path)
      Tags path as a negative (rejected) review example.
    • markUnsure

      public static void markUnsure(Path path)
      Tags path as needing follow-up review ("not sure").
    • clearReview

      public static void clearReview(Path path)
      Removes every cur:* suffix from path's name. Does not touch other custom tags. Idempotent on already-clean paths.
    • isPositive

      public static boolean isPositive(Path path)
      Returns:
      true if path carries the positive review tag.
    • isNegative

      public static boolean isNegative(Path path)
      Returns:
      true if path carries the negative review tag.
    • isUnsure

      public static boolean isUnsure(Path path)
      Returns:
      true if path carries the "not sure" review tag.
    • isReviewed

      public static boolean isReviewed(Path path)
      Returns:
      true if path carries any cur:* review tag (positive, negative, or a future variant).
    • partitionByReviewStatus

      public static CurationTags.Partition partitionByReviewStatus(Tree tree)
      Splits a Tree's paths into four buckets by review status: positive, negative, unsure, and unreviewed (no cur:* tag). Buckets are returned in the iteration order of the source tree, so downstream exporters can rely on stable ordering.

      Typical use from a script:

         Partition p = CurationTags.partitionByReviewStatus(tree);
         exportAsTrainingPositives(p.positive());
         exportAsTrainingNegatives(p.negative());
         ui.warn(p.unsure().size() + " path(s) still need review.");
       
      Parameters:
      tree - the source tree; null or empty yields an empty partition.
      Returns:
      a CurationTags.Partition record with one list per status bucket.
    • partitionByReviewStatus

      public static CurationTags.Partition partitionByReviewStatus(Collection<Path> paths)
      Sibling of partitionByReviewStatus(Tree) that accepts any iterable of paths.