Commit d273ade6 authored by Thomas White's avatar Thomas White
Browse files

Add --clean-image option to hdfsee

parent 48fa0eb0
......@@ -941,7 +941,7 @@ static gint displaywindow_press(GtkWidget *widget, GdkEventButton *event,
DisplayWindow *displaywindow_open(const char *filename, const char *peaks,
int boost, int binning)
int boost, int binning, int clean)
{
DisplayWindow *dw;
char *title;
......@@ -1007,6 +1007,7 @@ DisplayWindow *displaywindow_open(const char *filename, const char *peaks,
dw->binning = binning;
dw->boostint = boost;
dw->clean = clean;
displaywindow_update(dw);
/* Peak list provided at startup? */
......
......@@ -62,6 +62,7 @@ typedef struct {
int height; /* Size of the drawing area */
int binning;
int boostint;
int clean; /* Whether or not to clean the image */
int show_col_scale;
int monochrome;
......@@ -72,7 +73,7 @@ typedef struct {
/* Open an image display window showing the given filename, or NULL */
extern DisplayWindow *displaywindow_open(const char *filename,
const char *peaks, int boost,
int binning);
int binning, int clean);
#endif /* DISPLAYWINDOW_H */
......@@ -36,8 +36,11 @@ static void show_help(const char *s)
" -h, --help Display this help message.\n"
"\n"
" -p, --peak-overlay=<filename> Draw circles in positions listed in file.\n"
" -i, --int-boost=<n> Multiple intensity by <n>.\n"
" -i, --int-boost=<n> Multiply intensity by <n>.\n"
" -b, --binning=<n> Set display binning to <n>.\n"
" --clean-image Perform common-mode noise subtraction and\n"
" background removal on images before\n"
" proceeding.\n"
"\n");
}
......@@ -76,6 +79,7 @@ int main(int argc, char *argv[])
char *peaks = NULL;
int boost = 1;
int binning = 2;
int config_clean = 0;
/* Long options */
const struct option longopts[] = {
......@@ -83,6 +87,7 @@ int main(int argc, char *argv[])
{"peak-overlay", 1, NULL, 'p'},
{"int-boost", 1, NULL, 'i'},
{"binning", 1, NULL, 'b'},
{"clean-image", 0, &config_clean, 1},
{0, 0, NULL, 0}
};
......@@ -140,7 +145,8 @@ int main(int argc, char *argv[])
for ( i=0; i<nfiles; i++ ) {
main_window_list[i] = displaywindow_open(argv[optind+i], peaks,
boost, binning);
boost, binning,
config_clean);
if ( main_window_list[i] == NULL ) {
ERROR("Couldn't open display window\n");
} else {
......
......@@ -79,7 +79,7 @@ int16_t *render_get_image_binned(DisplayWindow *dw, int binning, int16_t *max)
hdf5_read(dw->hdfile, image);
dw->image_dirty = 0;
clean_image(image);
if ( dw->clean ) clean_image(image);
/* Deal with the old image, if existing */
if ( dw->image != NULL ) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment