Package qupath.lib.io

Class TMAScoreImporter

java.lang.Object
qupath.lib.io.TMAScoreImporter

public class TMAScoreImporter extends Object
Helper class for importing data in connection with TMA slides.

Some methods may be changed / moved in the future, e.g. because they are more generally useful, such as those related to parsing CSV data. However, the attempts by these methods to auto-detect numeric data are not entirely robust - so more improvement is needed.

Author:
Pete Bankhead
  • Constructor Details

    • TMAScoreImporter

      public TMAScoreImporter()
  • Method Details

    • importFromCSV

      public static int importFromCSV(File file, PathObjectHierarchy hierarchy) throws IOException
      Import TMA scores from a file into the TMAGrid of an object hierarchy.
      Parameters:
      file -
      hierarchy -
      Returns:
      Throws:
      IOException
    • importFromCSV

      public static int importFromCSV(String text, PathObjectHierarchy hierarchy)
      Import TMA scores from a String into the TMAGrid of an object hierarchy.
      Parameters:
      text -
      hierarchy -
      Returns:
    • parseNumeric

      public static double[] parseNumeric(List<String> list, boolean allOrNothing)
      Parse numeric values from a list of strings.

      Parameters:
      list - list of strings containing the input text. Empty or null strings are treated as missing and returned as NaN.
      allOrNothing - is true, the assumption is made that all values will be numeric or none of them will. Consequently, if any non-missing, non-numeric value is found then null is returned. Otherwise, NaNs are returned for any value that couldn't be parsed.
      Returns:
    • readCSV

      public static Map<String,List<String>> readCSV(String text)
      Read CSV data from a String into a map connecting column headers (keys) to lists of Strings (entries).
      Parameters:
      text -
      Returns:
    • readCSV

      public static Map<String,List<String>> readCSV(File file) throws IOException
      Read CSV data from a file into a map connecting column headers (keys) to lists of Strings (entries).
      Parameters:
      file -
      Returns:
      Throws:
      IOException
    • readCSV

      public static Map<String,List<String>> readCSV(Scanner scanner)
      Read CSV data into a map connecting column headers (keys) to lists of Strings (entries).
      Parameters:
      scanner -
      Returns: