From 3cfdec959d9ae00d6b44391cc8daec5ded831295 Mon Sep 17 00:00:00 2001 From: Christian C Date: Sun, 23 Mar 2025 15:43:59 -0700 Subject: Refactor mask field --- lib/seg/util.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/seg/util.c') diff --git a/lib/seg/util.c b/lib/seg/util.c index 6eee1a2..afced0a 100644 --- a/lib/seg/util.c +++ b/lib/seg/util.c @@ -209,8 +209,8 @@ ImageMask* combine_masks(ImageMask *destination, ImageMask *extra_labels) } for (size_t y = 0; y < destination->height; y++) { for (size_t x = 0; x < destination->width; x++) { - if (destination->mask[y][x] == 0) { - destination->mask[y][x] = extra_labels->mask[y][x]; + if (destination->image[y][x] == 0) { + destination->image[y][x] = extra_labels->image[y][x]; } } } @@ -275,21 +275,21 @@ ImageMask* tif_to_labels(char* tif_file_name, uint32_t *width, uint32_t *height, TIFFClose(tif); return NULL; } - if (im_data->mask == NULL) { + if (im_data->image == NULL) { fprintf(stderr, "Memory allocation error\n"); free_image_mask(im_data); free(image_data); TIFFClose(tif); return NULL; } - if (im_data->mask[0] == NULL) { + if (im_data->image[0] == NULL) { fprintf(stderr, "Memory allocation error\n"); free_image_mask(im_data); free(image_data); TIFFClose(tif); return NULL; } - ImageMaskData_t *labels = im_data->mask[0]; + ImageMaskData_t *labels = im_data->image[0]; /* labels = (ImageMaskData_t*)calloc((*width)*(*height),sizeof(ImageMaskData_t)); if (labels == NULL) { -- cgit v1.2.1