From b12c8440da356cbf4deb91f9598d84852e9d8dce Mon Sep 17 00:00:00 2001 From: Christian C Date: Sat, 22 Mar 2025 23:03:04 -0700 Subject: Partial Conversion #1 --- src/prog.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/prog.c b/src/prog.c index 57bb93d..b118a22 100644 --- a/src/prog.c +++ b/src/prog.c @@ -88,6 +88,7 @@ int main(int argc, char** argv) uint32_t width, height; ImageMaskData_t starting_label = 1; ImageMaskData_t *masks = NULL; + struct ImageMask *masks_im = NULL; // Expect a directory to be passed as the first argument if (directory != NULL) { // Ensure the directory exists @@ -117,7 +118,8 @@ int main(int argc, char** argv) //----------------------------------------------- //-PROCESS-TIFF-TO-LABELS------------------------ //----------------------------------------------- - ImageMaskData_t *file_labels = tif_to_labels(fpath, &width, &height, &starting_label); + struct ImageMask *file_im = tif_to_labels(fpath, &width, &height, &starting_label); + ImageMaskData_t *file_labels = file_im->mask[0]; if (file_labels == NULL) { free(fpath); free(file_list[index]); @@ -126,8 +128,8 @@ int main(int argc, char** argv) //----------------------------------------------- //-COMBINE-LABELS-TO-GLOBAL-MASK----------------- //----------------------------------------------- - masks = combine_masks(masks, file_labels, width, height); - free(file_labels); + masks_im = combine_masks(masks_im, file_im); + free_image_mask(file_im); free(fpath); free(file_list[index]); } @@ -135,6 +137,7 @@ int main(int argc, char** argv) } } } + masks = masks_im->mask[0]; if (masks == NULL) { fprintf(stderr, "No masks found!\n"); return 1; -- cgit v1.2.1