Package qupath.lib.io
Class TMAScoreImporter
java.lang.Object
qupath.lib.io.TMAScoreImporter
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
importFromCSV
(File file, PathObjectHierarchy hierarchy) Import TMA scores from a file into the TMAGrid of an object hierarchy.static int
importFromCSV
(String text, PathObjectHierarchy hierarchy) Import TMA scores from a String into the TMAGrid of an object hierarchy.static double[]
parseNumeric
(List<String> list, boolean allOrNothing) Parse numeric values from a list of strings.Read CSV data from a file into a map connecting column headers (keys) to lists of Strings (entries).Read CSV data from a String into a map connecting column headers (keys) to lists of Strings (entries).Read CSV data into a map connecting column headers (keys) to lists of Strings (entries).
-
Constructor Details
-
TMAScoreImporter
public TMAScoreImporter()
-
-
Method Details
-
importFromCSV
Import TMA scores from a file into the TMAGrid of an object hierarchy.- Parameters:
file
-hierarchy
-- Returns:
- Throws:
IOException
-
importFromCSV
Import TMA scores from a String into the TMAGrid of an object hierarchy.- Parameters:
text
-hierarchy
-- Returns:
-
parseNumeric
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
Read CSV data from a String into a map connecting column headers (keys) to lists of Strings (entries).- Parameters:
text
-- Returns:
-
readCSV
Read CSV data from a file into a map connecting column headers (keys) to lists of Strings (entries).- Parameters:
file
-- Returns:
- Throws:
IOException
-
readCSV
Read CSV data into a map connecting column headers (keys) to lists of Strings (entries).- Parameters:
scanner
-- Returns:
-