Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Oleksii Turkot
CrystFEL
Commits
383d7710
Commit
383d7710
authored
Jan 12, 2010
by
Thomas White
Browse files
Add options to specify boost and binning on the command line
parent
f1fa3630
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/displaywindow.c
View file @
383d7710
...
...
@@ -29,9 +29,6 @@
#include
"utils.h"
#define INITIAL_BINNING 2
static
void
displaywindow_error
(
DisplayWindow
*
dw
,
const
char
*
message
)
{
GtkWidget
*
window
;
...
...
@@ -929,7 +926,8 @@ static gint displaywindow_press(GtkWidget *widget, GdkEventButton *event,
}
DisplayWindow
*
displaywindow_open
(
const
char
*
filename
,
const
char
*
peaks
)
DisplayWindow
*
displaywindow_open
(
const
char
*
filename
,
const
char
*
peaks
,
int
boost
,
int
binning
)
{
DisplayWindow
*
dw
;
char
*
title
;
...
...
@@ -991,7 +989,8 @@ DisplayWindow *displaywindow_open(const char *filename, const char *peaks)
gtk_window_set_resizable
(
GTK_WINDOW
(
dw
->
window
),
FALSE
);
gtk_widget_show_all
(
dw
->
window
);
dw
->
binning
=
INITIAL_BINNING
;
dw
->
binning
=
binning
;
dw
->
boostint
=
boost
;
displaywindow_update
(
dw
);
/* Peak list provided at startup? */
...
...
src/displaywindow.h
View file @
383d7710
...
...
@@ -67,7 +67,8 @@ typedef struct {
/* Open an image display window showing the given filename, or NULL */
extern
DisplayWindow
*
displaywindow_open
(
const
char
*
filename
,
const
char
*
peaks
);
const
char
*
peaks
,
int
boost
,
int
binning
);
#endif
/* DISPLAYWINDOW_H */
src/hdfsee.c
View file @
383d7710
...
...
@@ -36,6 +36,8 @@ 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
"
" -b, --binning=<n> Set display binning to <n>.
\n
"
"
\n
"
);
}
...
...
@@ -72,11 +74,15 @@ int main(int argc, char *argv[])
size_t
i
;
int
nfiles
;
char
*
peaks
=
NULL
;
int
boost
=
1
;
int
binning
=
2
;
/* Long options */
const
struct
option
longopts
[]
=
{
{
"help"
,
0
,
NULL
,
'h'
},
{
"peak-overlay"
,
1
,
NULL
,
'p'
},
{
"int-boost"
,
1
,
NULL
,
'i'
},
{
"binning"
,
1
,
NULL
,
'b'
},
{
0
,
0
,
NULL
,
0
}
};
...
...
@@ -84,7 +90,7 @@ int main(int argc, char *argv[])
gtk_init
(
&
argc
,
&
argv
);
/* Short options */
while
((
c
=
getopt_long
(
argc
,
argv
,
"hp:"
,
longopts
,
NULL
))
!=
-
1
)
{
while
((
c
=
getopt_long
(
argc
,
argv
,
"hp:
b:i:
"
,
longopts
,
NULL
))
!=
-
1
)
{
switch
(
c
)
{
case
'h'
:
{
...
...
@@ -97,6 +103,23 @@ int main(int argc, char *argv[])
break
;
}
case
'i'
:
{
boost
=
atoi
(
optarg
);
if
(
boost
<
1
)
{
ERROR
(
"Intensity boost must be a positive"
" integer.
\n
"
);
}
break
;
}
case
'b'
:
{
binning
=
atoi
(
optarg
);
if
(
boost
<
1
)
{
ERROR
(
"Binning must be a positive integer.
\n
"
);
}
break
;
}
case
0
:
{
break
;
}
...
...
@@ -116,7 +139,8 @@ int main(int argc, char *argv[])
}
for
(
i
=
0
;
i
<
nfiles
;
i
++
)
{
main_window_list
[
i
]
=
displaywindow_open
(
argv
[
optind
+
i
],
peaks
);
main_window_list
[
i
]
=
displaywindow_open
(
argv
[
optind
+
i
],
peaks
,
boost
,
binning
);
if
(
main_window_list
[
i
]
==
NULL
)
{
ERROR
(
"Couldn't open display window
\n
"
);
}
else
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment