Package qupath.ext.braian.config
Class ChannelClassifierConfig
java.lang.Object
qupath.ext.braian.config.ChannelClassifierConfig
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionCollection<qupath.lib.objects.PathAnnotationObject>
getAnnotationsToClassify
(qupath.lib.objects.hierarchy.PathObjectHierarchy hierarchy) It searches all annotations specified by their name in the configuration file.getName()
qupath.lib.classifiers.object.ObjectClassifier
Loads the object classifier specified in the configuration file.void
setAnnotationsToClassify
(List<String> annotationsToClassify) void
setChannel
(String channel) void
toPartialClassifier
(qupath.lib.objects.hierarchy.PathObjectHierarchy hierarchy) Loads the classifier and associates it to the annotations whose name is listed in the configuration file.
-
Constructor Details
-
ChannelClassifierConfig
public ChannelClassifierConfig()
-
-
Method Details
-
getChannel
-
setChannel
-
getName
-
setName
-
getAnnotationsToClassify
-
setAnnotationsToClassify
-
loadClassifier
Loads the object classifier specified in the configuration file. If the specified name is equals to"ALL"
, it returns aSingleClassifier
that classifies all detections as part positive cells from this configuration's image channel. Else, it searches for the a JSON file named after the specified string, as described byBraiAn.resolvePath(String)
and reads it.- Returns:
- an instance of
ObjectClassifier
loaded based on the configuration file - Throws:
IOException
- if any problem raises when reading the JSON file, supposedly corresponding to a QuPath object classifier.
-
getAnnotationsToClassify
public Collection<qupath.lib.objects.PathAnnotationObject> getAnnotationsToClassify(qupath.lib.objects.hierarchy.PathObjectHierarchy hierarchy) It searches all annotations specified by their name in the configuration file. If a name does not correspond to any annotation in the current hierarchy, it silently skips it.- Parameters:
hierarchy
- where to search teh annotations in- Returns:
- a collection of annotations, if they were specified in the configuration file.
Otherwise,
null
.
-
toPartialClassifier
public PartialClassifier toPartialClassifier(qupath.lib.objects.hierarchy.PathObjectHierarchy hierarchy) throws IOException Loads the classifier and associates it to the annotations whose name is listed in the configuration file.- Parameters:
hierarchy
- where to search the annotations in- Returns:
- an instance of
PartialClassifier
- Throws:
IOException
- See Also:
-