Ask saveDetectionMeasurements to save only selected columns

Hi all. I have some detection measurements, among which i want to export the column “Image”, “centroid_X”, “centroid_Y” and “parent”. I am using saveDetectionMeasurement command now but without supplying any other input, it’s exporting the whole table. What input should I provide to filter the columns for output?

I am aware of the method on readthedocs.io using a MeasurementExporter, but just want to know how it would work with this particular method.

Any help would be appreciated!

You would want to list the measurements after the file location.

def name = getProjectEntry().getImageName() + '.txt'
def path = buildFilePath(PROJECT_BASE_DIR, 'results')
mkdirs(path)
path = buildFilePath(path, name)
saveDetectionMeasurements(path, "Nucleus: Area", "Nucleus: Perimeter")
print 'Results exported to ' + path

For example. Also found here: https://gist.github.com/Svidro/5e4c29630e8d2ef36988184987d1028f#file-export-specific-fields-groovy
Originally from
https://petebankhead.github.io/qupath/scripting/2018/03/04/script-annotation-export.html

1 Like

Thank you for the detailed answer!

1 Like