aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/crystfel_gui.c8
-rw-r--r--src/crystfelimageview.c6
-rw-r--r--src/crystfelimageview.h2
-rw-r--r--src/gui_peaksearch.c4
-rw-r--r--src/gui_project.c1
-rw-r--r--src/gui_project.h1
6 files changed, 9 insertions, 13 deletions
diff --git a/src/crystfel_gui.c b/src/crystfel_gui.c
index c3395534..cf1e483e 100644
--- a/src/crystfel_gui.c
+++ b/src/crystfel_gui.c
@@ -255,13 +255,17 @@ static void finddata_response_sig(GtkWidget *dialog, gint resp,
g_free(proj->geom_filename);
proj->geom_filename = geom_filename;
+ data_template_free(proj->dtempl);
+ proj->dtempl = dtempl;
+
g_free(proj->data_top_folder);
proj->data_top_folder = g_file_get_path(top);
crystfel_image_view_set_datatemplate(CRYSTFEL_IMAGE_VIEW(proj->imageview),
- dtempl);
+ proj->dtempl);
- add_files(proj, top, proj->data_search_pattern, dtempl);
+ add_files(proj, top, proj->data_search_pattern,
+ proj->dtempl);
g_object_unref(top);
diff --git a/src/crystfelimageview.c b/src/crystfelimageview.c
index be14ce9f..f36f0478 100644
--- a/src/crystfelimageview.c
+++ b/src/crystfelimageview.c
@@ -864,12 +864,6 @@ struct image *crystfel_image_view_get_image_struct(CrystFELImageView *iv)
}
-const DataTemplate *crystfel_image_view_get_datatemplate(CrystFELImageView *iv)
-{
- return iv->dtempl;
-}
-
-
void crystfel_image_view_set_peaks(CrystFELImageView *iv,
ImageFeatureList *peaks,
int list_num)
diff --git a/src/crystfelimageview.h b/src/crystfelimageview.h
index 4cfd3273..eafb0c44 100644
--- a/src/crystfelimageview.h
+++ b/src/crystfelimageview.h
@@ -107,8 +107,6 @@ extern GtkWidget *crystfel_image_view_new(void);
extern int crystfel_image_view_set_datatemplate(CrystFELImageView *iv,
DataTemplate *dtempl);
-extern const DataTemplate *crystfel_image_view_get_datatemplate(CrystFELImageView *iv);
-
extern int crystfel_image_view_set_image(CrystFELImageView *iv,
const char *filename,
const char *event);
diff --git a/src/gui_peaksearch.c b/src/gui_peaksearch.c
index 5d4903cd..eedb558d 100644
--- a/src/gui_peaksearch.c
+++ b/src/gui_peaksearch.c
@@ -54,12 +54,10 @@ void update_peaks(struct crystfelproject *proj)
if ( proj->show_peaks ) {
struct image *image;
- const DataTemplate *dtempl;
image = crystfel_image_view_get_image_struct(CRYSTFEL_IMAGE_VIEW(proj->imageview));
if ( image == NULL ) return;
- dtempl = crystfel_image_view_get_datatemplate(CRYSTFEL_IMAGE_VIEW(proj->imageview));
image_feature_list_free(image->features);
image->features = NULL;
@@ -90,7 +88,7 @@ void update_peaks(struct crystfelproject *proj)
case PEAK_HDF5:
case PEAK_CXI:
- image->features = image_read_peaks(dtempl,
+ image->features = image_read_peaks(proj->dtempl,
image->filename,
image->ev,
proj->peak_search_params.half_pixel_shift);
diff --git a/src/gui_project.c b/src/gui_project.c
index ec6f1c45..280cc1be 100644
--- a/src/gui_project.c
+++ b/src/gui_project.c
@@ -413,6 +413,7 @@ void default_project(struct crystfelproject *proj)
proj->data_search_pattern = 0;
proj->stream_filename = NULL;
proj->stream = NULL;
+ proj->dtempl = NULL;
/* Default parameter values */
proj->show_peaks = 0;
diff --git a/src/gui_project.h b/src/gui_project.h
index 1b2e2525..c2d540a9 100644
--- a/src/gui_project.h
+++ b/src/gui_project.h
@@ -86,6 +86,7 @@ struct crystfelproject {
* 'filenames' list should be complete */
enum match_type_id data_search_pattern;
+ DataTemplate *dtempl;
Stream *stream;
int n_frames;
int max_frames;