Class AtlasManager

java.lang.Object
qupath.ext.braian.AtlasManager

public class AtlasManager extends Object
This class helps managing and exporting results for each brain region. It works closely with ABBA's QuPath extension.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final qupath.lib.objects.classes.PathClass
     
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    AtlasManager(qupath.lib.objects.hierarchy.PathObjectHierarchy hierarchy)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    List<qupath.lib.objects.PathObject>
    Flattens the atlas's ontology into a list of annotations.
    List<qupath.lib.objects.PathObject>
    Flattens the atlas ontology into a list of annotations.
    Set<qupath.lib.objects.PathObject>
    Gets all the brain regions that should be excluded from further analysis due to being missing or badly aligned to the image.
    static boolean
    isImported(qupath.lib.objects.hierarchy.PathObjectHierarchy hierarchy)
    Checks whether an ABBA atlas was previously imported.
    boolean
    Saves a file containing, on each line, the name and hemisphere of the regions to be excluded.
    boolean
    Saves a TSV file containing data for each brain region of the atlas.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • um

      public static final String um
    • EXCLUDE_CLASSIFICATION

      public static final qupath.lib.objects.classes.PathClass EXCLUDE_CLASSIFICATION
  • Constructor Details

    • AtlasManager

      public AtlasManager(qupath.lib.objects.hierarchy.PathObjectHierarchy hierarchy)
      Parameters:
      hierarchy - where to search for the atlas
  • Method Details

    • isImported

      public static boolean isImported(qupath.lib.objects.hierarchy.PathObjectHierarchy hierarchy)
      Checks whether an ABBA atlas was previously imported.
      Parameters:
      hierarchy - where to search for the atlas
      Returns:
      true if an ABBA atlas was previously imported
    • flatten

      public List<qupath.lib.objects.PathObject> flatten()
      Flattens the atlas's ontology into a list of annotations. It may return some non-region annotations too, if the atlas hierarchy was modified with added/removed elements.
      Returns:
      the list of all brain regions in the atlas
      See Also:
    • flatten

      public List<qupath.lib.objects.PathObject> flatten(List<AbstractDetections> detections)
      Flattens the atlas ontology into a list of annotations. If the atlas hierarchy was modified by adding AbstractDetections's containers, it filters them from the current brain hierarchy.
      It may still return some non-region annotations, if the atlas hierarchy was further modified with added/removed elements.
      Returns:
      the list of all brain regions in the atlas
      See Also:
    • saveResults

      public boolean saveResults(List<AbstractDetections> detections, File file)
      Saves a TSV file containing data for each brain region of the atlas. Namely, Image name, brain region name, hemisphere, area in µm², number of detections for each of the given types. The table is saved as a CSV (comma-separated values) file if 'file' ends with ".csv"
      Parameters:
      detections - the list of detection of which to gather the data for each region
      file - the file where it should write to. Note that if the file exists, it will be overwritten
    • getExcludedBrainRegions

      public Set<qupath.lib.objects.PathObject> getExcludedBrainRegions()
      Gets all the brain regions that should be excluded from further analysis due to being missing or badly aligned to the image. A brain region, in order to be excluded, must:
      • either be contained into a larger annotation, classified as "Exclude"
      • or be duplicated (SHIFT+D) outside the Atlas's hierarchy, and then classified as "Exclude"
      Returns:
      a set of brain regions' annotations that should be excluded
    • saveExcludedRegions

      public boolean saveExcludedRegions(File file)
      Saves a file containing, on each line, the name and hemisphere of the regions to be excluded.
      Parameters:
      file - the file where it should write to. Note that if the file exists, it will be overwritten
      See Also: