Package qupath.ext.braian
Class AtlasManager
java.lang.Object
qupath.ext.braian.AtlasManager
This class helps managing and exporting results for each brain region. It works closely with ABBA's QuPath extension.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final qupath.lib.objects.classes.PathClass
static final String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionList<qupath.lib.objects.PathObject>
flatten()
Flattens the atlas's ontology into a list of annotations.List<qupath.lib.objects.PathObject>
flatten
(List<AbstractDetections> detections) 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
saveExcludedRegions
(File file) Saves a file containing, on each line, the name and hemisphere of the regions to be excluded.boolean
saveResults
(List<AbstractDetections> detections, File file) Saves a TSV file containing data for each brain region of the atlas.
-
Field Details
-
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
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
Flattens the atlas ontology into a list of annotations. If the atlas hierarchy was modified by addingAbstractDetections
'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
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 regionfile
- the file where it should write to. Note that if the file exists, it will be overwritten
-
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
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:
-