/********************************************* * * file mainsk.c * * Functions: This file contains * main * show_mainsk_usage * * Purpose: * This file contains the main calling * routine that calls the erosion, * dilation, outline, and skeleton * functions. * * External Calls: * imageio.c - create_image_file * read_image_array * write_image_array * get_image_size * allocate_image_array * free_image_array * ed.c - erosion * dilation * mask_erosion * mask_dilation * interior_outline * exterior_outline * opening * closing * skeleton.c - thinning * skeleton * dilate_not_join * special_opening * special_closing * edm * mat * * Modifications: * 7 March 1993 - created * 21 August 1998 - modified to work on entire * images at once. * 19 September 1998 - modified to work with * all I O routines in imageio.c. * ***********************************************/ #include "cips.h" main(argc, argv) int argc; char *argv[]; { char name1[80], name2[80], type[80]; int i, j, mask_type, number, threshold; long length, width; short value; short **the_image; short **out_image; /**************************************** * * Interpret the command line parameters. * *****************************************/ if(argc < 5){ show_mainsk_usage(); exit(0); } strcpy(name1, argv[1]); strcpy(name2, argv[2]); strcpy(type, argv[3]); value = atoi(argv[4]); if(does_not_exist(name1)){ printf("\nERROR input file %s does not exist", name1); exit(0); } if(argc >= 5){ threshold = atoi(argv[5]); mask_type = atoi(argv[5]); } if(argc >= 6) number = atoi(argv[6]); /**************************************** * * Allocate the arrays, create the output * file, read data. * *****************************************/ get_image_size(name1, &length, &width); the_image = allocate_image_array(length, width); out_image = allocate_image_array(length, width); create_image_file(name1, name2); read_image_array(name1, the_image); for(i=0; i