From 8f99dad3c42ab08d631b1ac02b195b33944c7240 Mon Sep 17 00:00:00 2001 From: Yaroslav Gevorkov Date: Thu, 24 May 2018 10:07:11 +0200 Subject: Add "peakfinder9" --- src/indexamajig.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++-- src/process_image.c | 13 +++++++++++++ src/process_image.h | 10 +++++++++- 3 files changed, 69 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/indexamajig.c b/src/indexamajig.c index 38d83d58..20d9faa1 100644 --- a/src/indexamajig.c +++ b/src/indexamajig.c @@ -14,6 +14,7 @@ * 2012 Lorenzo Galli * 2012 Chunhong Yoon * 2017 Valerio Mariani + * 2017-2018 Yaroslav Gevorkov * * This file is part of CrystFEL. * @@ -48,6 +49,7 @@ #include #include #include +#include #include "utils.h" #include "hdf5-file.h" @@ -84,7 +86,7 @@ static void show_help(const char *s) " --profile Show timing data for performance monitoring\n" " --temp-dir= Put the temporary folder under \n" "\nPeak search options:\n\n" -" --peaks= Peak search method (zaef,peakfinder8,hdf5,cxi)\n" +" --peaks= Peak search method (zaef,peakfinder8,peakfinder9,hdf5,cxi)\n" " Default: zaef\n" " --peak-radius= Integration radii for peak search\n" " --min-peaks= Minimum number of peaks for indexing\n" @@ -98,7 +100,7 @@ static void show_help(const char *s) " --min-gradient= Minimum squared gradient\n" " (zaef only) Default: 100,000\n" " --min-snr= Minimum signal/noise ratio for peaks\n" -" (zaef,pekafinder8 only) Default: 5\n" +" (zaef,pekafinder8, pekafinder9 only) Default: 5\n" " --min-pix-count= Minimum number of pixels per peak\n" " (peakfinder8 only) Default: 2\n" " --max-pix-count= Maximum number of pixels per peak\n" @@ -109,6 +111,15 @@ static void show_help(const char *s) " (peakfinder8 only) Default: 0\n" " --max-res= Maximum resolution for peak search (in pixels)\n" " (peakfinder8 only) Default: 1200\n" +" --window-radius= (peakFinder9 only) defines the radius in which the " +" local background is estimated\n" +" --sig-fac-biggest-pix= (peakFinder9 only) min snr of the biggest pixel in " +" the peak\n" +" --sig-fac-peak-pix= (peakFinder9 only) min snr of a peak pixel\n" +" --min-sig= (peakFinder9 only) minimum standard deviation of " +" the background\n" +" --min-peak-over-neighbour= (peakFinder9 only) just for speed. Biggest pixel" +" in peak must be n higher than this.\n" " --no-use-saturated Reject saturated peaks\n" " --no-revalidate Don't re-integrate and check HDF5 peaks\n" " --no-half-pixel-shift\n" @@ -212,6 +223,7 @@ static void add_geom_beam_stuff_to_field_list(struct imagefile_field_list *copym int main(int argc, char *argv[]) { int c; + unsigned int tmp_enum; char *filename = NULL; char *outfile = NULL; FILE *fh; @@ -260,6 +272,12 @@ int main(int argc, char *argv[]) iargs.min_res = 0; iargs.max_res = 1200; iargs.local_bg_radius = 3; + iargs.sig_fac_biggest_pix = 7.0; /* peak finder 9 */ + iargs.sig_fac_peak_pix = 6.0; + iargs.sig_fac_whole_peak = 9.0; + iargs.min_sig = 11.0; + iargs.min_peak_over_neighbour = -INFINITY; + iargs.window_radius = 3; iargs.check_hdf5_snr = 0; iargs.det = NULL; iargs.peaks = PEAK_ZAEF; @@ -405,6 +423,11 @@ int main(int argc, char *argv[]) {"serial-start", 1, NULL, 44}, {"felix-domega", 1, NULL, 45}, {"felix-max-internal-angle", 1, NULL, 46}, + {"sig-fac-biggest-pix" ,1, NULL, 47}, + {"sig-fac-peak-pix" ,1, NULL, 48}, + {"min-sig" ,1, NULL, 49}, + {"min-peak-over-neighbour" ,1, NULL, 50}, + {"window-radius" ,1, NULL, 51}, {0, 0, NULL, 0} }; @@ -504,6 +527,7 @@ int main(int argc, char *argv[]) case 11 : iargs.min_snr = strtof(optarg, NULL); + iargs.sig_fac_whole_peak = iargs.min_snr; break; case 13 : @@ -731,6 +755,25 @@ int main(int argc, char *argv[]) } break; + case 47: + iargs.sig_fac_biggest_pix = strtof(optarg, NULL); + break; + + case 48: + iargs.sig_fac_peak_pix = strtof(optarg, NULL); + break; + + case 49: + iargs.min_sig = strtof(optarg, NULL); + break; + + case 50: + iargs.min_peak_over_neighbour = strtof(optarg, NULL); + break; + + case 51: + iargs.window_radius = atoi(optarg); + case 0 : break; @@ -789,6 +832,8 @@ int main(int argc, char *argv[]) iargs.peaks = PEAK_HDF5; } else if ( strcmp(speaks, "cxi") == 0 ) { iargs.peaks = PEAK_CXI; + } else if ( strcmp(speaks, "peakfinder9") == 0 ) { + iargs.peaks = PEAK_PEAKFINDER9; } else { ERROR("Unrecognised peak detection method '%s'\n", speaks); return 1; diff --git a/src/process_image.c b/src/process_image.c index 4b02e694..be4fa094 100644 --- a/src/process_image.c +++ b/src/process_image.c @@ -223,6 +223,19 @@ void process_image(const struct index_args *iargs, struct pattern_args *pargs, } break; + case PEAK_PEAKFINDER9: + if ( search_peaks_peakfinder9(&image, + iargs->sig_fac_biggest_pix, + iargs->sig_fac_peak_pix, + iargs->sig_fac_whole_peak, iargs->min_sig, + iargs->min_peak_over_neighbour, + iargs->window_radius) ) + { + ERROR("Couldn't get enough memory to perform " + "peakFinder9.\n"); + } + break; + } restore_image_data(image.dp, image.det, prefilter); diff --git a/src/process_image.h b/src/process_image.h index 6d170a39..2b5bd19e 100644 --- a/src/process_image.h +++ b/src/process_image.h @@ -9,6 +9,7 @@ * Authors: * 2010-2016 Thomas White * 2014-2017 Valerio Mariani + * 2017-2018 Yaroslav Gevorkov * * This file is part of CrystFEL. * @@ -44,7 +45,8 @@ struct index_args; enum { - PEAK_PEAKFINDER8, + PEAK_PEAKFINDER9, + PEAK_PEAKFINDER8, PEAK_ZAEF, PEAK_HDF5, PEAK_CXI, @@ -83,6 +85,12 @@ struct index_args int max_pix_count; int local_bg_radius; int min_peaks; + float sig_fac_biggest_pix; + float sig_fac_peak_pix; + float sig_fac_whole_peak; + float min_sig; + float min_peak_over_neighbour; + int window_radius; struct imagefile_field_list *copyme; int integrate_saturated; int use_saturated; -- cgit v1.2.3 From c1be9fab0693fb4e51755ea83954e6cf4c65f7f0 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Thu, 24 May 2018 10:30:14 +0200 Subject: Formatting --- src/process_image.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/process_image.c b/src/process_image.c index be4fa094..5aaff408 100644 --- a/src/process_image.c +++ b/src/process_image.c @@ -225,11 +225,12 @@ void process_image(const struct index_args *iargs, struct pattern_args *pargs, case PEAK_PEAKFINDER9: if ( search_peaks_peakfinder9(&image, - iargs->sig_fac_biggest_pix, - iargs->sig_fac_peak_pix, - iargs->sig_fac_whole_peak, iargs->min_sig, - iargs->min_peak_over_neighbour, - iargs->window_radius) ) + iargs->sig_fac_biggest_pix, + iargs->sig_fac_peak_pix, + iargs->sig_fac_whole_peak, + iargs->min_sig, + iargs->min_peak_over_neighbour, + iargs->window_radius) ) { ERROR("Couldn't get enough memory to perform " "peakFinder9.\n"); -- cgit v1.2.3 From 4f087e3954699ba96d2915af8d82fa10ebd53280 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Thu, 24 May 2018 10:31:53 +0200 Subject: Update authorship and copyright dates --- src/indexamajig.c | 2 +- src/process_image.c | 2 +- src/process_image.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/indexamajig.c b/src/indexamajig.c index 20d9faa1..71a8efa9 100644 --- a/src/indexamajig.c +++ b/src/indexamajig.c @@ -3,7 +3,7 @@ * * Index patterns, output hkl+intensity etc. * - * Copyright © 2012-2017 Deutsches Elektronen-Synchrotron DESY, + * Copyright © 2012-2018 Deutsches Elektronen-Synchrotron DESY, * a research centre of the Helmholtz Association. * Copyright © 2012 Richard Kirian * Copyright © 2012 Lorenzo Galli diff --git a/src/process_image.c b/src/process_image.c index 5aaff408..b4b2eb70 100644 --- a/src/process_image.c +++ b/src/process_image.c @@ -3,7 +3,7 @@ * * The processing pipeline for one image * - * Copyright © 2012-2017 Deutsches Elektronen-Synchrotron DESY, + * Copyright © 2012-2018 Deutsches Elektronen-Synchrotron DESY, * a research centre of the Helmholtz Association. * * Authors: diff --git a/src/process_image.h b/src/process_image.h index 2b5bd19e..e44de48f 100644 --- a/src/process_image.h +++ b/src/process_image.h @@ -3,7 +3,7 @@ * * The processing pipeline for one image * - * Copyright © 2012-2017 Deutsches Elektronen-Synchrotron DESY, + * Copyright © 2012-2018 Deutsches Elektronen-Synchrotron DESY, * a research centre of the Helmholtz Association. * * Authors: -- cgit v1.2.3 From d3f9ed0a184bea13ba36c4291b593ecd7a91fc14 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Thu, 24 May 2018 10:32:43 +0200 Subject: Generalise peakfinder9 error messages, and fail if not compiled in --- src/process_image.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/process_image.c b/src/process_image.c index b4b2eb70..57f40142 100644 --- a/src/process_image.c +++ b/src/process_image.c @@ -232,8 +232,14 @@ void process_image(const struct index_args *iargs, struct pattern_args *pargs, iargs->min_peak_over_neighbour, iargs->window_radius) ) { - ERROR("Couldn't get enough memory to perform " - "peakFinder9.\n"); + if ( image.event != NULL ) { + ERROR("Failed to find peaks in image %s" + "(event %s).\n", image.filename, + get_event_string(image.event)); + } else { + ERROR("Failed to find peaks in image %s.", + image.filename); + } } break; -- cgit v1.2.3 From e9ffe115ba2ce1db0667dabad5e6a9b42a2d359a Mon Sep 17 00:00:00 2001 From: Thomas White Date: Thu, 24 May 2018 10:38:48 +0200 Subject: Fix typos in help --- src/indexamajig.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/indexamajig.c b/src/indexamajig.c index 71a8efa9..113ad04b 100644 --- a/src/indexamajig.c +++ b/src/indexamajig.c @@ -100,7 +100,7 @@ static void show_help(const char *s) " --min-gradient= Minimum squared gradient\n" " (zaef only) Default: 100,000\n" " --min-snr= Minimum signal/noise ratio for peaks\n" -" (zaef,pekafinder8, pekafinder9 only) Default: 5\n" +" (zaef,peakfinder8, peakfinder9 only) Default: 5\n" " --min-pix-count= Minimum number of pixels per peak\n" " (peakfinder8 only) Default: 2\n" " --max-pix-count= Maximum number of pixels per peak\n" -- cgit v1.2.3 From 2c3009115b8cc34c6ea085e45856244457198541 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Thu, 24 May 2018 10:39:25 +0200 Subject: Formatting in --help --- src/indexamajig.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/indexamajig.c b/src/indexamajig.c index 113ad04b..714af5cd 100644 --- a/src/indexamajig.c +++ b/src/indexamajig.c @@ -111,14 +111,14 @@ static void show_help(const char *s) " (peakfinder8 only) Default: 0\n" " --max-res= Maximum resolution for peak search (in pixels)\n" " (peakfinder8 only) Default: 1200\n" -" --window-radius= (peakFinder9 only) defines the radius in which the " -" local background is estimated\n" -" --sig-fac-biggest-pix= (peakFinder9 only) min snr of the biggest pixel in " -" the peak\n" -" --sig-fac-peak-pix= (peakFinder9 only) min snr of a peak pixel\n" -" --min-sig= (peakFinder9 only) minimum standard deviation of " +" --window-radius= (peakFinder9 only) defines the radius in which the " +" local background is estimated\n" +" --sig-fac-biggest-pix= (peakFinder9 only) min snr of the biggest pixel in " +" the peak\n" +" --sig-fac-peak-pix= (peakFinder9 only) min snr of a peak pixel\n" +" --min-sig= (peakFinder9 only) minimum standard deviation of " " the background\n" -" --min-peak-over-neighbour= (peakFinder9 only) just for speed. Biggest pixel" +" --min-peak-over-neighbour= (peakFinder9 only) just for speed. Biggest pixel" " in peak must be n higher than this.\n" " --no-use-saturated Reject saturated peaks\n" " --no-revalidate Don't re-integrate and check HDF5 peaks\n" -- cgit v1.2.3 From 21e6b3e38e9df7e0fa3cf647a8eb8041ea019199 Mon Sep 17 00:00:00 2001 From: Yaroslav Gevorkov Date: Thu, 24 May 2018 15:47:34 +0200 Subject: Change getopt numbers to avoid overlap with chars --- src/indexamajig.c | 206 +++++++++++++++++++++++++++--------------------------- 1 file changed, 103 insertions(+), 103 deletions(-) (limited to 'src') diff --git a/src/indexamajig.c b/src/indexamajig.c index 714af5cd..cab727a5 100644 --- a/src/indexamajig.c +++ b/src/indexamajig.c @@ -374,60 +374,60 @@ int main(int argc, char *argv[]) {"use-saturated", 0, &iargs.use_saturated, 1}, /* Long-only options with arguments */ - {"peaks", 1, NULL, 2}, - {"cell-reduction", 1, NULL, 3}, - {"min-gradient", 1, NULL, 4}, - {"record", 1, NULL, 5}, - {"cpus", 1, NULL, 6}, - {"cpugroup", 1, NULL, 7}, - {"cpuoffset", 1, NULL, 8}, - {"hdf5-peaks", 1, NULL, 9}, - {"copy-hdf5-field", 1, NULL, 10}, - {"min-snr", 1, NULL, 11}, - {"tolerance", 1, NULL, 13}, - {"int-radius", 1, NULL, 14}, - {"median-filter", 1, NULL, 15}, - {"integration", 1, NULL, 16}, - {"temp-dir", 1, NULL, 17}, - {"int-diag", 1, NULL, 18}, - {"push-res", 1, NULL, 19}, - {"res-push", 1, NULL, 19}, /* compat */ - {"peak-radius", 1, NULL, 20}, - {"highres", 1, NULL, 21}, - {"fix-profile-radius", 1, NULL, 22}, - {"fix-bandwidth", 1, NULL, 23}, - {"fix-divergence", 1, NULL, 24}, - {"felix-options", 1, NULL, 25}, - {"min-pix-count", 1, NULL, 26}, - {"max-pix-count", 1, NULL, 27}, - {"local-bg-radius", 1, NULL, 28}, - {"min-res", 1, NULL, 29}, - {"max-res", 1, NULL, 30}, - {"min-peaks", 1, NULL, 31}, - {"taketwo-member-threshold", 1, NULL, 32}, - {"taketwo-member-thresh", 1, NULL, 32}, /* compat */ - {"taketwo-len-tolerance", 1, NULL, 33}, - {"taketwo-len-tol", 1, NULL, 33}, /* compat */ - {"taketwo-angle-tolerance", 1, NULL, 34}, - {"taketwo-angle-tol", 1, NULL, 34}, /* compat */ - {"taketwo-trace-tolerance", 1, NULL, 35}, - {"taketwo-trace-tol", 1, NULL, 35}, /* compat */ - {"felix-tthrange-min", 1, NULL, 36}, - {"felix-tthrange-max", 1, NULL, 37}, - {"felix-min-visits", 1, NULL, 38}, - {"felix-min-completeness", 1, NULL, 39}, - {"felix-max-uniqueness", 1, NULL, 40}, - {"felix-num-voxels", 1, NULL, 41}, - {"felix-fraction-max-visits",1, NULL, 42}, - {"felix-sigma", 1, NULL, 43}, - {"serial-start", 1, NULL, 44}, - {"felix-domega", 1, NULL, 45}, - {"felix-max-internal-angle", 1, NULL, 46}, - {"sig-fac-biggest-pix" ,1, NULL, 47}, - {"sig-fac-peak-pix" ,1, NULL, 48}, - {"min-sig" ,1, NULL, 49}, - {"min-peak-over-neighbour" ,1, NULL, 50}, - {"window-radius" ,1, NULL, 51}, + {"peaks", 1, NULL, 302}, + {"cell-reduction", 1, NULL, 303}, + {"min-gradient", 1, NULL, 304}, + {"record", 1, NULL, 305}, + {"cpus", 1, NULL, 306}, + {"cpugroup", 1, NULL, 307}, + {"cpuoffset", 1, NULL, 308}, + {"hdf5-peaks", 1, NULL, 309}, + {"copy-hdf5-field", 1, NULL, 310}, + {"min-snr", 1, NULL, 311}, + {"tolerance", 1, NULL, 313}, + {"int-radius", 1, NULL, 314}, + {"median-filter", 1, NULL, 315}, + {"integration", 1, NULL, 316}, + {"temp-dir", 1, NULL, 317}, + {"int-diag", 1, NULL, 318}, + {"push-res", 1, NULL, 319}, + {"res-push", 1, NULL, 319}, /* compat */ + {"peak-radius", 1, NULL, 320}, + {"highres", 1, NULL, 321}, + {"fix-profile-radius", 1, NULL, 322}, + {"fix-bandwidth", 1, NULL, 323}, + {"fix-divergence", 1, NULL, 324}, + {"felix-options", 1, NULL, 325}, + {"min-pix-count", 1, NULL, 326}, + {"max-pix-count", 1, NULL, 327}, + {"local-bg-radius", 1, NULL, 328}, + {"min-res", 1, NULL, 329}, + {"max-res", 1, NULL, 330}, + {"min-peaks", 1, NULL, 331}, + {"taketwo-member-threshold", 1, NULL, 332}, + {"taketwo-member-thresh", 1, NULL, 332}, /* compat */ + {"taketwo-len-tolerance", 1, NULL, 333}, + {"taketwo-len-tol", 1, NULL, 333}, /* compat */ + {"taketwo-angle-tolerance", 1, NULL, 334}, + {"taketwo-angle-tol", 1, NULL, 334}, /* compat */ + {"taketwo-trace-tolerance", 1, NULL, 335}, + {"taketwo-trace-tol", 1, NULL, 335}, /* compat */ + {"felix-tthrange-min", 1, NULL, 336}, + {"felix-tthrange-max", 1, NULL, 337}, + {"felix-min-visits", 1, NULL, 338}, + {"felix-min-completeness", 1, NULL, 339}, + {"felix-max-uniqueness", 1, NULL, 340}, + {"felix-num-voxels", 1, NULL, 341}, + {"felix-fraction-max-visits",1, NULL, 342}, + {"felix-sigma", 1, NULL, 343}, + {"serial-start", 1, NULL, 344}, + {"felix-domega", 1, NULL, 345}, + {"felix-max-internal-angle", 1, NULL, 346}, + {"sig-fac-biggest-pix" ,1, NULL,347}, + {"sig-fac-peak-pix" ,1, NULL,348}, + {"min-sig" ,1, NULL,349}, + {"min-peak-over-neighbour" ,1, NULL,350}, + {"window-radius" ,1, NULL,351}, {0, 0, NULL, 0} }; @@ -485,11 +485,11 @@ int main(int argc, char *argv[]) iargs.threshold = strtof(optarg, NULL); break; - case 2 : + case 302 : speaks = strdup(optarg); break; - case 3 : + case 303 : ERROR("The option '--cell-reduction' is no longer " "used.\n" "The complete indexing behaviour is now " @@ -498,63 +498,63 @@ int main(int argc, char *argv[]) "available methods.\n"); return 1; - case 4 : + case 304 : iargs.min_gradient = strtof(optarg, NULL); break; - case 5 : + case 305 : ERROR("The option '--record' is no longer used.\n" "Use '--no-peaks-in-stream' and" "'--no-refls-in-stream' if you need to control" "the contents of the stream.\n"); return 1; - case 6 : - case 7 : - case 8 : + case 306 : + case 307 : + case 308 : ERROR("The options --cpus, --cpugroup and --cpuoffset" " are no longer used by indexamajig.\n"); break; - case 9 : + case 309 : free(command_line_peak_path); command_line_peak_path = strdup(optarg); break; - case 10 : + case 310 : add_imagefile_field(iargs.copyme, optarg); break; - case 11 : + case 311 : iargs.min_snr = strtof(optarg, NULL); iargs.sig_fac_whole_peak = iargs.min_snr; break; - case 13 : + case 313 : toler = strdup(optarg); break; - case 14 : + case 314 : intrad = strdup(optarg); break; - case 15 : + case 315 : iargs.median_filter = atoi(optarg); break; - case 16 : + case 316 : int_str = strdup(optarg); break; - case 17 : + case 317 : tempdir = strdup(optarg); break; - case 18 : + case 318 : int_diag = strdup(optarg); break; - case 19 : + case 319 : if ( sscanf(optarg, "%f", &iargs.push_res) != 1 ) { ERROR("Invalid value for --push-res\n"); return 1; @@ -563,11 +563,11 @@ int main(int argc, char *argv[]) have_push_res = 1; break; - case 20 : + case 320 : pkrad = strdup(optarg); break; - case 21 : + case 321 : if ( sscanf(optarg, "%f", &iargs.highres) != 1 ) { ERROR("Invalid value for --highres\n"); return 1; @@ -576,7 +576,7 @@ int main(int argc, char *argv[]) iargs.highres = 1.0 / (iargs.highres/1e10); break; - case 22 : + case 322 : if ( sscanf(optarg, "%f", &iargs.fix_profile_r) != 1 ) { ERROR("Invalid value for " "--fix-profile-radius\n"); @@ -584,50 +584,50 @@ int main(int argc, char *argv[]) } break; - case 23 : + case 323 : if ( sscanf(optarg, "%f", &iargs.fix_bandwidth) != 1 ) { ERROR("Invalid value for --fix-bandwidth\n"); return 1; } break; - case 24 : + case 324 : if ( sscanf(optarg, "%f", &iargs.fix_divergence) != 1 ) { ERROR("Invalid value for --fix-divergence\n"); return 1; } break; - case 25 : + case 325 : ERROR("--felix-options is no longer used.\n"); ERROR("See --help for the new Felix options.\n"); return 1; - case 26: + case 326: iargs.min_pix_count = atoi(optarg); break; - case 27: + case 327: iargs.max_pix_count = atoi(optarg); break; - case 28: + case 328: iargs.local_bg_radius = atoi(optarg); break; - case 29: + case 329: iargs.min_res = atoi(optarg); break; - case 30: + case 330: iargs.max_res = atoi(optarg); break; - case 31: + case 331: iargs.min_peaks = atoi(optarg); break; - case 32: + case 332: if ( sscanf(optarg, "%i", &iargs.taketwo_opts.member_thresh) != 1 ) { ERROR("Invalid value for --taketwo-member-threshold\n"); @@ -635,7 +635,7 @@ int main(int argc, char *argv[]) } break; - case 33: + case 333: if ( sscanf(optarg, "%lf", &iargs.taketwo_opts.len_tol) != 1 ) { ERROR("Invalid value for --taketwo-len-tolerance\n"); @@ -645,7 +645,7 @@ int main(int argc, char *argv[]) iargs.taketwo_opts.len_tol *= 1e10; break; - case 34: + case 334: if ( sscanf(optarg, "%lf", &iargs.taketwo_opts.angle_tol) != 1 ) { ERROR("Invalid value for --taketwo-angle-tolerance\n"); @@ -655,7 +655,7 @@ int main(int argc, char *argv[]) iargs.taketwo_opts.angle_tol = deg2rad(iargs.taketwo_opts.angle_tol); break; - case 35: + case 335: if ( sscanf(optarg, "%lf", &iargs.taketwo_opts.trace_tol) != 1 ) { ERROR("Invalid value for --taketwo-trace-tolerance\n"); @@ -665,7 +665,7 @@ int main(int argc, char *argv[]) iargs.taketwo_opts.trace_tol = deg2rad(iargs.taketwo_opts.trace_tol); break; - case 36: + case 336: if ( sscanf(optarg, "%lf", &iargs.felix_opts.ttmin) != 1 ) { ERROR("Invalid value for --felix-tthrange-min\n"); @@ -674,7 +674,7 @@ int main(int argc, char *argv[]) iargs.felix_opts.ttmin = deg2rad(iargs.felix_opts.ttmin); break; - case 37: + case 337: if ( sscanf(optarg, "%lf", &iargs.felix_opts.ttmax) != 1 ) { ERROR("Invalid value for --felix-tthrange-max\n"); @@ -683,7 +683,7 @@ int main(int argc, char *argv[]) iargs.felix_opts.ttmax = deg2rad(iargs.felix_opts.ttmax); break; - case 38: + case 338: if ( sscanf(optarg, "%i", &iargs.felix_opts.min_visits) != 1 ) { ERROR("Invalid value for --felix-min-visits\n"); @@ -691,7 +691,7 @@ int main(int argc, char *argv[]) } break; - case 39: + case 339: if ( sscanf(optarg, "%lf", &iargs.felix_opts.min_completeness) != 1 ) { ERROR("Invalid value for --felix-min-completeness\n"); @@ -699,7 +699,7 @@ int main(int argc, char *argv[]) } break; - case 40: + case 340: if ( sscanf(optarg, "%lf", &iargs.felix_opts.max_uniqueness) != 1 ) { ERROR("Invalid value for --felix-max-uniqueness\n"); @@ -707,7 +707,7 @@ int main(int argc, char *argv[]) } break; - case 41: + case 341: if ( sscanf(optarg, "%i", &iargs.felix_opts.n_voxels) != 1 ) { ERROR("Invalid value for --felix-num-voxels\n"); @@ -715,7 +715,7 @@ int main(int argc, char *argv[]) } break; - case 42: + case 342: if ( sscanf(optarg, "%lf", &iargs.felix_opts.fraction_max_visits) != 1 ) { ERROR("Invalid value for --felix-fraction-max-visits\n"); @@ -723,7 +723,7 @@ int main(int argc, char *argv[]) } break; - case 43: + case 343: if ( sscanf(optarg, "%lf", &iargs.felix_opts.sigma) != 1 ) { ERROR("Invalid value for --felix-sigma\n"); @@ -731,7 +731,7 @@ int main(int argc, char *argv[]) } break; - case 44: + case 344: if ( sscanf(optarg, "%i", &serial_start) != 1 ) { ERROR("Invalid value for --serial-start\n"); @@ -739,7 +739,7 @@ int main(int argc, char *argv[]) } break; - case 45: + case 345: if ( sscanf(optarg, "%lf", &iargs.felix_opts.domega) != 1 ) { ERROR("Invalid value for --felix-domega\n"); @@ -747,7 +747,7 @@ int main(int argc, char *argv[]) } break; - case 46: + case 346: if ( sscanf(optarg, "%lf", &iargs.felix_opts.max_internal_angle) != 1 ) { ERROR("Invalid value for --felix-max-internal-angle\n"); @@ -755,23 +755,23 @@ int main(int argc, char *argv[]) } break; - case 47: + case 347: iargs.sig_fac_biggest_pix = strtof(optarg, NULL); break; - case 48: + case 348: iargs.sig_fac_peak_pix = strtof(optarg, NULL); break; - case 49: + case 349: iargs.min_sig = strtof(optarg, NULL); break; - case 50: + case 350: iargs.min_peak_over_neighbour = strtof(optarg, NULL); break; - case 51: + case 351: iargs.window_radius = atoi(optarg); case 0 : -- cgit v1.2.3 From 7a95b1b621268329f2b1ffe1076c03a71f3956b7 Mon Sep 17 00:00:00 2001 From: Yaroslav Gevorkov Date: Thu, 24 May 2018 15:48:26 +0200 Subject: Delete obsolete include and variable --- src/indexamajig.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'src') diff --git a/src/indexamajig.c b/src/indexamajig.c index cab727a5..9e265191 100644 --- a/src/indexamajig.c +++ b/src/indexamajig.c @@ -49,7 +49,6 @@ #include #include #include -#include #include "utils.h" #include "hdf5-file.h" @@ -223,7 +222,6 @@ static void add_geom_beam_stuff_to_field_list(struct imagefile_field_list *copym int main(int argc, char *argv[]) { int c; - unsigned int tmp_enum; char *filename = NULL; char *outfile = NULL; FILE *fh; -- cgit v1.2.3 From f14479316abf0c438e0ccbd59a4fdf4f8ccfbede Mon Sep 17 00:00:00 2001 From: Yaroslav Gevorkov Date: Thu, 24 May 2018 16:00:04 +0200 Subject: Changed sig_fac to min_snr --- src/indexamajig.c | 20 ++++++++++---------- src/process_image.c | 6 +++--- src/process_image.h | 6 +++--- 3 files changed, 16 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/indexamajig.c b/src/indexamajig.c index 9e265191..97024b54 100644 --- a/src/indexamajig.c +++ b/src/indexamajig.c @@ -112,9 +112,9 @@ static void show_help(const char *s) " (peakfinder8 only) Default: 1200\n" " --window-radius= (peakFinder9 only) defines the radius in which the " " local background is estimated\n" -" --sig-fac-biggest-pix= (peakFinder9 only) min snr of the biggest pixel in " +" --min-snr-biggest-pix= (peakFinder9 only) min snr of the biggest pixel in " " the peak\n" -" --sig-fac-peak-pix= (peakFinder9 only) min snr of a peak pixel\n" +" --min-snr-peak-pix= (peakFinder9 only) min snr of a peak pixel\n" " --min-sig= (peakFinder9 only) minimum standard deviation of " " the background\n" " --min-peak-over-neighbour= (peakFinder9 only) just for speed. Biggest pixel" @@ -270,9 +270,9 @@ int main(int argc, char *argv[]) iargs.min_res = 0; iargs.max_res = 1200; iargs.local_bg_radius = 3; - iargs.sig_fac_biggest_pix = 7.0; /* peak finder 9 */ - iargs.sig_fac_peak_pix = 6.0; - iargs.sig_fac_whole_peak = 9.0; + iargs.min_snr_biggest_pix = 7.0; /* peak finder 9 */ + iargs.min_snr_peak_pix = 6.0; + iargs.min_snr_whole_peak = 9.0; iargs.min_sig = 11.0; iargs.min_peak_over_neighbour = -INFINITY; iargs.window_radius = 3; @@ -421,8 +421,8 @@ int main(int argc, char *argv[]) {"serial-start", 1, NULL, 344}, {"felix-domega", 1, NULL, 345}, {"felix-max-internal-angle", 1, NULL, 346}, - {"sig-fac-biggest-pix" ,1, NULL,347}, - {"sig-fac-peak-pix" ,1, NULL,348}, + {"min-snr-biggest-pix" ,1, NULL,347}, + {"min-snr-peak-pix" ,1, NULL,348}, {"min-sig" ,1, NULL,349}, {"min-peak-over-neighbour" ,1, NULL,350}, {"window-radius" ,1, NULL,351}, @@ -525,7 +525,7 @@ int main(int argc, char *argv[]) case 311 : iargs.min_snr = strtof(optarg, NULL); - iargs.sig_fac_whole_peak = iargs.min_snr; + iargs.min_snr_whole_peak = iargs.min_snr; break; case 313 : @@ -754,11 +754,11 @@ int main(int argc, char *argv[]) break; case 347: - iargs.sig_fac_biggest_pix = strtof(optarg, NULL); + iargs.min_snr_biggest_pix = strtof(optarg, NULL); break; case 348: - iargs.sig_fac_peak_pix = strtof(optarg, NULL); + iargs.min_snr_peak_pix = strtof(optarg, NULL); break; case 349: diff --git a/src/process_image.c b/src/process_image.c index 57f40142..e8bcd911 100644 --- a/src/process_image.c +++ b/src/process_image.c @@ -225,9 +225,9 @@ void process_image(const struct index_args *iargs, struct pattern_args *pargs, case PEAK_PEAKFINDER9: if ( search_peaks_peakfinder9(&image, - iargs->sig_fac_biggest_pix, - iargs->sig_fac_peak_pix, - iargs->sig_fac_whole_peak, + iargs->min_snr_biggest_pix, + iargs->min_snr_peak_pix, + iargs->min_snr_whole_peak, iargs->min_sig, iargs->min_peak_over_neighbour, iargs->window_radius) ) diff --git a/src/process_image.h b/src/process_image.h index e44de48f..924b8ac4 100644 --- a/src/process_image.h +++ b/src/process_image.h @@ -85,9 +85,9 @@ struct index_args int max_pix_count; int local_bg_radius; int min_peaks; - float sig_fac_biggest_pix; - float sig_fac_peak_pix; - float sig_fac_whole_peak; + float min_snr_biggest_pix; + float min_snr_peak_pix; + float min_snr_whole_peak; float min_sig; float min_peak_over_neighbour; int window_radius; -- cgit v1.2.3 From d8f176d1902e6fb90747d4065c7e775b86476d5b Mon Sep 17 00:00:00 2001 From: Yaroslav Gevorkov Date: Thu, 24 May 2018 15:03:04 +0200 Subject: Changed parameter window-radius -> local-bg-radius --- src/indexamajig.c | 9 +-------- src/process_image.c | 2 +- src/process_image.h | 1 - 3 files changed, 2 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/indexamajig.c b/src/indexamajig.c index 97024b54..1b1545a9 100644 --- a/src/indexamajig.c +++ b/src/indexamajig.c @@ -105,13 +105,11 @@ static void show_help(const char *s) " --max-pix-count= Maximum number of pixels per peak\n" " (peakfinder8 only) Default: 200\n" " --local-bg-radius= Radius (pixels) for local background estimation\n" -" (peakfinder8 only) Default: 3\n" +" (peakfinder8, peakfinder9 only) Default: 3\n" " --min-res= Minimum resolution for peak search (in pixels)\n" " (peakfinder8 only) Default: 0\n" " --max-res= Maximum resolution for peak search (in pixels)\n" " (peakfinder8 only) Default: 1200\n" -" --window-radius= (peakFinder9 only) defines the radius in which the " -" local background is estimated\n" " --min-snr-biggest-pix= (peakFinder9 only) min snr of the biggest pixel in " " the peak\n" " --min-snr-peak-pix= (peakFinder9 only) min snr of a peak pixel\n" @@ -275,7 +273,6 @@ int main(int argc, char *argv[]) iargs.min_snr_whole_peak = 9.0; iargs.min_sig = 11.0; iargs.min_peak_over_neighbour = -INFINITY; - iargs.window_radius = 3; iargs.check_hdf5_snr = 0; iargs.det = NULL; iargs.peaks = PEAK_ZAEF; @@ -425,7 +422,6 @@ int main(int argc, char *argv[]) {"min-snr-peak-pix" ,1, NULL,348}, {"min-sig" ,1, NULL,349}, {"min-peak-over-neighbour" ,1, NULL,350}, - {"window-radius" ,1, NULL,351}, {0, 0, NULL, 0} }; @@ -769,9 +765,6 @@ int main(int argc, char *argv[]) iargs.min_peak_over_neighbour = strtof(optarg, NULL); break; - case 351: - iargs.window_radius = atoi(optarg); - case 0 : break; diff --git a/src/process_image.c b/src/process_image.c index e8bcd911..c12ec3b5 100644 --- a/src/process_image.c +++ b/src/process_image.c @@ -230,7 +230,7 @@ void process_image(const struct index_args *iargs, struct pattern_args *pargs, iargs->min_snr_whole_peak, iargs->min_sig, iargs->min_peak_over_neighbour, - iargs->window_radius) ) + iargs->local_bg_radius) ) { if ( image.event != NULL ) { ERROR("Failed to find peaks in image %s" diff --git a/src/process_image.h b/src/process_image.h index 924b8ac4..7b050e83 100644 --- a/src/process_image.h +++ b/src/process_image.h @@ -90,7 +90,6 @@ struct index_args float min_snr_whole_peak; float min_sig; float min_peak_over_neighbour; - int window_radius; struct imagefile_field_list *copyme; int integrate_saturated; int use_saturated; -- cgit v1.2.3 From aae5b9636a9efe1ece80a3b823956a75d4149dca Mon Sep 17 00:00:00 2001 From: Thomas White Date: Thu, 24 May 2018 16:26:39 +0200 Subject: Use only one min-snr option --- src/indexamajig.c | 2 -- src/process_image.c | 2 +- src/process_image.h | 1 - 3 files changed, 1 insertion(+), 4 deletions(-) (limited to 'src') diff --git a/src/indexamajig.c b/src/indexamajig.c index 1b1545a9..4a790a17 100644 --- a/src/indexamajig.c +++ b/src/indexamajig.c @@ -270,7 +270,6 @@ int main(int argc, char *argv[]) iargs.local_bg_radius = 3; iargs.min_snr_biggest_pix = 7.0; /* peak finder 9 */ iargs.min_snr_peak_pix = 6.0; - iargs.min_snr_whole_peak = 9.0; iargs.min_sig = 11.0; iargs.min_peak_over_neighbour = -INFINITY; iargs.check_hdf5_snr = 0; @@ -521,7 +520,6 @@ int main(int argc, char *argv[]) case 311 : iargs.min_snr = strtof(optarg, NULL); - iargs.min_snr_whole_peak = iargs.min_snr; break; case 313 : diff --git a/src/process_image.c b/src/process_image.c index c12ec3b5..6f4ab192 100644 --- a/src/process_image.c +++ b/src/process_image.c @@ -227,7 +227,7 @@ void process_image(const struct index_args *iargs, struct pattern_args *pargs, if ( search_peaks_peakfinder9(&image, iargs->min_snr_biggest_pix, iargs->min_snr_peak_pix, - iargs->min_snr_whole_peak, + iargs->min_snr, iargs->min_sig, iargs->min_peak_over_neighbour, iargs->local_bg_radius) ) diff --git a/src/process_image.h b/src/process_image.h index 7b050e83..52f063fd 100644 --- a/src/process_image.h +++ b/src/process_image.h @@ -87,7 +87,6 @@ struct index_args int min_peaks; float min_snr_biggest_pix; float min_snr_peak_pix; - float min_snr_whole_peak; float min_sig; float min_peak_over_neighbour; struct imagefile_field_list *copyme; -- cgit v1.2.3 From ea2ad46e4199bf57ee033a971d3746ff785ed4cc Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 25 May 2018 17:26:01 +0200 Subject: Whitespace fussiness --- src/process_image.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/process_image.c b/src/process_image.c index 6f4ab192..1d41ae6e 100644 --- a/src/process_image.c +++ b/src/process_image.c @@ -201,7 +201,7 @@ void process_image(const struct index_args *iargs, struct pattern_args *pargs, iargs->use_saturated); break; - case PEAK_PEAKFINDER8: + case PEAK_PEAKFINDER8: if ( search_peaks_peakfinder8(&image, 2048, iargs->threshold, iargs->min_snr, -- cgit v1.2.3