DIPlib Documentation - ©1995-2017 Quantitative Imaging Group, Delft University of Technology.

MeasurementWriteText

Write measurement results as readable text

SYNOPSIS

#include "dipio_measurement.h"

dip_Error dipio_MeasurementWriteText ( measurement, fp, options )

FUNCTION

This function saves/prints the results of a measurement stored in the measurement data structure. Since it will save the results to the fp FILE pointer (which has to be opened before this function is called, and closed afterwards), the results can be printed to a screen (specify stdout as fp) or to a file.

The results are saved in a matrix, with a column for each measurement, and a row for each object. The first column contains the object ID. The options structure provides a means to adjust the formatting of the measurement data. Its separator variable specifies the column separator character, the rows are separated by a newline. If the labelAlign variable is DIP_TRUE, the separator is repeated such that the columns are aligned. If the labels variable is DIP_TRUE, the first row contains measurement labels, and info specifies whether or not the short description of each measurement function should be printed before the result matrix. If results is DIP_FALSE, the measurement values are not printed.

ARGUMENTS

Data typeNameDescription
dip_MeasurementmeasurementMeasurement data structure
FILE *fpFILE pointer to which the results are saved
dipio_WriteTextFormatoptionsText formatting options

The structure dipio_WriteTextFormat contains the following elements:

Data typeNameDescription
char *separatorColumn separator character
dip_BooleaninfoWrite descriptio
dip_BooleanlabelsWrite labels
dip_BooleanresultsWrite values
dip_BooleanlabelAlignAlign columns

SEE ALSO

Measure, MeasurementWrite