Class ProjectsConfig

java.lang.Object
qupath.ext.braian.config.ProjectsConfig

public class ProjectsConfig extends Object
This class reads a YAML file and can be used to apply the given parameters to the computation offered by BraiAn extension For more information, read this config file example.
  • Constructor Details

    • ProjectsConfig

      public ProjectsConfig()
  • Method Details

    • read

      public static ProjectsConfig read(String yamlFileName) throws IOException, org.yaml.snakeyaml.error.YAMLException
      Reads a BraiAn configuration file
      Parameters:
      yamlFileName - the name of the file, not the path. It will then search it first into the project's directory and, if it wasn't there, in its parent directory. If it cannot still find it, it throws FileNotFoundException
      Returns:
      an instance of ProjectsConfig
      Throws:
      IOException - if it found the config file, but it had problems while reading it.
      org.yaml.snakeyaml.error.YAMLException - if it found and read the config file, but it was badly formatted.
    • getClassForDetections

      public String getClassForDetections()
    • getAnnotationsForDetections

      public Collection<qupath.lib.objects.PathAnnotationObject> getAnnotationsForDetections(qupath.lib.objects.hierarchy.PathObjectHierarchy hierarchy)
      Finds (or creates) the annotations chosen for computing the detections, accordingly to the configuration file. It reads the value of 'classForDetections' in the YAML and searches all annotations having the appointed classification
      Parameters:
      hierarchy - where to search the annotations in
      Returns:
      the annotations to be used for computing the detections
      See Also:
    • setClassForDetections

      public void setClassForDetections(String classForDetections)
    • getDetectionsCheck

      public DetectionsCheckConfig getDetectionsCheck()
    • setDetectionsCheck

      public void setDetectionsCheck(DetectionsCheckConfig detectionsCheck)
    • getControlChannel

      public Optional<String> getControlChannel()
      Retrieves the name of the channel to be used as control in the overlapping
      Returns:
      an empty optional if no overlapping is desired or if there there is only one image channel to compute the detections for
      See Also:
    • getChannelDetections

      public List<ChannelDetectionsConfig> getChannelDetections()
    • setChannelDetections

      public void setChannelDetections(List<ChannelDetectionsConfig> channelDetections)