aboutsummaryrefslogtreecommitdiff
path: root/src/indexamajig.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-03-18 11:33:29 +0100
committerThomas White <taw@physics.org>2010-03-18 11:33:29 +0100
commitf02e06759844c327b91cc5b88dd43536114005a0 (patch)
treea6e7926832c687c4b06a18f9d09f1cc569fbc217 /src/indexamajig.c
parentd871454363b0f19e1188da783cd4c931cd587cb2 (diff)
Perform intensity extraction on the image as it was before noise filtering
Diffstat (limited to 'src/indexamajig.c')
-rw-r--r--src/indexamajig.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/indexamajig.c b/src/indexamajig.c
index 9958369d..9bdfa5e0 100644
--- a/src/indexamajig.c
+++ b/src/indexamajig.c
@@ -280,6 +280,8 @@ int main(int argc, char *argv[])
char line[1024];
struct hdfile *hdfile;
struct image *simage;
+ float *data_for_measurement;
+ size_t data_size;
rval = fgets(line, 1023, fh);
if ( rval == NULL ) continue;
@@ -309,6 +311,27 @@ int main(int argc, char *argv[])
filter_cm(&image);
}
+ /* Take snapshot of image after CM subtraction but before
+ * the aggressive noise filter. */
+ data_size = image.width*image.height*sizeof(float);
+ data_for_measurement = malloc(data_size);
+
+ if ( config_noisefilter ) {
+ filter_noise(&image, data_for_measurement);
+ } else {
+
+ int x, y;
+
+ for ( x=0; x<image.width; x++ ) {
+ for ( y=0; y<image.height; y++ ) {
+ float val;
+ val = image.data[x+image.width*y];
+ data_for_measurement[x+image.width*y] = val;
+ }
+ }
+
+ }
+
/* Perform 'fine' peak search */
search_peaks(&image);
@@ -338,7 +361,7 @@ int main(int argc, char *argv[])
/* Measure intensities if requested */
if ( config_nearbragg ) {
/* Use original data (temporarily) */
- simage->data = image.data;
+ simage->data = data_for_measurement;
output_intensities(simage, image.indexed_cell);
simage->data = NULL;
}
@@ -365,6 +388,7 @@ done:
free(image.data);
free(image.det.panels);
image_feature_list_free(image.features);
+ free(data_for_measurement);
hdfile_close(hdfile);
H5close();