From 8f99dad3c42ab08d631b1ac02b195b33944c7240 Mon Sep 17 00:00:00 2001 From: Yaroslav Gevorkov Date: Thu, 24 May 2018 10:07:11 +0200 Subject: Add "peakfinder9" --- doc/man/indexamajig.1 | 30 +++++++++++++- libcrystfel/src/peaks.c | 106 ++++++++++++++++++++++++++++++++++++++++++++++++ libcrystfel/src/peaks.h | 6 +++ src/indexamajig.c | 49 +++++++++++++++++++++- src/process_image.c | 13 ++++++ src/process_image.h | 10 ++++- 6 files changed, 210 insertions(+), 4 deletions(-) diff --git a/doc/man/indexamajig.1 b/doc/man/indexamajig.1 index c0fe8277..bdcb7aa3 100644 --- a/doc/man/indexamajig.1 +++ b/doc/man/indexamajig.1 @@ -51,6 +51,8 @@ If you use \fB--peaks=zaef\fR, indexamajig will use a simple gradient search aft If you instead use \fB--peaks=peakfinder8\fR, indexamajig will use the "peakfinder8" peak finding algorithm describerd in Barty et al. (2014). Pixels above a radius-dependent intensity threshold are considered as candidate peaks (although the user sets an absolute minimum threshold for candidate peaks). Peaks are then only accepted if their signal to noise level over the local background is sufficiently high. Peaks can include multiple pixels and the user can reject a peak if it includes too many or too few. The distance of a peak from the center of the detector can also be used as a filtering criterion. Note that the peakfinder8 will not report more than 2048 peaks for each panel: any additional peak is ignored. +If you instead use \fB--peaks=peakfinder9\fR, indexamajig will user the "peakfinder9" peak finding algorithm described in the master thesis "Real-time image analysis and data compression in high throughput X-ray diffraction experiments" by Gevorkov. Other than peakFinder8, peakFinder9 uses local background estimation based on border pixels in a specified radius (\fB--window-radius\fR). For being fast and precise, a hierarchy of conditions is used. First condition is only useful for speed consideration, it demands that a pixel that is the biggest pixel in a peak must be larger than every border pixel by a constant value (\fB--min-peak-over-neighbour\fR). Second condition ensures, that the pixel passing the previous condition is the highest pixel in the peak. It assumes, that peaks rise monotonically towards the biggest pixel. Third condition ensures, that the biggest pixel in the peak is significantly over the noise level (\fB--sig-fac-biggest-pix\fR) by computing the local statistics from the border pixels in a specified radius. Fourth condition sums up all pixels belonging to the peak (\fB--sig-fac-peak-pix\fR) and demands that the whole peak must be significantly over the noise level (\fB--min-snr\fR). Only if all conditions are passed, the peak is accepted. + You can suppress peak detection altogether for a panel in the geometry file by specifying the "no_index" value for the panel as non-zero. @@ -254,7 +256,33 @@ Set the square of the gradient threshold for peak detection using \fB--peaks=zae .PD 0 .IP \fB--min-snr=\fR\fIsnr\fR .PD -Set the minimum I/sigma(I) for peak detection when using \fB--peaks=zaef\fR or \fB--peaks=peakfinder8\fR. The default is \fB--min-snr=5\fR. + +Set the minimum I/sigma(I) for peak detection when using \fB--peaks=zaef\fR, \fB--peaks=peakfinder8\fR or \fB--peaks=peakfinder9\fR. The default is \fB--min-snr=5\fR for \fB--peaks=zaef\fR and \fB--peaks=peakfinder8\fR, \fB--min-snr=9\fR for \fB--peaks=peakfinder9\fR. + +.PD 0 +.IP \fB--window-radius=\fR +.PD +(peakFinder9 only) defines the radius in which the local background is estimated. Should be > max radius of peak. Default is 3. + +.PD 0 +.IP \fB--sig-fac-biggest-pix=\fR +.PD +(peakFinder9 only) min snr of the biggest pixel in the peak, given as a factor of the standard deviation. Default is 7.0. + +.PD 0 +.IP \fB--sig-fac-peak-pix=\fR +.PD +(peakFinder9 only) min snr of a peak pixel, given as a factor of the standard deviation. Should be smaller or equal to sig_fac_biggest_pix. Default is 6.0. + +.PD 0 +.IP \fB--min-sig=\fR +.PD +(peakFinder9 only) minimum standard deviation of the background. Prevents finding of peaks in erroneous or highly shadowed unmasked regions. Default is 11.0. + +.PD 0 +.IP \fB--min-peak-over-neighbour=\fR +.PD +(peakFinder9 only) just for speed. Biggest pixel must be n higher than the pixels in window_radius distance to be a candidate for the biggest pixel in a peak. Should be chosen as a small positive number, a few times smaller than the weakest expected peak. Can be set to -INFINITY to turn of speedup and search with max precision! Default is -INFINITY. .PD 0 .IP \fB--min-pix-count=\fR\fIcnt\fR diff --git a/libcrystfel/src/peaks.c b/libcrystfel/src/peaks.c index 28c79538..7f6e0ba7 100644 --- a/libcrystfel/src/peaks.c +++ b/libcrystfel/src/peaks.c @@ -13,6 +13,7 @@ * 2011 Andrew Martin * 2011 Richard Kirian * 2017 Valerio Mariani + * 2017-2018 Yaroslav Gevorkov * * This file is part of CrystFEL. * @@ -563,6 +564,111 @@ int search_peaks_peakfinder8(struct image *image, int max_n_peaks, } +//#define HAVE_FDIP +#ifdef HAVE_FDIP + +#include "fastDiffractionImageProcessing/adaptions/crystfel/peakFinder9.h" +#include "fastDiffractionImageProcessing/adaptions/crystfel/mask.h" +#include "fastDiffractionImageProcessing/peakList.h" + +#include "fastDiffractionImageProcessing/peakFinder9.h" //debug, only for eclipse +#include "fastDiffractionImageProcessing/detectorRawFormat.h" //debug, only for eclipse + +int search_peaks_peakfinder9(struct image *image, 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) +{ + if (image->features != NULL) { + image_feature_list_free(image->features); + } + image->features = image_feature_list_new(); + image->num_peaks = 0; + image->num_saturated_peaks = 0; + + peakFinder9_accuracyConstants_t accuracy_consts; + accuracy_consts.sigmaFactorBiggestPixel = sig_fac_biggest_pix; + accuracy_consts.sigmaFactorPeakPixel = sig_fac_peak_pix; + accuracy_consts.sigmaFactorWholePeak = sig_fac_whole_peak; + accuracy_consts.minimumSigma = min_sig; + accuracy_consts.minimumPeakOversizeOverNeighbours = + min_peak_over_neighbour; + accuracy_consts.windowRadius = (unsigned int) window_radius; + + long NpeaksMax = 10000; //more peaks per panel should not appear + + float *data_copy = NULL, *data_copy_new; + peakList_t peakList; + if (allocatePeakList(&peakList, NpeaksMax)) { + return 1; + } + + for (int panel_number = 0; panel_number < image->det->n_panels; + panel_number++) { + + if (image->det->panels[panel_number].no_index) + continue; + + int w = image->det->panels[panel_number].w; + int h = image->det->panels[panel_number].h; + + detectorRawFormat_t det_size_one_panel; + det_size_one_panel.asic_nx = w; + det_size_one_panel.asic_ny = h; + det_size_one_panel.nasics_x = 1; + det_size_one_panel.nasics_y = 1; + det_size_one_panel.pix_nx = w; + det_size_one_panel.pix_ny = h; + det_size_one_panel.pix_nn = w * h; + + data_copy_new = (float*) realloc(data_copy, + w * h * sizeof(*data_copy)); + if (data_copy_new == NULL) { + if (data_copy != NULL) + free(data_copy); + freePeakList(peakList); + return 1; + } + else { + data_copy = data_copy_new; + } + + mergeMaskAndDataIntoDataCopy(image->dp[panel_number], data_copy, + image->bad[panel_number], + &det_size_one_panel); + + peakList.peakCount = 0; + image->num_peaks += peakFinder9_onePanel_noSlab(data_copy, + &accuracy_consts, + &det_size_one_panel, &peakList); + + for (int peak_number = 0; peak_number < peakList.peakCount; + peak_number++) { + image_add_feature(image->features, + peakList.centerOfMass_rawX[peak_number], + peakList.centerOfMass_rawY[peak_number], + &image->det->panels[panel_number], + image, + peakList.totalIntensity[peak_number], + NULL); + } + + } + + freePeakList(peakList); + free(data_copy); + return 0; +} +#else +int search_peaks_peakfinder9(struct image *image, 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) +{ + ERROR("This copy of CrystFEL was compiled without peakfinder9 support.\n"); + return 0; +} +#endif // HAVE_FDIP + + int peak_sanity_check(struct image *image, Crystal **crystals, int n_cryst) { int n_feat = 0; diff --git a/libcrystfel/src/peaks.h b/libcrystfel/src/peaks.h index a5095127..e63287d4 100644 --- a/libcrystfel/src/peaks.h +++ b/libcrystfel/src/peaks.h @@ -9,6 +9,7 @@ * Authors: * 2010-2015 Thomas White * 2017 Valerio Mariani + * 2017-2018 Yaroslav Gevorkov * * This file is part of CrystFEL. * @@ -55,6 +56,11 @@ extern int search_peaks_peakfinder8(struct image *image, int max_n_peaks, int local_bg_radius, int min_res, int max_res, int use_saturated); +extern int search_peaks_peakfinder9(struct image *image, 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); + + extern int peak_sanity_check(struct image *image, Crystal **crystals, int n_cryst); 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 --- libcrystfel/src/peaks.c | 174 +++++++++++++++++++++++++----------------------- libcrystfel/src/peaks.h | 10 +-- src/process_image.c | 11 +-- 3 files changed, 101 insertions(+), 94 deletions(-) diff --git a/libcrystfel/src/peaks.c b/libcrystfel/src/peaks.c index 7f6e0ba7..571f79ae 100644 --- a/libcrystfel/src/peaks.c +++ b/libcrystfel/src/peaks.c @@ -575,97 +575,101 @@ int search_peaks_peakfinder8(struct image *image, int max_n_peaks, #include "fastDiffractionImageProcessing/detectorRawFormat.h" //debug, only for eclipse int search_peaks_peakfinder9(struct image *image, 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) + float sig_fac_peak_pix, float sig_fac_whole_peak, + float min_sig, float min_peak_over_neighbour, + int window_radius) { - if (image->features != NULL) { - image_feature_list_free(image->features); - } - image->features = image_feature_list_new(); - image->num_peaks = 0; - image->num_saturated_peaks = 0; - - peakFinder9_accuracyConstants_t accuracy_consts; - accuracy_consts.sigmaFactorBiggestPixel = sig_fac_biggest_pix; - accuracy_consts.sigmaFactorPeakPixel = sig_fac_peak_pix; - accuracy_consts.sigmaFactorWholePeak = sig_fac_whole_peak; - accuracy_consts.minimumSigma = min_sig; - accuracy_consts.minimumPeakOversizeOverNeighbours = - min_peak_over_neighbour; - accuracy_consts.windowRadius = (unsigned int) window_radius; - - long NpeaksMax = 10000; //more peaks per panel should not appear - - float *data_copy = NULL, *data_copy_new; - peakList_t peakList; - if (allocatePeakList(&peakList, NpeaksMax)) { - return 1; - } - - for (int panel_number = 0; panel_number < image->det->n_panels; - panel_number++) { - - if (image->det->panels[panel_number].no_index) - continue; - - int w = image->det->panels[panel_number].w; - int h = image->det->panels[panel_number].h; - - detectorRawFormat_t det_size_one_panel; - det_size_one_panel.asic_nx = w; - det_size_one_panel.asic_ny = h; - det_size_one_panel.nasics_x = 1; - det_size_one_panel.nasics_y = 1; - det_size_one_panel.pix_nx = w; - det_size_one_panel.pix_ny = h; - det_size_one_panel.pix_nn = w * h; - - data_copy_new = (float*) realloc(data_copy, - w * h * sizeof(*data_copy)); - if (data_copy_new == NULL) { - if (data_copy != NULL) - free(data_copy); - freePeakList(peakList); - return 1; - } - else { - data_copy = data_copy_new; - } - - mergeMaskAndDataIntoDataCopy(image->dp[panel_number], data_copy, - image->bad[panel_number], - &det_size_one_panel); - - peakList.peakCount = 0; - image->num_peaks += peakFinder9_onePanel_noSlab(data_copy, - &accuracy_consts, - &det_size_one_panel, &peakList); - - for (int peak_number = 0; peak_number < peakList.peakCount; - peak_number++) { - image_add_feature(image->features, - peakList.centerOfMass_rawX[peak_number], - peakList.centerOfMass_rawY[peak_number], - &image->det->panels[panel_number], - image, - peakList.totalIntensity[peak_number], - NULL); - } - - } - - freePeakList(peakList); - free(data_copy); - return 0; + peakFinder9_accuracyConstants_t accuracy_consts; + peakList_t peakList; + long NpeaksMax = 10000; //more peaks per panel should not appear + float *data_copy = NULL; + float *data_copy_new; + int panel_number; + + if ( image->features != NULL ) { + image_feature_list_free(image->features); + } + image->features = image_feature_list_new(); + image->num_peaks = 0; + image->num_saturated_peaks = 0; + + accuracy_consts.sigmaFactorBiggestPixel = sig_fac_biggest_pix; + accuracy_consts.sigmaFactorPeakPixel = sig_fac_peak_pix; + accuracy_consts.sigmaFactorWholePeak = sig_fac_whole_peak; + accuracy_consts.minimumSigma = min_sig; + accuracy_consts.minimumPeakOversizeOverNeighbours = min_peak_over_neighbour; + accuracy_consts.windowRadius = window_radius; + + if ( allocatePeakList(&peakList, NpeaksMax) ) return 1; + + for ( panel_number=0; panel_numberdet->n_panels; panel_number++ ) { + + int w, h; + int peak_number; + detectorRawFormat_t det_size_one_panel; + + if ( image->det->panels[panel_number].no_index ) continue; + + w = image->det->panels[panel_number].w; + h = image->det->panels[panel_number].h; + + det_size_one_panel.asic_nx = w; + det_size_one_panel.asic_ny = h; + det_size_one_panel.nasics_x = 1; + det_size_one_panel.nasics_y = 1; + det_size_one_panel.pix_nx = w; + det_size_one_panel.pix_ny = h; + det_size_one_panel.pix_nn = w * h; + + data_copy_new = realloc(data_copy, w*h*sizeof(*data_copy)); + if ( data_copy_new == NULL ) { + if ( data_copy != NULL ) { + free(data_copy); + } + freePeakList(peakList); + return 1; + } else { + data_copy = data_copy_new; + } + + mergeMaskAndDataIntoDataCopy(image->dp[panel_number], data_copy, + image->bad[panel_number], + &det_size_one_panel); + + peakList.peakCount = 0; + image->num_peaks += peakFinder9_onePanel_noSlab(data_copy, + &accuracy_consts, + &det_size_one_panel, + &peakList); + + for ( peak_number=0; peak_numberfeatures, + peakList.centerOfMass_rawX[peak_number], + peakList.centerOfMass_rawY[peak_number], + &image->det->panels[panel_number], + image, + peakList.totalIntensity[peak_number], + NULL); + } + + } + + freePeakList(peakList); + free(data_copy); + return 0; } + #else + int search_peaks_peakfinder9(struct image *image, 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) + float sig_fac_peak_pix, float sig_fac_whole_peak, + float min_sig, float min_peak_over_neighbour, + int window_radius) { - ERROR("This copy of CrystFEL was compiled without peakfinder9 support.\n"); - return 0; + ERROR("This copy of CrystFEL was compiled without peakfinder9 support.\n"); + return 0; } + #endif // HAVE_FDIP diff --git a/libcrystfel/src/peaks.h b/libcrystfel/src/peaks.h index e63287d4..04957143 100644 --- a/libcrystfel/src/peaks.h +++ b/libcrystfel/src/peaks.h @@ -56,10 +56,12 @@ extern int search_peaks_peakfinder8(struct image *image, int max_n_peaks, int local_bg_radius, int min_res, int max_res, int use_saturated); -extern int search_peaks_peakfinder9(struct image *image, 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); - +extern int search_peaks_peakfinder9(struct image *image, + 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); extern int peak_sanity_check(struct image *image, Crystal **crystals, int n_cryst); 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 44e55c27562ca655d9439a2fd885440f8995b3ff Mon Sep 17 00:00:00 2001 From: Thomas White Date: Thu, 24 May 2018 10:31:09 +0200 Subject: Tweak wording in manual --- doc/man/indexamajig.1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/man/indexamajig.1 b/doc/man/indexamajig.1 index bdcb7aa3..10def01c 100644 --- a/doc/man/indexamajig.1 +++ b/doc/man/indexamajig.1 @@ -51,7 +51,7 @@ If you use \fB--peaks=zaef\fR, indexamajig will use a simple gradient search aft If you instead use \fB--peaks=peakfinder8\fR, indexamajig will use the "peakfinder8" peak finding algorithm describerd in Barty et al. (2014). Pixels above a radius-dependent intensity threshold are considered as candidate peaks (although the user sets an absolute minimum threshold for candidate peaks). Peaks are then only accepted if their signal to noise level over the local background is sufficiently high. Peaks can include multiple pixels and the user can reject a peak if it includes too many or too few. The distance of a peak from the center of the detector can also be used as a filtering criterion. Note that the peakfinder8 will not report more than 2048 peaks for each panel: any additional peak is ignored. -If you instead use \fB--peaks=peakfinder9\fR, indexamajig will user the "peakfinder9" peak finding algorithm described in the master thesis "Real-time image analysis and data compression in high throughput X-ray diffraction experiments" by Gevorkov. Other than peakFinder8, peakFinder9 uses local background estimation based on border pixels in a specified radius (\fB--window-radius\fR). For being fast and precise, a hierarchy of conditions is used. First condition is only useful for speed consideration, it demands that a pixel that is the biggest pixel in a peak must be larger than every border pixel by a constant value (\fB--min-peak-over-neighbour\fR). Second condition ensures, that the pixel passing the previous condition is the highest pixel in the peak. It assumes, that peaks rise monotonically towards the biggest pixel. Third condition ensures, that the biggest pixel in the peak is significantly over the noise level (\fB--sig-fac-biggest-pix\fR) by computing the local statistics from the border pixels in a specified radius. Fourth condition sums up all pixels belonging to the peak (\fB--sig-fac-peak-pix\fR) and demands that the whole peak must be significantly over the noise level (\fB--min-snr\fR). Only if all conditions are passed, the peak is accepted. +If you instead use \fB--peaks=peakfinder9\fR, indexamajig will use the "peakfinder9" peak finding algorithm described in the master thesis "Real-time image analysis and data compression in high throughput X-ray diffraction experiments" by Gevorkov. Other than peakFinder8, peakFinder9 uses local background estimation based on border pixels in a specified radius (\fB--window-radius\fR). For being fast and precise, a hierarchy of conditions is used. First condition is only useful for speed consideration, it demands that a pixel that is the biggest pixel in a peak must be larger than every border pixel by a constant value (\fB--min-peak-over-neighbour\fR). Second condition ensures, that the pixel passing the previous condition is the highest pixel in the peak. It assumes, that peaks rise monotonically towards the biggest pixel. Third condition ensures, that the biggest pixel in the peak is significantly over the noise level (\fB--sig-fac-biggest-pix\fR) by computing the local statistics from the border pixels in a specified radius. Fourth condition sums up all pixels belonging to the peak (\fB--sig-fac-peak-pix\fR) and demands that the whole peak must be significantly over the noise level (\fB--min-snr\fR). Only if all conditions are passed, the peak is accepted. You can suppress peak detection altogether for a panel in the geometry file by specifying the "no_index" value for the panel as non-zero. @@ -282,7 +282,7 @@ Set the minimum I/sigma(I) for peak detection when using \fB--peaks=zaef\fR, \fB .PD 0 .IP \fB--min-peak-over-neighbour=\fR .PD -(peakFinder9 only) just for speed. Biggest pixel must be n higher than the pixels in window_radius distance to be a candidate for the biggest pixel in a peak. Should be chosen as a small positive number, a few times smaller than the weakest expected peak. Can be set to -INFINITY to turn of speedup and search with max precision! Default is -INFINITY. +(peakFinder9 only) just for speed. Biggest pixel must be n higher than the pixels in window_radius distance to be a candidate for the biggest pixel in a peak. Should be chosen as a small positive number, a few times smaller than the weakest expected peak. The default is -INFINITY, which turns off the speedup and searches with maximum precision. .PD 0 .IP \fB--min-pix-count=\fR\fIcnt\fR -- 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 --- doc/man/indexamajig.1 | 2 +- libcrystfel/src/peaks.c | 2 +- libcrystfel/src/peaks.h | 2 +- src/indexamajig.c | 2 +- src/process_image.c | 2 +- src/process_image.h | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/man/indexamajig.1 b/doc/man/indexamajig.1 index 10def01c..de75f7e4 100644 --- a/doc/man/indexamajig.1 +++ b/doc/man/indexamajig.1 @@ -523,7 +523,7 @@ For a full explanation of how the internal layout of the data file can be descr You can use \fBlist_events\fR to prepare a list of each event in one or more input files. Note that you only need to do this if you need to perform some sorting or filtering on this list. If you want to process every event in a file, simply specify the filename in the input file. .SH AUTHOR -This page was written by Thomas White. +This page was written by Thomas White, Yaroslav Gevorkov and Valerio Mariani. .SH REPORTING BUGS Report bugs to , or visit . diff --git a/libcrystfel/src/peaks.c b/libcrystfel/src/peaks.c index 571f79ae..d656050e 100644 --- a/libcrystfel/src/peaks.c +++ b/libcrystfel/src/peaks.c @@ -3,7 +3,7 @@ * * Peak search and other image analysis * - * 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 * diff --git a/libcrystfel/src/peaks.h b/libcrystfel/src/peaks.h index 04957143..06ca8e6c 100644 --- a/libcrystfel/src/peaks.h +++ b/libcrystfel/src/peaks.h @@ -3,7 +3,7 @@ * * Peak search and other image analysis * - * 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/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 fce9cd58362d09366c8a1c474017ef3e63f0b3aa Mon Sep 17 00:00:00 2001 From: Thomas White Date: Thu, 24 May 2018 10:32:11 +0200 Subject: Move FDIP includes to top, and remove unnecessary ones --- libcrystfel/src/peaks.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/libcrystfel/src/peaks.c b/libcrystfel/src/peaks.c index d656050e..14371271 100644 --- a/libcrystfel/src/peaks.c +++ b/libcrystfel/src/peaks.c @@ -46,6 +46,12 @@ #include #include +#ifdef HAVE_FDIP +#include "fastDiffractionImageProcessing/adaptions/crystfel/peakFinder9.h" +#include "fastDiffractionImageProcessing/adaptions/crystfel/mask.h" +#include "fastDiffractionImageProcessing/peakList.h" +#endif + #include "image.h" #include "utils.h" #include "peaks.h" @@ -564,16 +570,8 @@ int search_peaks_peakfinder8(struct image *image, int max_n_peaks, } -//#define HAVE_FDIP #ifdef HAVE_FDIP -#include "fastDiffractionImageProcessing/adaptions/crystfel/peakFinder9.h" -#include "fastDiffractionImageProcessing/adaptions/crystfel/mask.h" -#include "fastDiffractionImageProcessing/peakList.h" - -#include "fastDiffractionImageProcessing/peakFinder9.h" //debug, only for eclipse -#include "fastDiffractionImageProcessing/detectorRawFormat.h" //debug, only for eclipse - int search_peaks_peakfinder9(struct image *image, float sig_fac_biggest_pix, float sig_fac_peak_pix, float sig_fac_whole_peak, float min_sig, float min_peak_over_neighbour, -- 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 --- libcrystfel/src/peaks.c | 2 +- src/process_image.c | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/libcrystfel/src/peaks.c b/libcrystfel/src/peaks.c index 14371271..1ec4ae59 100644 --- a/libcrystfel/src/peaks.c +++ b/libcrystfel/src/peaks.c @@ -665,7 +665,7 @@ int search_peaks_peakfinder9(struct image *image, float sig_fac_biggest_pix, int window_radius) { ERROR("This copy of CrystFEL was compiled without peakfinder9 support.\n"); - return 0; + return 1; } #endif // HAVE_FDIP 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(-) 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(-) 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 e5f48fe09f1901d70342a9dde418f7b6843afdcc Mon Sep 17 00:00:00 2001 From: Yaroslav Gevorkov Date: Wed, 23 May 2018 23:01:09 +0200 Subject: updated FDIP cmake to newest version --- CMake/FindFDIP.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CMake/FindFDIP.cmake b/CMake/FindFDIP.cmake index 6db3b993..3306b483 100644 --- a/CMake/FindFDIP.cmake +++ b/CMake/FindFDIP.cmake @@ -10,16 +10,16 @@ if (FDIP_INCLUDES) set (FDIP_FIND_QUIETLY TRUE) endif (FDIP_INCLUDES) -find_path (FDIP_INCLUDES streakFinder.h +find_path (FDIP_INCLUDES fastDiffractionImageProcessing/streakFinder.h PATHS - ${CMAKE_INSTALL_PREFIX}/include - PATH_SUFFIXES fastDiffractionImageProcessing) + ${CMAKE_INSTALL_PREFIX}/include) find_library (FDIP_LIBRARIES fastDiffractionImageProcessing PATHS - ${CMAKE_INSTALL_PREFIX}/lib) + ${CMAKE_INSTALL_PREFIX}/lib) # handle the QUIETLY and REQUIRED arguments and set FDIP_FOUND to TRUE if # all listed variables are TRUE include (FindPackageHandleStandardArgs) +set(FDIP_INCLUDES ${FDIP_INCLUDES};${FDIP_INCLUDES}/fastDiffractionImageProcessing) find_package_handle_standard_args (FDIP DEFAULT_MSG FDIP_LIBRARIES FDIP_INCLUDES) -- cgit v1.2.3 From 998e9126b3454a9b8a47b20efefe7263e24571e2 Mon Sep 17 00:00:00 2001 From: Yaroslav Gevorkov Date: Wed, 23 May 2018 23:41:10 +0200 Subject: adapt cmake to link to fdip includes in tests --- tests/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index df98b6a1..1fa8012a 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -51,7 +51,11 @@ add_test(prof2d_check prof2d_check) add_executable(ring_check ring_check.c) target_include_directories(ring_check PRIVATE ${COMMON_INCLUDES}) -target_link_libraries(ring_check ${COMMON_LIBRARIES}) +target_link_libraries(ring_check PRIVATE ${COMMON_LIBRARIES}) +if (FDIP_FOUND) + target_include_directories(ring_check PRIVATE ${FDIP_INCLUDES}) + target_link_libraries(ring_check PRIVATE ${FDIP_LIBRARIES}) +endif (FDIP_FOUND) add_test(ring_check ring_check) add_executable(symmetry_check symmetry_check.c) -- 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(-) 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(-) 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 --- libcrystfel/src/peaks.c | 14 +++++++------- libcrystfel/src/peaks.h | 6 +++--- src/indexamajig.c | 20 ++++++++++---------- src/process_image.c | 6 +++--- src/process_image.h | 6 +++--- 5 files changed, 26 insertions(+), 26 deletions(-) diff --git a/libcrystfel/src/peaks.c b/libcrystfel/src/peaks.c index 1ec4ae59..6c48bd3a 100644 --- a/libcrystfel/src/peaks.c +++ b/libcrystfel/src/peaks.c @@ -572,8 +572,8 @@ int search_peaks_peakfinder8(struct image *image, int max_n_peaks, #ifdef HAVE_FDIP -int search_peaks_peakfinder9(struct image *image, float sig_fac_biggest_pix, - float sig_fac_peak_pix, float sig_fac_whole_peak, +int search_peaks_peakfinder9(struct image *image, 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) { @@ -591,9 +591,9 @@ int search_peaks_peakfinder9(struct image *image, float sig_fac_biggest_pix, image->num_peaks = 0; image->num_saturated_peaks = 0; - accuracy_consts.sigmaFactorBiggestPixel = sig_fac_biggest_pix; - accuracy_consts.sigmaFactorPeakPixel = sig_fac_peak_pix; - accuracy_consts.sigmaFactorWholePeak = sig_fac_whole_peak; + accuracy_consts.minSNR_biggestPixel = min_snr_biggest_pix; + accuracy_consts.minSNR_peakPixel = min_snr_peak_pix; + accuracy_consts.minSNR_wholePeak = min_snr_whole_peak; accuracy_consts.minimumSigma = min_sig; accuracy_consts.minimumPeakOversizeOverNeighbours = min_peak_over_neighbour; accuracy_consts.windowRadius = window_radius; @@ -659,8 +659,8 @@ int search_peaks_peakfinder9(struct image *image, float sig_fac_biggest_pix, #else -int search_peaks_peakfinder9(struct image *image, float sig_fac_biggest_pix, - float sig_fac_peak_pix, float sig_fac_whole_peak, +int search_peaks_peakfinder9(struct image *image, 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) { diff --git a/libcrystfel/src/peaks.h b/libcrystfel/src/peaks.h index 06ca8e6c..3abef729 100644 --- a/libcrystfel/src/peaks.h +++ b/libcrystfel/src/peaks.h @@ -57,9 +57,9 @@ extern int search_peaks_peakfinder8(struct image *image, int max_n_peaks, int max_res, int use_saturated); extern int search_peaks_peakfinder9(struct image *image, - float sig_fac_biggest_pix, - float sig_fac_peak_pix, - float sig_fac_whole_peak, float min_sig, + 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); 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 8c0fce3cc328c0edceb756821e1f498d4f0041d8 Mon Sep 17 00:00:00 2001 From: Yaroslav Gevorkov Date: Thu, 24 May 2018 16:01:17 +0200 Subject: Adapted doc to min-sig -> min-snr change --- doc/man/indexamajig.1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/man/indexamajig.1 b/doc/man/indexamajig.1 index de75f7e4..495abfa2 100644 --- a/doc/man/indexamajig.1 +++ b/doc/man/indexamajig.1 @@ -51,7 +51,7 @@ If you use \fB--peaks=zaef\fR, indexamajig will use a simple gradient search aft If you instead use \fB--peaks=peakfinder8\fR, indexamajig will use the "peakfinder8" peak finding algorithm describerd in Barty et al. (2014). Pixels above a radius-dependent intensity threshold are considered as candidate peaks (although the user sets an absolute minimum threshold for candidate peaks). Peaks are then only accepted if their signal to noise level over the local background is sufficiently high. Peaks can include multiple pixels and the user can reject a peak if it includes too many or too few. The distance of a peak from the center of the detector can also be used as a filtering criterion. Note that the peakfinder8 will not report more than 2048 peaks for each panel: any additional peak is ignored. -If you instead use \fB--peaks=peakfinder9\fR, indexamajig will use the "peakfinder9" peak finding algorithm described in the master thesis "Real-time image analysis and data compression in high throughput X-ray diffraction experiments" by Gevorkov. Other than peakFinder8, peakFinder9 uses local background estimation based on border pixels in a specified radius (\fB--window-radius\fR). For being fast and precise, a hierarchy of conditions is used. First condition is only useful for speed consideration, it demands that a pixel that is the biggest pixel in a peak must be larger than every border pixel by a constant value (\fB--min-peak-over-neighbour\fR). Second condition ensures, that the pixel passing the previous condition is the highest pixel in the peak. It assumes, that peaks rise monotonically towards the biggest pixel. Third condition ensures, that the biggest pixel in the peak is significantly over the noise level (\fB--sig-fac-biggest-pix\fR) by computing the local statistics from the border pixels in a specified radius. Fourth condition sums up all pixels belonging to the peak (\fB--sig-fac-peak-pix\fR) and demands that the whole peak must be significantly over the noise level (\fB--min-snr\fR). Only if all conditions are passed, the peak is accepted. +If you instead use \fB--peaks=peakfinder9\fR, indexamajig will use the "peakfinder9" peak finding algorithm described in the master thesis "Real-time image analysis and data compression in high throughput X-ray diffraction experiments" by Gevorkov. Other than peakFinder8, peakFinder9 uses local background estimation based on border pixels in a specified radius (\fB--window-radius\fR). For being fast and precise, a hierarchy of conditions is used. First condition is only useful for speed consideration, it demands that a pixel that is the biggest pixel in a peak must be larger than every border pixel by a constant value (\fB--min-peak-over-neighbour\fR). Second condition ensures, that the pixel passing the previous condition is the highest pixel in the peak. It assumes, that peaks rise monotonically towards the biggest pixel. Third condition ensures, that the biggest pixel in the peak is significantly over the noise level (\fB--min-snr-biggest-pix\fR) by computing the local statistics from the border pixels in a specified radius. Fourth condition sums up all pixels belonging to the peak (\fB--min-snr-peak-pix\fR) and demands that the whole peak must be significantly over the noise level (\fB--min-snr\fR). Only if all conditions are passed, the peak is accepted. You can suppress peak detection altogether for a panel in the geometry file by specifying the "no_index" value for the panel as non-zero. @@ -265,12 +265,12 @@ Set the minimum I/sigma(I) for peak detection when using \fB--peaks=zaef\fR, \fB (peakFinder9 only) defines the radius in which the local background is estimated. Should be > max radius of peak. Default is 3. .PD 0 -.IP \fB--sig-fac-biggest-pix=\fR +.IP \fB--min-snr-biggest-pix=\fR .PD (peakFinder9 only) min snr of the biggest pixel in the peak, given as a factor of the standard deviation. Default is 7.0. .PD 0 -.IP \fB--sig-fac-peak-pix=\fR +.IP \fB--min-snr-peak-pix=\fR .PD (peakFinder9 only) min snr of a peak pixel, given as a factor of the standard deviation. Should be smaller or equal to sig_fac_biggest_pix. Default is 6.0. -- 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 --- doc/man/indexamajig.1 | 9 ++------- src/indexamajig.c | 9 +-------- src/process_image.c | 2 +- src/process_image.h | 1 - 4 files changed, 4 insertions(+), 17 deletions(-) diff --git a/doc/man/indexamajig.1 b/doc/man/indexamajig.1 index 495abfa2..1d19bfad 100644 --- a/doc/man/indexamajig.1 +++ b/doc/man/indexamajig.1 @@ -51,7 +51,7 @@ If you use \fB--peaks=zaef\fR, indexamajig will use a simple gradient search aft If you instead use \fB--peaks=peakfinder8\fR, indexamajig will use the "peakfinder8" peak finding algorithm describerd in Barty et al. (2014). Pixels above a radius-dependent intensity threshold are considered as candidate peaks (although the user sets an absolute minimum threshold for candidate peaks). Peaks are then only accepted if their signal to noise level over the local background is sufficiently high. Peaks can include multiple pixels and the user can reject a peak if it includes too many or too few. The distance of a peak from the center of the detector can also be used as a filtering criterion. Note that the peakfinder8 will not report more than 2048 peaks for each panel: any additional peak is ignored. -If you instead use \fB--peaks=peakfinder9\fR, indexamajig will use the "peakfinder9" peak finding algorithm described in the master thesis "Real-time image analysis and data compression in high throughput X-ray diffraction experiments" by Gevorkov. Other than peakFinder8, peakFinder9 uses local background estimation based on border pixels in a specified radius (\fB--window-radius\fR). For being fast and precise, a hierarchy of conditions is used. First condition is only useful for speed consideration, it demands that a pixel that is the biggest pixel in a peak must be larger than every border pixel by a constant value (\fB--min-peak-over-neighbour\fR). Second condition ensures, that the pixel passing the previous condition is the highest pixel in the peak. It assumes, that peaks rise monotonically towards the biggest pixel. Third condition ensures, that the biggest pixel in the peak is significantly over the noise level (\fB--min-snr-biggest-pix\fR) by computing the local statistics from the border pixels in a specified radius. Fourth condition sums up all pixels belonging to the peak (\fB--min-snr-peak-pix\fR) and demands that the whole peak must be significantly over the noise level (\fB--min-snr\fR). Only if all conditions are passed, the peak is accepted. +If you instead use \fB--peaks=peakfinder9\fR, indexamajig will use the "peakfinder9" peak finding algorithm described in the master thesis "Real-time image analysis and data compression in high throughput X-ray diffraction experiments" by Gevorkov. Other than peakFinder8, peakFinder9 uses local background estimation based on border pixels in a specified radius (\fB--local-bg-radius\fR). For being fast and precise, a hierarchy of conditions is used. First condition is only useful for speed consideration, it demands that a pixel that is the biggest pixel in a peak must be larger than every border pixel by a constant value (\fB--min-peak-over-neighbour\fR). Second condition ensures, that the pixel passing the previous condition is the highest pixel in the peak. It assumes, that peaks rise monotonically towards the biggest pixel. Third condition ensures, that the biggest pixel in the peak is significantly over the noise level (\fB--min-snr-biggest-pix\fR) by computing the local statistics from the border pixels in a specified radius. Fourth condition sums up all pixels belonging to the peak (\fB--min-snr-peak-pix\fR) and demands that the whole peak must be significantly over the noise level (\fB--min-snr\fR). Only if all conditions are passed, the peak is accepted. You can suppress peak detection altogether for a panel in the geometry file by specifying the "no_index" value for the panel as non-zero. @@ -259,11 +259,6 @@ Set the square of the gradient threshold for peak detection using \fB--peaks=zae Set the minimum I/sigma(I) for peak detection when using \fB--peaks=zaef\fR, \fB--peaks=peakfinder8\fR or \fB--peaks=peakfinder9\fR. The default is \fB--min-snr=5\fR for \fB--peaks=zaef\fR and \fB--peaks=peakfinder8\fR, \fB--min-snr=9\fR for \fB--peaks=peakfinder9\fR. -.PD 0 -.IP \fB--window-radius=\fR -.PD -(peakFinder9 only) defines the radius in which the local background is estimated. Should be > max radius of peak. Default is 3. - .PD 0 .IP \fB--min-snr-biggest-pix=\fR .PD @@ -297,7 +292,7 @@ Accepts peaks only if they include less than \fR\fIcnt\fR pixels, when using \fB .PD 0 .IP \fB--local-bg-radius=\fR\fIr\fR .PD -Radius (in pixels) used for the estimation of the local background when using \fB--peaks=peakfinder8\fR. The default is \fB--local-bg-radius=3\fR. +Radius (in pixels) used for the estimation of the local background when using \fB--peaks=peakfinder8 or --peaks=peakfinder9\fR. The default is \fB--local-bg-radius=3\fR. .PD 0 .IP \fB--min-res=\fR\fIpx\fR 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 --- doc/man/indexamajig.1 | 3 +-- src/indexamajig.c | 2 -- src/process_image.c | 2 +- src/process_image.h | 1 - 4 files changed, 2 insertions(+), 6 deletions(-) diff --git a/doc/man/indexamajig.1 b/doc/man/indexamajig.1 index 1d19bfad..37e80801 100644 --- a/doc/man/indexamajig.1 +++ b/doc/man/indexamajig.1 @@ -256,8 +256,7 @@ Set the square of the gradient threshold for peak detection using \fB--peaks=zae .PD 0 .IP \fB--min-snr=\fR\fIsnr\fR .PD - -Set the minimum I/sigma(I) for peak detection when using \fB--peaks=zaef\fR, \fB--peaks=peakfinder8\fR or \fB--peaks=peakfinder9\fR. The default is \fB--min-snr=5\fR for \fB--peaks=zaef\fR and \fB--peaks=peakfinder8\fR, \fB--min-snr=9\fR for \fB--peaks=peakfinder9\fR. +Set the minimum I/sigma(I) for peak detection when using \fB--peaks=zaef\fR, \fB--peaks=peakfinder8\fR or \fB--peaks=peakfinder9\fR. The default is \fB--min-snr=5\fR. .PD 0 .IP \fB--min-snr-biggest-pix=\fR 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(-) 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