Write measurement results as readable text
#include "dipio_measurement.h"
dip_Error dipio_MeasurementWriteText ( measurement, fp, options )
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.
Data type | Name | Description |
dip_Measurement | measurement | Measurement data structure |
FILE * | fp | FILE pointer to which the results are saved |
dipio_WriteTextFormat | options | Text formatting options |
The structure dipio_WriteTextFormat contains the following elements:
Data type | Name | Description |
char * | separator | Column separator character |
dip_Boolean | info | Write descriptio |
dip_Boolean | labels | Write labels |
dip_Boolean | results | Write values |
dip_Boolean | labelAlign | Align columns |