SDDS ToolKit Programs and Libraries for C and Python
All Classes Files Functions Variables Macros Pages
image2sdds.c File Reference

Detailed Description

Converts raw binary image files into SDDS format.

This program processes raw binary image data and converts it to the SDDS (Self Describing Data Sets) format. It supports both binary and ASCII outputs and includes features for data transposition, 2D array representation, contour header generation, and multi-column mode. The SDDS format facilitates the storage and transfer of scientific data with metadata, making it ideal for analytical and visualization applications.

Usage

image2sdds <IMAGE infile> <SDDS outfile>
[-2d]
[-ascii]
[-contour]
[-multicolumnmode]
[-transpose]
[-xdim <value>]
[-ydim <value>]
[-xmin <value>]
[-xmax <value>]
[-ymin <value>]
[-ymax <value>]
[-debug]
[-help]

Options

Optional Description
-2d Output the SDDS file as a 2D array.
-ascii Write the SDDS file in ASCII format (default is binary).
-contour Generate SDDS headers for compatibility with sddscontour.
-multicolumnmode Enable multi-column mode for SDDS output.
-transpose Transpose the image along its diagonal axis.
-xdim Set the X dimension of the image (default: 482).
-ydim Set the Y dimension of the image (default: 512).
-xmin Set the minimum X coordinate value.
-xmax Set the maximum X coordinate value.
-ymin Set the minimum Y coordinate value.
-ymax Set the maximum Y coordinate value.
-debug Enable debug mode with the specified level.
-help Display usage information.

Incompatibilities

  • Only one of the following options may be specified:
    • -2d
    • -multicolumnmode
License
This file is distributed under the terms of the Software License Agreement found in the file LICENSE included with this distribution.
Authors
Josh Stein, J. Anderson, R. Soliday

Definition in file image2sdds.c.

#include <stdio.h>
#include <string.h>
#include <SDDS.h>

Go to the source code of this file.

Typedefs

typedef struct parm_info PARM_INFO
 

Functions

int process_cmdline_args (int argc, char *argv[], char *infile, char *outfile)
 
void usage (char *name)
 
int main (int argc, char *argv[])
 

Typedef Documentation

◆ PARM_INFO

typedef struct parm_info PARM_INFO

Definition at line 109 of file image2sdds.c.

Function Documentation

◆ main()

int main ( int argc,
char * argv[] )

Definition at line 132 of file image2sdds.c.

132 {
133 short *image = NULL;
134 short *rotimage = NULL;
135 char infile[255];
136 char outfile[255];
137 char xDimStr[10];
138 char yDimStr[10];
139 int32_t dim[2];
140 FILE *infilefp;
141 int x, y, i, n, j;
142 SDDS_TABLE table;
143 double xInterval = 0.02;
144 double yInterval = 0.02;
145 double *indexes = NULL;
146 char **columnNames = NULL;
147 int32_t *data = NULL;
148
149 process_cmdline_args(argc, argv, infile, outfile);
150
151 /* If user didn't specify dimensions, use defaults */
152 if (!xDim) {
153 xDim = XDIMENSION;
154 }
155 if (!yDim) {
156 yDim = YDIMENSION;
157 }
158
159 image = (short *)malloc(sizeof(short) * xDim * yDim);
160 if (!image) {
161 fprintf(stderr, "%s: Error allocating memory for image.\n", argv[0]);
162 exit(EXIT_FAILURE);
163 }
164
165 rotimage = (short *)malloc(sizeof(short) * xDim * yDim);
166 if (!rotimage) {
167 fprintf(stderr, "%s: Error allocating memory for rotated image.\n", argv[0]);
168 exit(EXIT_FAILURE);
169 }
170
171 /* Open input file */
172 if ((infilefp = fopen(infile, "rb")) == NULL) {
173 fprintf(stderr, "%s: Error: unable to open input file: %s\n", argv[0], infile);
174 exit(EXIT_FAILURE);
175 }
176
177 /* Read image into 1-dimensional array */
178 for (x = 0; x < xDim * yDim; x++) {
179 int byte = getc(infilefp);
180 if (byte == EOF) {
181 fprintf(stderr, "%s: Unexpected EOF at index %d\n", argv[0], x);
182 exit(EXIT_FAILURE);
183 }
184 image[x] = (short)byte;
185 }
186 fclose(infilefp);
187
188 /* Use transpose factor here to adjust image */
189 i = 0;
190 for (x = 0; x < xDim; x++) {
191 for (y = 0; y < yDim; y++) {
192 rotimage[y * xDim + x] = image[i];
193 i++;
194 }
195 }
196
197 /* Begin SDDS specifics */
198
199 if (transpose) { /* Reverse dimensions for transposed image */
200 sprintf(yDimStr, "%d", xDim); /* Dimensions of image sent to SDDS */
201 sprintf(xDimStr, "%d", yDim);
202 } else {
203 sprintf(xDimStr, "%d", xDim); /* Dimensions of image sent to SDDS */
204 sprintf(yDimStr, "%d", yDim);
205 }
206
207 if (asciiOutput) {
208 if (!SDDS_InitializeOutput(&table, SDDS_ASCII, 1, "ImageArray", "Converted image data", outfile)) {
209 fprintf(stderr, "%s: SDDS error: unable to initialize output file %s\n", argv[0], outfile);
210 SDDS_PrintErrors(stderr, SDDS_VERBOSE_PrintErrors);
211 exit(EXIT_FAILURE);
212 }
213 } else {
214 if (!SDDS_InitializeOutput(&table, SDDS_BINARY, 1, "ImageArray", "Converted image data", outfile)) {
215 fprintf(stderr, "%s: SDDS error: unable to initialize output file %s\n", argv[0], outfile);
216 SDDS_PrintErrors(stderr, SDDS_VERBOSE_PrintErrors);
217 exit(EXIT_FAILURE);
218 }
219 }
220
221 if (transpose) {
222 if (useXmax)
223 xInterval = (xMax - xMin) / (yDim - 1);
224 if (useYmax)
225 yInterval = (yMax - yMin) / (xDim - 1);
226 } else {
227 if (useXmax)
228 xInterval = (xMax - xMin) / (xDim - 1);
229 if (useYmax)
230 yInterval = (yMax - yMin) / (yDim - 1);
231 }
232
233 if (contour) {
234 if (!multiColumnMode) {
235 /* Begin setting parameters for use in sddscontour tool */
236 if (SDDS_DefineParameter(&table, "Variable1Name", NULL, NULL, NULL, NULL, SDDS_STRING, "x") == -1) {
237 fprintf(stderr, "%s: SDDS error: unable to define parameter 1: Variable1Name\n", argv[0]);
238 SDDS_PrintErrors(stderr, SDDS_VERBOSE_PrintErrors);
239 exit(EXIT_FAILURE);
240 }
241
242 if (SDDS_DefineParameter(&table, "Variable2Name", NULL, NULL, NULL, NULL, SDDS_STRING, "y") == -1) {
243 fprintf(stderr, "%s: SDDS error: unable to define parameter 2: Variable2Name\n", argv[0]);
244 SDDS_PrintErrors(stderr, SDDS_VERBOSE_PrintErrors);
245 exit(EXIT_FAILURE);
246 }
247
248 if (SDDS_DefineParameter1(&table, "xInterval", NULL, NULL, NULL, NULL, SDDS_DOUBLE, &xInterval) == -1) {
249 fprintf(stderr, "%s: SDDS error: unable to define parameter 3: xInterval\n", argv[0]);
250 SDDS_PrintErrors(stderr, SDDS_VERBOSE_PrintErrors);
251 exit(EXIT_FAILURE);
252 }
253
254 if (SDDS_DefineParameter1(&table, "xMinimum", NULL, NULL, NULL, NULL, SDDS_DOUBLE, &xMin) == -1) {
255 fprintf(stderr, "%s: SDDS error: unable to define parameter 4: xMinimum\n", argv[0]);
256 SDDS_PrintErrors(stderr, SDDS_VERBOSE_PrintErrors);
257 exit(EXIT_FAILURE);
258 }
259
260 if (SDDS_DefineParameter(&table, "xDimension", NULL, NULL, NULL, NULL, SDDS_LONG, xDimStr) == -1) {
261 fprintf(stderr, "%s: SDDS error: unable to define parameter 5: xDimension\n", argv[0]);
262 SDDS_PrintErrors(stderr, SDDS_VERBOSE_PrintErrors);
263 exit(EXIT_FAILURE);
264 }
265
266 if (SDDS_DefineParameter1(&table, "yInterval", NULL, NULL, NULL, NULL, SDDS_DOUBLE, &yInterval) == -1) {
267 fprintf(stderr, "%s: SDDS error: unable to define parameter 6: yInterval\n", argv[0]);
268 SDDS_PrintErrors(stderr, SDDS_VERBOSE_PrintErrors);
269 exit(EXIT_FAILURE);
270 }
271
272 if (SDDS_DefineParameter1(&table, "yMinimum", NULL, NULL, NULL, NULL, SDDS_DOUBLE, &yMin) == -1) {
273 fprintf(stderr, "%s: SDDS error: unable to define parameter 7: yMinimum\n", argv[0]);
274 SDDS_PrintErrors(stderr, SDDS_VERBOSE_PrintErrors);
275 exit(EXIT_FAILURE);
276 }
277
278 if (SDDS_DefineParameter(&table, "yDimension", NULL, NULL, NULL, NULL, SDDS_LONG, yDimStr) == -1) {
279 fprintf(stderr, "%s: SDDS error: unable to define parameter 8: yDimension\n", argv[0]);
280 SDDS_PrintErrors(stderr, SDDS_VERBOSE_PrintErrors);
281 exit(EXIT_FAILURE);
282 }
283 }
284 }
285 /* Done setting parameters */
286
287 if (array) {
288 if (SDDS_DefineArray(&table, "ImageArray", NULL, NULL, "Intensity", NULL, SDDS_CHARACTER, 0, 2, NULL) == -1) {
289 fprintf(stderr, "%s: SDDS error: unable to define array %s\n", argv[0], "ImageArray");
290 SDDS_PrintErrors(stderr, SDDS_VERBOSE_PrintErrors);
291 exit(EXIT_FAILURE);
292 }
293 } else {
294 if (!multiColumnMode) {
295 if (SDDS_DefineColumn(&table, "Image", NULL, NULL, NULL, NULL, SDDS_SHORT, 0) == -1) {
296 fprintf(stderr, "%s: SDDS error: unable to define column %s\n", argv[0], "Image");
297 SDDS_PrintErrors(stderr, SDDS_VERBOSE_PrintErrors);
298 exit(EXIT_FAILURE);
299 }
300 } else {
301 if (SDDS_DefineSimpleColumn(&table, "Index", NULL, SDDS_DOUBLE) < 0) {
302 fprintf(stderr, "%s: SDDS error: problem defining column Index.\n", argv[0]);
303 SDDS_PrintErrors(stderr, SDDS_VERBOSE_PrintErrors);
304 exit(EXIT_FAILURE);
305 }
306 if (transpose) {
307 dim[0] = xDim;
308 dim[1] = yDim;
309 } else {
310 dim[0] = yDim;
311 dim[1] = xDim;
312 }
313 indexes = malloc(sizeof(double) * dim[1]);
314 if (!indexes) {
315 fprintf(stderr, "%s: Error allocating memory for indexes.\n", argv[0]);
316 exit(EXIT_FAILURE);
317 }
318 columnNames = malloc(sizeof(char *) * dim[0]);
319 if (!columnNames) {
320 fprintf(stderr, "%s: Error allocating memory for column names.\n", argv[0]);
321 exit(EXIT_FAILURE);
322 }
323 data = malloc(sizeof(int32_t) * dim[1]);
324 if (!data) {
325 fprintf(stderr, "%s: Error allocating memory for data.\n", argv[0]);
326 exit(EXIT_FAILURE);
327 }
328 for (i = 0; i < dim[0]; i++) {
329 columnNames[i] = malloc(sizeof(char) * 20);
330 if (!columnNames[i]) {
331 fprintf(stderr, "%s: Error allocating memory for column name %d.\n", argv[0], i);
332 exit(EXIT_FAILURE);
333 }
334 sprintf(columnNames[i], "Line%" PRId32, i);
335 if (SDDS_DefineSimpleColumn(&table, columnNames[i], NULL, SDDS_SHORT) < 0) {
336 fprintf(stderr, "%s: SDDS error: problem defining column %s.\n", argv[0], columnNames[i]);
337 SDDS_PrintErrors(stderr, SDDS_VERBOSE_PrintErrors);
338 exit(EXIT_FAILURE);
339 }
340 }
341 }
342 }
343
344 if (!SDDS_WriteLayout(&table)) {
345 fprintf(stderr, "%s: SDDS error: unable to write layout\n", argv[0]);
346 SDDS_PrintErrors(stderr, SDDS_VERBOSE_PrintErrors);
347 exit(EXIT_FAILURE);
348 }
349
350 if (!multiColumnMode) {
351 if (!SDDS_StartTable(&table, xDim * yDim)) {
352 fprintf(stderr, "%s: SDDS error: unable to start table\n", argv[0]);
353 SDDS_PrintErrors(stderr, SDDS_VERBOSE_PrintErrors);
354 exit(EXIT_FAILURE);
355 }
356 } else {
357 if (!SDDS_StartTable(&table, dim[1])) {
358 fprintf(stderr, "%s: SDDS error: unable to start table\n", argv[0]);
359 SDDS_PrintErrors(stderr, SDDS_VERBOSE_PrintErrors);
360 exit(EXIT_FAILURE);
361 }
362 }
363
364 if (!array) {
365 if (!multiColumnMode) {
366 if (transpose) {
367 for (x = 0; x < xDim * yDim; x++) {
368 if (!SDDS_SetRowValues(&table, (SDDS_SET_BY_NAME | SDDS_PASS_BY_VALUE), x, "Image", rotimage[x], NULL)) {
369 fprintf(stderr, "%s: SDDS error: unable to write row %d\n", argv[0], x);
370 SDDS_PrintErrors(stderr, SDDS_VERBOSE_PrintErrors);
371 exit(EXIT_FAILURE);
372 }
373 }
374 } else {
375 for (x = 0; x < xDim * yDim; x++) {
376 if (!SDDS_SetRowValues(&table, (SDDS_SET_BY_NAME | SDDS_PASS_BY_VALUE), x, "Image", image[x], NULL)) {
377 fprintf(stderr, "%s: SDDS error: unable to write row %d\n", argv[0], x);
378 SDDS_PrintErrors(stderr, SDDS_VERBOSE_PrintErrors);
379 exit(EXIT_FAILURE);
380 }
381 }
382 }
383 } else {
384 for (i = 0; i < dim[1]; i++)
385 indexes[i] = xMin + xInterval * i;
386 if (!SDDS_SetColumnFromDoubles(&table, SDDS_SET_BY_NAME, indexes, dim[1], "Index")) {
387 SDDS_PrintErrors(stderr, SDDS_VERBOSE_PrintErrors);
388 exit(EXIT_FAILURE);
389 }
390 n = 0;
391
392 for (i = 0; i < dim[0]; i++) {
393 for (j = 0; j < dim[1]; j++) {
394 if (transpose) {
395 data[j] = image[n];
396 } else {
397 data[j] = rotimage[n];
398 }
399 n++;
400 }
401
402 if (!SDDS_SetColumnFromLongs(&table, SDDS_SET_BY_NAME, data, dim[1], columnNames[i])) {
403 SDDS_PrintErrors(stderr, SDDS_VERBOSE_PrintErrors);
404 exit(EXIT_FAILURE);
405 }
406 }
407 }
408 } else { /* Requesting writing of 2D array */
409 if (transpose) {
410 dim[0] = xDim;
411 dim[1] = yDim;
412 if (SDDS_SetArray(&table, "ImageArray", SDDS_CONTIGUOUS_DATA, rotimage, dim) == 0) {
413 fprintf(stderr, "%s: SDDS Error - unable to set array\n", argv[0]);
414 SDDS_PrintErrors(stderr, SDDS_VERBOSE_PrintErrors);
415 exit(EXIT_FAILURE);
416 }
417 } else {
418 dim[0] = yDim;
419 dim[1] = xDim;
420 if (SDDS_SetArray(&table, "ImageArray", SDDS_CONTIGUOUS_DATA, image, dim) == 0) {
421 fprintf(stderr, "%s: SDDS Error - unable to set array\n", argv[0]);
422 SDDS_PrintErrors(stderr, SDDS_VERBOSE_PrintErrors);
423 exit(EXIT_FAILURE);
424 }
425 }
426 }
427
428 if (!SDDS_WriteTable(&table)) {
429 fprintf(stderr, "%s: SDDS error: unable to write table\n", argv[0]);
430 SDDS_PrintErrors(stderr, SDDS_VERBOSE_PrintErrors);
431 exit(EXIT_FAILURE);
432 }
433
434 if (!SDDS_Terminate(&table)) {
435 fprintf(stderr, "%s: SDDS error: unable to terminate SDDS\n", argv[0]);
436 SDDS_PrintErrors(stderr, SDDS_VERBOSE_PrintErrors);
437 exit(EXIT_FAILURE);
438 }
439
440 /* Free allocated memory */
441 if (image)
442 free(image);
443 if (rotimage)
444 free(rotimage);
445 if (indexes)
446 free(indexes);
447 if (data)
448 free(data);
449 if (columnNames) {
450 free(columnNames);
451 }
452
453 return EXIT_SUCCESS;
454}
int32_t SDDS_SetRowValues(SDDS_DATASET *SDDS_dataset, int32_t mode, int64_t row,...)
int32_t SDDS_SetColumnFromDoubles(SDDS_DATASET *SDDS_dataset, int32_t mode, double *data, int64_t rows,...)
Sets the values for a single data column using double-precision floating-point numbers.
int32_t SDDS_SetArray(SDDS_DATASET *SDDS_dataset, char *array_name, int32_t mode, void *data_pointer, int32_t *dimension)
Sets the values of an array variable in the SDDS dataset using specified dimensions.
int32_t SDDS_SetColumnFromLongs(SDDS_DATASET *SDDS_dataset, int32_t mode, int32_t *data, int64_t rows,...)
Sets the values for a single data column using long integer numbers.
int32_t SDDS_Terminate(SDDS_DATASET *SDDS_dataset)
int32_t SDDS_DefineParameter1(SDDS_DATASET *SDDS_dataset, const char *name, const char *symbol, const char *units, const char *description, const char *format_string, int32_t type, void *fixed_value)
Defines a data parameter with a fixed numerical value.
int32_t SDDS_InitializeOutput(SDDS_DATASET *SDDS_dataset, int32_t data_mode, int32_t lines_per_row, const char *description, const char *contents, const char *filename)
Initializes the SDDS output dataset.
int32_t SDDS_DefineSimpleColumn(SDDS_DATASET *SDDS_dataset, const char *name, const char *unit, int32_t type)
Defines a simple data column within the SDDS dataset.
int32_t SDDS_DefineArray(SDDS_DATASET *SDDS_dataset, const char *name, const char *symbol, const char *units, const char *description, const char *format_string, int32_t type, int32_t field_length, int32_t dimensions, const char *group_name)
Defines a data array within the SDDS dataset.
int32_t SDDS_DefineColumn(SDDS_DATASET *SDDS_dataset, const char *name, const char *symbol, const char *units, const char *description, const char *format_string, int32_t type, int32_t field_length)
Defines a data column within the SDDS dataset.
int32_t SDDS_WriteLayout(SDDS_DATASET *SDDS_dataset)
Writes the SDDS layout header to the output file.
int32_t SDDS_DefineParameter(SDDS_DATASET *SDDS_dataset, const char *name, const char *symbol, const char *units, const char *description, const char *format_string, int32_t type, char *fixed_value)
Defines a data parameter with a fixed string value.
void SDDS_PrintErrors(FILE *fp, int32_t mode)
Prints recorded error messages to a specified file stream.
Definition SDDS_utils.c:432
#define SDDS_STRING
Identifier for the string data type.
Definition SDDStypes.h:85
#define SDDS_LONG
Identifier for the signed 32-bit integer data type.
Definition SDDStypes.h:61
#define SDDS_SHORT
Identifier for the signed short integer data type.
Definition SDDStypes.h:73
#define SDDS_CHARACTER
Identifier for the character data type.
Definition SDDStypes.h:91
#define SDDS_DOUBLE
Identifier for the double data type.
Definition SDDStypes.h:37

◆ process_cmdline_args()

int process_cmdline_args ( int argc,
char * argv[],
char * infile,
char * outfile )

Definition at line 464 of file image2sdds.c.

464 {
465 int i, j;
466 int cmderror = 0;
467 int scan_done = 0;
468
469 *infile = '\0';
470 *outfile = '\0';
471
472 /* Process command line options */
473 if (argc < 3)
474 cmderror++;
475 else {
476 strcpy(infile, argv[1]);
477 strcpy(outfile, argv[2]);
478
479 /* Begin parsing any optional args */
480 for (i = 3; i < argc && !cmderror; i++) {
481 for (j = 0; !scan_done && !cmderror && ptable[j].parm; j++) {
482 if (strncmp(ptable[j].parm, argv[i], ptable[j].len) == 0) {
483 switch (ptable[j].id) {
484
485 case PARM_DEBUG:
486 if (++i >= argc)
487 cmderror++;
488 else {
489 if (argv[i][0] == '-')
490 cmderror++;
491 else {
492 if (sscanf(argv[i], "%d", &debug) < 1)
493 cmderror++;
494 else
495 scan_done = 1;
496 }
497 }
498 break;
499
500 case PARM_XDIM:
501 if (++i >= argc)
502 cmderror++;
503 else {
504 if (argv[i][0] == '-')
505 cmderror++;
506 else {
507 if (sscanf(argv[i], "%d", &xDim) < 1)
508 cmderror++;
509 else
510 scan_done = 1;
511 }
512 }
513 break;
514
515 case PARM_YDIM:
516 if (++i >= argc)
517 cmderror++;
518 else {
519 if (argv[i][0] == '-')
520 cmderror++;
521 else {
522 if (sscanf(argv[i], "%d", &yDim) < 1)
523 cmderror++;
524 else
525 scan_done = 1;
526 }
527 }
528 break;
529
530 case PARM_XMIN:
531 if (++i >= argc)
532 cmderror++;
533 else {
534 if (argv[i][0] == '-')
535 cmderror++;
536 else {
537 if (sscanf(argv[i], "%lf", &xMin) < 1)
538 cmderror++;
539 else
540 scan_done = 1;
541 }
542 }
543 break;
544 case PARM_XMAX:
545 if (++i >= argc)
546 cmderror++;
547 else {
548 if (argv[i][0] == '-')
549 cmderror++;
550 else {
551 if (sscanf(argv[i], "%lf", &xMax) < 1)
552 cmderror++;
553 else {
554 scan_done = 1;
555 useXmax = 1;
556 }
557 }
558 }
559 break;
560 case PARM_YMIN:
561 if (++i >= argc)
562 cmderror++;
563 else {
564 if (argv[i][0] == '-')
565 cmderror++;
566 else {
567 if (sscanf(argv[i], "%lf", &yMin) < 1)
568 cmderror++;
569 else
570 scan_done = 1;
571 }
572 }
573 break;
574 case PARM_YMAX:
575 if (++i >= argc)
576 cmderror++;
577 else {
578 if (argv[i][0] == '-')
579 cmderror++;
580 else {
581 if (sscanf(argv[i], "%lf", &yMax) < 1)
582 cmderror++;
583 else {
584 scan_done = 1;
585 useYmax = 1;
586 }
587 }
588 }
589 break;
590
591 case PARM_TRANSPOSE:
592 transpose++;
593 scan_done = 1;
594 break;
595 case PARM_MULTICOLUMNMODE:
596 multiColumnMode = 1;
597 scan_done = 1;
598 break;
599
600 case PARM_ASCII:
601 asciiOutput++;
602 scan_done = 1;
603 break;
604
605 case PARM_HELP:
606 case PARM_QMARK:
607 usage(argv[0]);
608 exit(EXIT_SUCCESS);
609 break;
610
611 case PARM_CONTOUR:
612 contour++;
613 scan_done = 1;
614 break;
615
616 case PARM_2D:
617 array++;
618 scan_done = 1;
619 break;
620
621 default:
622 cmderror++;
623 break;
624 }
625 }
626 }
627 scan_done = 0;
628 }
629 }
630 if (cmderror) {
631 usage(argv[0]);
632 exit(EXIT_FAILURE);
633 }
634 return 0;
635}

◆ usage()

void usage ( char * name)

Definition at line 648 of file image2sdds.c.

648 {
649 pr(stderr, "Image2SDDS Utility %s\n", VERSION);
650 pr(stderr, "=============================\n");
651 pr(stderr, "Usage:\n");
652 pr(stderr, " image2sdds <IMAGE infile> <SDDS outfile>\n");
653 pr(stderr, " [-2d]\n");
654 pr(stderr, " [-ascii]\n");
655 pr(stderr, " [-contour]\n");
656 pr(stderr, " [-multicolumnmode]\n");
657 pr(stderr, " [-transpose]\n");
658 pr(stderr, " [-xdim <value>]\n");
659 pr(stderr, " [-ydim <value>]\n");
660 pr(stderr, " [-xmin <value>]\n");
661 pr(stderr, " [-xmax <value>]\n");
662 pr(stderr, " [-ymin <value>]\n");
663 pr(stderr, " [-ymax <value>]\n");
664 pr(stderr, " [-debug]\n");
665 pr(stderr, " [-help]\n");
666 pr(stderr, "Options:\n");
667 pr(stderr, " -2d Output SDDS file as a 2D array.\n");
668 pr(stderr, " -ascii Write SDDS file as ASCII (default is binary).\n");
669 pr(stderr, " -contour Generate SDDS headers for the sddscontour tool.\n");
670 pr(stderr, " -multicolumnmode Enable multi-column mode.\n");
671 pr(stderr, " -transpose Transpose the image about the diagonal.\n");
672 pr(stderr, " -xdim <value> Set X dimension of the image (default = %d).\n", XDIMENSION);
673 pr(stderr, " -ydim <value> Set Y dimension of the image (default = %d).\n", YDIMENSION);
674 pr(stderr, " -xmin <value> Set minimum X value.\n");
675 pr(stderr, " -xmax <value> Set maximum X value.\n");
676 pr(stderr, " -ymin <value> Set minimum Y value.\n");
677 pr(stderr, " -ymax <value> Set maximum Y value.\n");
678 pr(stderr, " -debug <level> Enable debug mode with the specified level.\n");
679 pr(stderr, " -? or -help Display this usage message.\n\n");
680 pr(stderr, "Purpose:\n");
681 pr(stderr, " Reads image data from <infile> and writes SDDS data to <outfile>.\n");
682 pr(stderr, " Supports various output formats and options for data manipulation.\n");
683}