MultipleCompilationErrorsException in .groovy script

Hi all,
I’m new to QuPath and have been trying to export all cell data from an image via a .groovy script. I’m getting an exception on the def outputPath line.

ERROR: MultipleCompilationErrorsException at line 24: startup failed:
Script14.groovy: 25: Unexpected input: ‘"’ @ line 25, column 18.
def outputPath = “C:\QuPathExports\measurements.tsv”

Any help on this would be appreciated.

import qupath.lib.objects.PathCellObject

// Get the list of all images in the current project
def project = getProject()
def imagesToExport = project.getImageList()

// Separate each measurement value in the output file with a tab ("\t")
def separator = "\t"

// Choose the columns that will be included in the export
// Note: if 'columnsToInclude' is empty, all columns will be included
def columnsToInclude = new String[]{}

// Choose the type of objects that the export will process
// Other possibilities include:
//    1. PathAnnotationObject
//    2. PathDetectionObject
//    3. PathRootObject
// Note: import statements should then be modified accordingly
def exportType = PathCellObject.class

// Choose your *full* output path
def outputPath = "C:\QuPathExports\measurements.tsv"

def outputFile = new File(outputPath)

// Create the measurementExporter and start the export
def exporter  = new MeasurementExporter()
                  .imageList(imagesToExport)            // Images from which measurements will be exported
                  .separator(separator)                 // Character that separates values
                  .includeOnlyColumns(columnsToInclude) // Columns are case-sensitive
                  .exportType(exportType)               // Type of objects to export
                  .exportMeasurements(outputFile)        // Start the export process

print "Done!"

Not sure if those were normal coding quote marks or they have some sort of hidden formatting. Deleting that line and retyping it (also using forward slashes or double backslashes is necessary, single backslashes won’t work on a PC)
def outputPath = "C:/QuPathExports/measurements.tsv"

Thanks! That worked!

1 Like