aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src/image.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2017-03-06 17:15:49 +0100
committerThomas White <taw@physics.org>2017-09-07 16:29:54 +0200
commit2ea5c535ac15aa0e429eb985a82f326cd2bce7c2 (patch)
tree07727b8b3cc64849338189a7f01f489732c574dd /libcrystfel/src/image.c
parent141fb2cd3af6ea14098cc65ba3c64f93f72c9cf3 (diff)
remove_flagged_crystals(): Return the number of crystals removed
Diffstat (limited to 'libcrystfel/src/image.c')
-rw-r--r--libcrystfel/src/image.c5
1 files changed, 4 insertions, 1 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;
}