aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/prog.c9
1 files changed, 6 insertions, 3 deletions
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;