diff options
-rw-r--r-- | libcrystfel/src/image.c | 5 | ||||
-rw-r--r-- | libcrystfel/src/image.h | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/libcrystfel/src/image.c b/libcrystfel/src/image.c index aad5017c..8de16bd5 100644 --- a/libcrystfel/src/image.c +++ b/libcrystfel/src/image.c @@ -288,9 +288,10 @@ void image_add_crystal(struct image *image, Crystal *cryst) } -void remove_flagged_crystals(struct image *image) +int remove_flagged_crystals(struct image *image) { int i; + int n_bad = 0; for ( i=0; i<image->n_crystals; i++ ) { if ( crystal_get_user_flag(image->crystals[i]) ) { @@ -302,9 +303,11 @@ void remove_flagged_crystals(struct image *image) image->crystals[j] = image->crystals[j+1]; } image->n_crystals--; + n_bad++; } } + return n_bad; } diff --git a/libcrystfel/src/image.h b/libcrystfel/src/image.h index d7884e4c..c900bd29 100644 --- a/libcrystfel/src/image.h +++ b/libcrystfel/src/image.h @@ -257,7 +257,7 @@ extern struct imagefeature *image_get_feature(ImageFeatureList *flist, int idx); extern ImageFeatureList *sort_peaks(ImageFeatureList *flist); extern void image_add_crystal(struct image *image, Crystal *cryst); -extern void remove_flagged_crystals(struct image *image); +extern int remove_flagged_crystals(struct image *image); extern void free_all_crystals(struct image *image); /* Image files */ |