Package qupath.lib.gui.tools
Class MeasurementExporter
java.lang.Object
qupath.lib.gui.tools.MeasurementExporter
Helper class for exporting the measurements of one or more entries in a project.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intConstant representing that the number of decimal places to use when exporting measurements can be chosen automatically.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionSpecify that detection measurements (only) should be export.Specify that annotation measurements (only) should be export.cells()Specify that cell measurements (only) should be export.decimalPlaces(int decimalPlaces) Specify how many decimal places to use for numeric output.excludeColumns(String... excludeColumns) Specify the columns that will be excluded during the export.voidexportMeasurements(File file) Exports the measurements of one or more entries in the project.voidexportMeasurements(OutputStream stream) Exports the measurements of one or more entries in the project.exportType(Class<? extends PathObject> type) Specify what type of object should be exported.filter(Predicate<PathObject> filter) Filter thePathObjects before export (objects returningtruefor the predicate will be included).Returns the list of columns to exclude from export.Returns the list of images (ProjectImageEntry).Returns the list of columns to include in the export.Returns the separator used in between measurements.Class<? extends PathObject> getType()Returns the type of path objects used in the export.image()Specify that whole-image measurements (only) should be export.imageList(List<ProjectImageEntry<BufferedImage>> imageList) Specify the list of images (ProjectImageEntry) to export.includeOnlyColumns(String... includeOnlyColumns) Specify the columns that will be included in the export.progressMonitor(DoubleConsumer monitor) Set a progress monitor to be notified during export.Specify the separator used between measurement values.tiles()Specify that tile measurements (only) should be export.tmaCores()Specify that TMA core measurements (only) should be export.
- 
Field Details- 
DECIMAL_PLACES_DEFAULTpublic static final int DECIMAL_PLACES_DEFAULTConstant representing that the number of decimal places to use when exporting measurements can be chosen automatically.- See Also:
 
 
- 
- 
Constructor Details- 
MeasurementExporterpublic MeasurementExporter()
 
- 
- 
Method Details- 
decimalPlacesSpecify how many decimal places to use for numeric output. Default value isDECIMAL_PLACES_DEFAULT, which will adapt the number of decimal places based on the magnitude of the number being export.- Parameters:
- decimalPlaces- the number of decimal places to use
- Returns:
- this export
 
- 
exportTypeSpecify what type of object should be exported. Default: image (root object).- Parameters:
- type- the type of object to export
- Returns:
- this exporter
- See Also:
 
- 
annotationsSpecify that annotation measurements (only) should be export. This will override any other object type that might previously have been set.- Returns:
- this exporter
- Since:
- v0.6.0
 
- 
allDetectionsSpecify that detection measurements (only) should be export. This will override any other object type that might previously have been set.- Returns:
- this exporter
- Since:
- v0.6.0
 
- 
imageSpecify that whole-image measurements (only) should be export. This will override any other object type that might previously have been set.- Returns:
- this exporter
- Since:
- v0.6.0
 
- 
cellsSpecify that cell measurements (only) should be export. This will override any other object type that might previously have been set.- Returns:
- this exporter
- Since:
- v0.6.0
 
- 
tilesSpecify that tile measurements (only) should be export. This will override any other object type that might previously have been set.- Returns:
- this exporter
- Since:
- v0.6.0
 
- 
tmaCoresSpecify that TMA core measurements (only) should be export. This will override any other object type that might previously have been set.- Returns:
- this exporter
- Since:
- v0.6.0
 
- 
includeOnlyColumnsSpecify the columns that will be included in the export. The column names are case-sensitive.- Parameters:
- includeOnlyColumns- the columns to include; this takes precedence over- excludeColumns(String...).
- Returns:
- this exporter
- See Also:
 
- 
excludeColumnsSpecify the columns that will be excluded during the export. The column names are case-sensitive.- Parameters:
- excludeColumns- the columns to exclude
- Returns:
- this exporter
- See Also:
 
- 
separatorSpecify the separator used between measurement values. To avoid unexpected behavior, it is recommended to use either tab (\t), comma (,) or semicolon (;).- Parameters:
- sep- the column separator to use
- Returns:
- this exporter
 
- 
imageListSpecify the list of images (ProjectImageEntry) to export.- Parameters:
- imageList- the images to export
- Returns:
- this exporter
 
- 
progressMonitorSet a progress monitor to be notified during export. This is a consumer that takes a value between 0.0 (at the start) and 1.0 (export complete).- Parameters:
- monitor- the optional progress monitor
- Returns:
- this exporter
 
- 
filterFilter thePathObjects before export (objects returningtruefor the predicate will be included). This can be used as a secondary filter after the object type, e.g. to select annotations with a specific names, or detections with specific classifications.- Parameters:
- filter- a filter to use to select objects for export
- Returns:
- this exporter
- Since:
- v0.3.2
 
- 
getImageListReturns the list of images (ProjectImageEntry).- Returns:
- imageList
 
- 
getExcludeColumnsReturns the list of columns to exclude from export.- Returns:
- list of column names
 
- 
getIncludeColumnsReturns the list of columns to include in the export.- Returns:
- list of column names
 
- 
getSeparatorReturns the separator used in between measurements.- Returns:
- separator
 
- 
getTypeReturns the type of path objects used in the export.- Returns:
- path object
 
- 
exportMeasurementsExports the measurements of one or more entries in the project. This function first opens all the images in the project to store all the column names and values of the measurements. Then, it loops through the maps containing the values to write them to the given output file.- Parameters:
- file- the file where the data should be written
- Throws:
- IOException- if the export files
- InterruptedException
 
- 
exportMeasurementsExports the measurements of one or more entries in the project. This function first opens all the images in the project to store all the column names and values of the measurements. Then, it loops through the maps containing the values to write them to the given output stream.- Parameters:
- stream- the output stream to write to
- Throws:
- IOException- if the export fails
- InterruptedException
 
 
-