1 /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 c-style: "K&R" -*- */
3 /*----------------------------------------------------------------------
5 gpiv - Graphic program for Particle Image Velocimetry, based on gtk/gnome
8 Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008
11 This file is part of gpiv.
13 Gpiv is free software; you can redistribute it and/or modify
14 it under the terms of the GNU General Public License as published by
15 the Free Software Foundation; either version 2, or (at your option)
18 This program is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU General Public License for more details.
23 You should have received a copy of the GNU General Public License
24 along with this program; if not, write to the Free Software Foundation,
25 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27 ----------------------------------------------------------------------*/
30 * (callback) functions for Piv evaluation window/tabulator
32 * Revision 1.23 2008-04-28 12:00:57 gerber
33 * hdf-formatted files are now with .hdf extension (previously: .gpi)
35 * Revision 1.22 2007-11-23 16:24:07 gerber
36 * release 0.5.0: Kafka
38 * Revision 1.21 2007-06-06 17:00:48 gerber
39 * Retreives images/data from URI using Gnome Virtual File System.
41 * Revision 1.20 2007-03-22 16:00:32 gerber
42 * Added image processing tabulator
44 * Revision 1.19 2007-02-16 17:09:48 gerber
45 * added Gauss weighting on I.A. and SPOF filtering (on correlation function)
47 * Revision 1.18 2007/02/05 15:17:09 gerber
48 * auto stretching, broadcast display settings to buffers from preferences
50 * Revision 1.17 2007-01-29 11:27:43 gerber
51 * added image formats png, gif, tif png, bmp, improved buffer display
53 * Revision 1.16 2006-09-18 07:27:06 gerber
54 * *** empty log message ***
56 * Revision 1.15 2006/01/31 14:28:12 gerber
59 * Revision 1.13 2005/02/26 09:43:30 gerber
60 * parameter flags (parameter_logic) defined as gboolean
62 * Revision 1.12 2005/02/26 09:17:14 gerber
63 * structured of interrogate function by using gpiv_piv_isiadapt
65 * Revision 1.11 2005/01/19 15:53:42 gerber
66 * Initiation of Data Acquisition (DAC); trigerring of lasers and camera
67 * by using RTAI and Realtime Linux, recording images from IEEE1394
68 * (Firewire) IIDC compliant camera's
70 * Revision 1.10 2004/10/15 19:24:05 gerber
71 * GPIV_ and Gpiv prefix to defines and structure names of libgpiv
73 * Revision 1.9 2004/06/14 21:19:23 gerber
74 * Image depth up to 16 bits.
75 * Improvement "single int" and "drag int" in Eval tab.
76 * Viewer's pop-up menu.
77 * Adaption for gpiv_matrix_* and gpiv_vector_*.
79 * See Changelog for further info.
81 * Revision 1.8 2003/09/01 11:17:15 gerber
82 * improved monitoring of interrogation process
84 * Revision 1.7 2003/08/22 15:24:52 gerber
85 * interactive spatial scaling
87 * Revision 1.6 2003/07/13 14:38:18 gerber
88 * changed error handling of libgpiv
90 * Revision 1.5 2003/07/12 21:21:16 gerber
91 * changed error handling libgpiv
93 * Revision 1.3 2003/07/10 11:56:07 gerber
96 * Revision 1.2 2003/06/27 13:47:26 gerber
97 * display ruler, line/point evaluation
99 * Revision 1.1.1.1 2003/06/17 17:10:52 gerber
105 #include "gpiv_gui.h"
108 #include "piveval_interrogate.h"
113 * Private piv evaluation functions
118 display_img (float **img
,
128 GnomeCanvasItem
**gci
,
132 /* ----------------------------------------------------------------------------
133 * Displaying routine in gnome canvas
138 float min
= 1000.0, max
= -1000.0;
140 GdkPixbuf
*pixbuf
= NULL
;
144 assert (img
[0] != NULL
);
146 fact
= fact
<< (gl_image_par
->depth
- depth
);
147 /* g_message ("DISPLAY_IMG:: fact = %d", fact); */
149 if (*rgbbuf
!= NULL
) {
154 if (*rgbbuf
== NULL
) {
156 * row stride; each row is a 4-byte buffer array
158 rgb_width
= (i_max
- i_min
) * 3;
159 while ((rgb_width
) % 4 != 0) {
163 *rgbbuf
= g_malloc (rgb_width
* 3 * (j_max
- j_min
));
168 gtk_object_destroy (GTK_OBJECT(*gci
));
173 pixbuf
= gdk_pixbuf_new_from_data (*rgbbuf
,
185 *gci
= gnome_canvas_item_new (gnome_canvas_root( GNOME_CANVAS
187 gnome_canvas_pixbuf_get_type (),
190 /* BUGFIX: new (check mem) */
191 /* gdk_pixbuf_unref (pixbuf); */
194 affine
[4] = (GPIV_MAX_INTERR_SIZE
- gpiv_var
->piv_disproc_zoom
196 affine
[5] = (GPIV_MAX_INTERR_SIZE
- gpiv_var
->piv_disproc_zoom
198 gnome_canvas_item_affine_absolute (*gci
, affine
);
201 * As the mean has been subtracted from the image data, image intensities
202 * will have to be tilted above zero
205 for (j
= j_min
; j
< j_max
; j
++) {
206 for (i
= i_min
; i
< i_max
; i
++) {
215 for (j
= j_min
; j
< j_max
; j
++) {
216 for (i
= i_min
; i
< i_max
; i
++) {
218 img
[j
][i
] = (255.0 / (max
- min
)) * img
[j
][i
];
219 *pos
++ = (unsigned char) img
[j
][i
];
220 *pos
++ = (unsigned char) img
[j
][i
];
221 *pos
++ = (unsigned char) img
[j
][i
];
230 for (j
= j_min
; j
< j_max
; j
++) {
231 for (i
= i_min
; i
< i_max
; i
++) {
237 /* if ( min < display_act->img.img_mean) */
238 /* display_act->img.img_mean = min; */
242 for (j
= j_min
; j
< j_max
; j
++) {
243 for (i
= i_min
; i
< i_max
; i
++) {
244 /* *pos++ = (unsigned char) img[j][i] - (unsigned char) min */
245 /* + (unsigned char) display_act->img.img_mean; */
246 /* *pos++ = (unsigned char) img[j][i] - (unsigned char) min */
247 /* + (unsigned char) display_act->img.img_mean; */
248 /* *pos++ = (unsigned char) img[j][i] - (unsigned char) min */
249 /* + (unsigned char) display_act->img.img_mean; */
251 * BUGFIX: display image intars with: 8 < depth < 16
254 *pos
++ = (guchar
) ((img
[j
][i
] - /* (guchar) */ min
+
255 /* (guchar) */ display_act
->img
->img_mean
)
257 *pos
++ = (guchar
) ((img
[j
][i
] - /* (guchar) */ min
+
258 /* (guchar) */ display_act
->img
->img_mean
)
260 *pos
++ = (guchar
) ((img
[j
][i
] - /* (guchar) */ min
+
261 /* (guchar) */ display_act
->img
->img_mean
)
268 gdk_pixbuf_unref (pixbuf
);
269 *int_size_old
= int_size
;
270 /* g_free(rgbbuf); */
277 alloc_bufmem_per_intarea (int index_y
,
280 GpivImagePar image_par
,
283 /* ----------------------------------------------------------------------------
284 * Memory allocation of covariance in a packed interrogation area array
292 free_bufmem_per_intarea (int index_y
,
295 GpivImagePar image_par
,
298 /*-----------------------------------------------------------------------------
306 adjust_radio_button_intsize_f (GpivPivPar
*piv_par
,
309 /* ----------------------------------------------------------------------------
310 * Adjust radio button interrogation size 1 in PIV interrogation tab
313 if (piv_par
->int_size_f
== 16) {
314 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
315 (eval
->radiobutton_intsize_f_2
), TRUE
);
316 } else if (piv_par
->int_size_f
== 32) {
317 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
318 (eval
->radiobutton_intsize_f_3
), TRUE
);
319 } else if (piv_par
->int_size_f
== 64) {
320 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
321 (eval
->radiobutton_intsize_f_4
), TRUE
);
322 } else if (piv_par
->int_size_f
== 128) {
323 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
324 (eval
->radiobutton_intsize_f_5
), TRUE
);
331 adjust_radio_button_intsize_i (GpivPivPar
*piv_par
,
334 /* ----------------------------------------------------------------------------
335 * Adjust radio button interrogation size 1 in PIV interrogation tab
338 if (piv_par
->int_size_i
== 16) {
339 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
340 (eval
->radiobutton_intsize_i_2
), TRUE
);
341 } else if (piv_par
->int_size_i
== 32) {
342 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
343 (eval
->radiobutton_intsize_i_3
), TRUE
);
344 } else if (piv_par
->int_size_i
== 64) {
345 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
346 (eval
->radiobutton_intsize_i_4
), TRUE
);
347 } else if (piv_par
->int_size_i
== 128) {
348 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
349 (eval
->radiobutton_intsize_i_5
), TRUE
);
357 adjust_radio_button_intshift (GpivPivPar
*piv_par
,
359 /* ----------------------------------------------------------------------------
360 * Adjust radio button interrogation area shift in PIV interrogation tab
363 if (piv_par
->int_shift
== 8) {
364 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
365 (eval
->radiobutton_intshift_1
), TRUE
);
366 } else if (piv_par
->int_shift
== 16) {
367 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
368 (eval
->radiobutton_intshift_2
), TRUE
);
369 } else if (piv_par
->int_shift
== 32) {
370 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
371 (eval
->radiobutton_intshift_3
), TRUE
);
372 } else if (piv_par
->int_shift
== 64) {
373 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
374 (eval
->radiobutton_intshift_4
), TRUE
);
375 } else if (piv_par
->int_shift
== 128) {
376 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
377 (eval
->radiobutton_intshift_5
), TRUE
);
384 * Display functions in PIV tabulator canvas
389 display_piv_vector (guint i
,
391 GpivPivData
*piv_data
,
394 /* ----------------------------------------------------------------------------
395 * Displays values in PIV tabulator of the GUI
398 /* float **dx = piv_data->dx, **dy = piv_data->dy; */
399 /* int **peak_no = piv_data->peak_no; */
400 GnomeCanvasPoints
*points
;
401 float dl
= sqrt (piv_data
->dx
[i
][j
] * piv_data
->dx
[i
][j
] +
402 piv_data
->dy
[i
][j
] * piv_data
->dy
[i
][j
]);
404 points
= gnome_canvas_points_new (2);
406 eval
->monitor
->pi_da
->dx
[0][0] = piv_data
->dx
[i
][j
];
407 eval
->monitor
->pi_da
->dy
[0][0] = piv_data
->dy
[i
][j
];
408 eval
->monitor
->pi_da
->peak_no
[0][0] = piv_data
->peak_no
[i
][j
];
410 if (eval
->monitor
->pi_da
->peak_no
[0][0] == -1) {
412 } else if (eval
->monitor
->pi_da
->peak_no
[0][0] == 0) {
414 } else if (eval
->monitor
->pi_da
->peak_no
[0][0] == 1) {
416 } else if (eval
->monitor
->pi_da
->peak_no
[0][0] == 2) {
419 /* if (eval->monitor->pi_da->peak_no[i][j] == 3) */
423 points
->coords
[0] = GPIV_MAX_INTERR_SIZE
/ 2;
424 points
->coords
[1] = GPIV_MAX_INTERR_SIZE
/ 2;
425 points
->coords
[2] = GPIV_MAX_INTERR_SIZE
/ 2 + eval
->monitor
->pi_da
->dx
[0][0]
426 * gpiv_var
->piv_disproc_vlength
;
427 points
->coords
[3] = GPIV_MAX_INTERR_SIZE
/ 2 + eval
->monitor
->pi_da
->dy
[0][0]
428 * gpiv_var
->piv_disproc_vlength
;
431 if (eval
->monitor
->gci_vec
!= NULL
) {
432 gnome_canvas_item_set (eval
->monitor
->gci_vec
,
435 "width_units", (double) THICKNESS
,
436 "first_arrowhead", FALSE
,
437 "last_arrowhead", TRUE
,
438 "arrow_shape_a", (double) ARROW_LENGTH
*
439 ARROW_FACT
*dl
* gpiv_par
->display__vector_scale
+
441 "arrow_shape_b", (double) ARROW_EDGE
*
442 ARROW_FACT
* dl
* gpiv_par
->display__vector_scale
+
444 "arrow_shape_c", (double) ARROW_WIDTH
*
445 ARROW_FACT
* dl
* gpiv_par
->display__vector_scale
+
449 eval
->monitor
->gci_vec
=
450 gnome_canvas_item_new (gnome_canvas_root
451 (GNOME_CANVAS(eval
->canvas_monitor_vec
)),
452 gnome_canvas_line_get_type(),
455 "width_units",(double) THICKNESS
,
456 "first_arrowhead", TRUE
,
457 "arrow_shape_a", (double) ARROW_LENGTH
*
458 ARROW_FACT
*dl
* gpiv_par
->display__vector_scale
+
460 "arrow_shape_b", (double) ARROW_EDGE
*
461 ARROW_FACT
* dl
* gpiv_par
->display__vector_scale
+
463 "arrow_shape_c", (double) ARROW_WIDTH
*
464 ARROW_FACT
* dl
* gpiv_par
->display__vector_scale
+
467 /* "arrow_shape_a", (double) THICKNESS, */
472 gnome_canvas_points_free (points
);
478 display_img_intreg1 (float **intreg1
,
482 /* ----------------------------------------------------------------------------
483 * Displays image of intreg1 for drawing area
484 * row stride; each row is a 4-byte buffer array
487 display_img (intreg1
,
489 &eval
->monitor
->int_size_old
,
494 eval
->monitor
->rgb_int_width
,
495 &eval
->monitor
->rgbbuf_int1
,
496 eval
->canvas_monitor_int1
,
497 &eval
->monitor
->gci_int1
,
498 eval
->monitor
->affine
,
504 void display_img_intreg2 (float **intreg2
,
508 /* ----------------------------------------------------------------------------
509 * Displays image of intreg2 for drawing area
512 display_img (intreg2
,
514 &eval
->monitor
->int_size_old
,
519 eval
->monitor
->rgb_int_width
,
520 &eval
->monitor
->rgbbuf_int2
,
521 eval
->canvas_monitor_int2
,
522 &eval
->monitor
->gci_int2
,
523 eval
->monitor
->affine
,
530 void display_img_cov (GpivCov
*cov
,
534 /* ----------------------------------------------------------------------------
535 * Displays image of intreg1 for drawing area
540 &eval
->monitor
->cov_size_old
,
545 eval
->monitor
->rgb_cov_width
,
546 &eval
->monitor
->rgbbuf_cov
,
547 eval
->canvas_monitor_cov
,
548 &eval
->monitor
->gci_cov
,
549 eval
->monitor
->affine
,
556 * Piv evaluation window/tabulator callbacks
561 on_radiobutton_piv_mouse (GtkWidget
*widget
,
564 /*-----------------------------------------------------------------------------
567 GpivConsole
*gpiv
= gtk_object_get_data(GTK_OBJECT(widget
), "gpiv");
568 m_select
= atoi(gtk_object_get_data(GTK_OBJECT(widget
),
571 /* g_message ("on_radiobutton_piv_mouse:: 0 m_select = %d", m_select); */
572 if (m_select
== NO_MS
) {
573 gl_piv_par
->int_geo
= GPIV_AOI
;
575 } else if (m_select
== AOI_MS
) {
576 gl_piv_par
->int_geo
= GPIV_AOI
;
577 } else if (m_select
== SINGLE_POINT_MS
) {
578 gl_piv_par
->int_geo
= GPIV_POINT
;
579 } else if (m_select
== V_LINE_MS
) {
580 /* gl_piv_par->int_geo = GPIV_LINE_C; */
581 gl_piv_par
->int_geo
= GPIV_AOI
;
582 } else if (m_select
== H_LINE_MS
) {
583 /* gl_piv_par->int_geo = GPIV_LINE_R; */
584 gl_piv_par
->int_geo
= GPIV_AOI
;
585 } else if (m_select
== SINGLE_AREA_MS
||
586 m_select
== DRAG_MS
) {
587 gl_piv_par
->int_geo
= GPIV_POINT
;
591 * (Re)setting interrogation scheme if necessary
593 if ((m_select
== SINGLE_AREA_MS
594 || m_select
== DRAG_MS
595 || m_select
== SINGLE_POINT_MS
596 || m_select
== V_LINE_MS
597 || m_select
== H_LINE_MS
)
598 && gl_piv_par
->int_scheme
== GPIV_IMG_DEFORM
600 char message
[2 * GPIV_MAX_CHARS
];
601 g_snprintf (message
, 2 * GPIV_MAX_CHARS
,
602 _("Image deformation is impossibe with this Mouse select.\n\
603 Setting Interrogation scheme to Central difference.\n\
604 This will be reset automatically after interrogating."));
605 warning_gpiv (message
);
606 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
607 (gpiv
->piveval
->radiobutton_centraldiff
),
609 int_scheme_autochanged
= TRUE
;
611 if (int_scheme_autochanged
) {
612 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
613 (gpiv
->piveval
->radiobutton_imgdeform
),
615 int_scheme_autochanged
= FALSE
;
623 on_radiobutton_piv_mouse1_enter (GtkWidget
*widget
,
626 /*-----------------------------------------------------------------------------
629 GpivConsole
*gpiv
= gtk_object_get_data (GTK_OBJECT(widget
), "gpiv");
630 gchar
*msg
= _("No mouse activity within displayer");
631 gnome_appbar_set_status (GNOME_APPBAR(gpiv
->appbar
), msg
);
637 on_radiobutton_piv_mouse2_enter (GtkWidget
*widget
,
640 /*-----------------------------------------------------------------------------
643 GpivConsole
*gpiv
= gtk_object_get_data (GTK_OBJECT (widget
), "gpiv");
644 gchar
*msg
= _("Selects an area within the image to be analyzed");
645 gnome_appbar_set_status (GNOME_APPBAR(gpiv
->appbar
), msg
);
651 on_radiobutton_piv_mouse3_enter (GtkWidget
*widget
,
654 /*-----------------------------------------------------------------------------
657 GpivConsole
*gpiv
= gtk_object_get_data (GTK_OBJECT(widget
), "gpiv");
658 gchar
*msg
= _("Piv evaluation at a single interrogation area. "
659 "Conserves other existing data");
660 gnome_appbar_set_status (GNOME_APPBAR(gpiv
->appbar
), msg
);
666 on_radiobutton_piv_mouse4_enter (GtkWidget
*widget
,
669 /*-----------------------------------------------------------------------------
672 GpivConsole
*gpiv
= gtk_object_get_data (GTK_OBJECT(widget
), "gpiv");
673 gchar
*msg
= _("Piv evaluation at a single point in the image. "
674 "Rejects all existing data!!");
675 gnome_appbar_set_status (GNOME_APPBAR(gpiv
->appbar
), msg
);
681 on_radiobutton_piv_mouse5_enter (GtkWidget
*widget
,
684 /*-----------------------------------------------------------------------------
687 GpivConsole
*gpiv
= gtk_object_get_data (GTK_OBJECT(widget
), "gpiv");
688 gchar
*msg
= _("Displaces a single interrogation area and analyzes");
689 gnome_appbar_set_status (GNOME_APPBAR (gpiv
->appbar
), msg
);
695 on_radiobutton_piv_mouse6_enter (GtkWidget
*widget
,
698 /*-----------------------------------------------------------------------------
701 GpivConsole
*gpiv
= gtk_object_get_data (GTK_OBJECT(widget
), "gpiv");
702 gchar
*msg
= _("Evaluation at a vertical line. ");
703 gnome_appbar_set_status (GNOME_APPBAR(gpiv
->appbar
), msg
);
709 on_radiobutton_piv_mouse7_enter (GtkWidget
*widget
,
712 /*-----------------------------------------------------------------------------
715 GpivConsole
*gpiv
= gtk_object_get_data (GTK_OBJECT(widget
), "gpiv");
716 gchar
*msg
= _("Evaluation at a horizontal line. ");
717 gnome_appbar_set_status (GNOME_APPBAR(gpiv
->appbar
), msg
);
723 on_spinbutton_piv_int (GtkSpinButton
*widget
,
726 /*-----------------------------------------------------------------------------
729 char *err_msg
= NULL
;
730 PivEval
*eval
= gtk_object_get_data(GTK_OBJECT (widget
), "eval");
731 guint nx
= 0, ny
= 0;
732 guint nx_img
= 0, ny_img
= 0;
733 gboolean renew
= TRUE
, lo_display_intregs
= FALSE
;
748 /* eval = gtk_object_get_data(GTK_OBJECT(widget), "eval"); */
752 /* Display display_act; */
753 /* display_act = gtk_object_get_data(widget, display_act); */
756 * Select which variable has to be modified
758 setby_spinbutton
= 1;
759 var_type
= atoi(gtk_object_get_data (GTK_OBJECT (widget
), "var_type"));
761 if (var_type
== COL_START
) {
762 gl_piv_par
->col_start
= gtk_spin_button_get_value_as_int (widget
);
764 } else if (var_type
== COL_END
) {
765 gl_piv_par
->col_end
= gtk_spin_button_get_value_as_int (widget
);
767 } else if (var_type
== PRESHIFT_COL
) {
768 gl_piv_par
->pre_shift_col
= gtk_spin_button_get_value_as_int (widget
);
770 } else if (var_type
== ROWSTART
) {
771 gl_piv_par
->row_start
= gtk_spin_button_get_value_as_int (widget
);
773 } else if (var_type
== ROWEND
) {
774 gl_piv_par
->row_end
= gtk_spin_button_get_value_as_int (widget
);
776 } else if (var_type
== PRESHIFT_ROW
) {
777 gl_piv_par
->pre_shift_row
= gtk_spin_button_get_value_as_int (widget
);
779 } else if (var_type
== INT_SIZE_F
) {
780 gl_piv_par
->int_size_f
= gtk_spin_button_get_value_as_int (widget
);
783 * Adapt spinbutton of int_size_i
785 GTK_ADJUSTMENT(eval
->spinbutton_adj_intsize_i
)->lower
=
786 (gfloat
) gl_piv_par
->int_size_f
;
787 GTK_ADJUSTMENT(eval
->spinbutton_adj_intsize_i
)->upper
=
789 gtk_adjustment_changed (GTK_ADJUSTMENT(eval
->spinbutton_adj_intsize_i
));
790 gtk_adjustment_set_value (GTK_ADJUSTMENT(eval
->spinbutton_adj_intsize_i
),
791 (gfloat
) gl_piv_par
->int_size_f
);
794 * Adjust radio buttons for final interrogation size
796 adjust_radio_button_intsize_f (gl_piv_par
, eval
);
798 } else if (var_type
== INT_SIZE_I
) {
799 char message
[GPIV_MAX_CHARS
];
801 gl_piv_par
->int_size_i
= gtk_spin_button_get_value_as_int (widget
);
802 if ((gl_piv_par
->int_scheme
== GPIV_NO_CORR
803 || gl_piv_par
->int_scheme
== GPIV_LK_WEIGHT
)
804 && gl_piv_par
->int_size_i
> gl_piv_par
->int_size_f
) {
805 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
806 (eval
->radiobutton_imgdeform
),
808 g_snprintf (message
, GPIV_MAX_CHARS
,
809 _("Int Size 2 > Int Size 1 \nSetting Interrogation scheme to Image deformation"));
810 warning_gpiv(message
);
813 /* gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON */
814 /* (eval->radiobutton_zerooff), */
819 * Adjust radio buttons for initial interrogation size
821 adjust_radio_button_intsize_i (gl_piv_par
, eval
);
823 } else if (var_type
== INT_SHIFT
) {
824 gl_piv_par
->int_shift
= gtk_spin_button_get_value_as_int (widget
);
827 * Adjust radio buttons for interrogation area shift
829 adjust_radio_button_intshift (gl_piv_par
, eval
);
833 * Update eventually interrogation region contours.
835 if (display_act
!= NULL
) {
837 gpiv_piv_testadjust_parameters (display_act
->img
->image
->header
,
840 warning_gpiv ("%s", err_msg
);
844 display_act
->intreg
->par
->row_start
= gl_piv_par
->row_start
;
845 display_act
->intreg
->par
->row_end
= gl_piv_par
->row_end
;
846 display_act
->intreg
->par
->col_start
= gl_piv_par
->col_start
;
847 display_act
->intreg
->par
->col_end
= gl_piv_par
->col_end
;
848 display_act
->intreg
->par
->int_shift
= gl_piv_par
->int_shift
;
849 display_act
->intreg
->par
->int_size_f
= gl_piv_par
->int_size_f
;
850 display_act
->intreg
->par
->int_size_i
= gl_piv_par
->int_size_i
;
851 display_act
->intreg
->par
->pre_shift_row
= gl_piv_par
->pre_shift_row
;
852 display_act
->intreg
->par
->pre_shift_col
= gl_piv_par
->pre_shift_col
;
854 display_act
->intreg
->par
->row_start__set
= TRUE
;
855 display_act
->intreg
->par
->row_end__set
= TRUE
;
856 display_act
->intreg
->par
->col_start__set
= TRUE
;
857 display_act
->intreg
->par
->col_end__set
= TRUE
;
858 display_act
->intreg
->par
->int_size_f__set
= TRUE
;
859 display_act
->intreg
->par
->int_size_i__set
= TRUE
;
860 display_act
->intreg
->par
->int_shift__set
= TRUE
;
861 display_act
->intreg
->par
->pre_shift_row__set
= TRUE
;
862 display_act
->intreg
->par
->pre_shift_col__set
= TRUE
;
864 if (display_act
->intreg
->exist_int
) {
865 nx
= display_act
->intreg
->data
->nx
;
866 ny
= display_act
->intreg
->data
->ny
;
869 gpiv_piv_count_pivdata_fromimage (display_act
->img
->image
->header
,
870 display_act
->intreg
->par
,
874 warning_gpiv ("on_spinbutton_piv_int: %s", err_msg
);
875 g_warning ("on_spinbutton_piv_int: %s", err_msg
);
879 * For some operations the intregs have to be renewed unconditionally,
880 * for others only in case if the number of intregs has been changed
882 if (var_type
== COL_START
|| var_type
== COL_END
883 || var_type
== ROWSTART
|| var_type
== ROWEND
) {
893 lo_display_intregs
= display_act
->display_intregs
;
894 destroy_all_intregs (display_act
);
895 create_all_intregs (display_act
);
896 display_act
->display_intregs
= lo_display_intregs
;
897 if (display_act
->display_intregs
) show_all_intregs(display_act
);
903 setby_spinbutton
= 0;
909 on_radiobutton_piv_int (GtkWidget
*widget
,
912 /*-----------------------------------------------------------------------------
916 gboolean lo_display_intregs
= FALSE
;
917 gint nx_tmp
= 0, ny_tmp
= 0;
918 /* gint setby_spinbutton = atoi(gtk_object_get_data(GTK_OBJECT(widget), */
919 /* "setby_spinbutton")); */
920 PivEval
*eval
= gtk_object_get_data(GTK_OBJECT (widget
), "eval");
921 Display
*disp
= display_act
;
932 && disp
->intreg
->exist_int
) {
933 nx
= disp
->intreg
->data
->nx
;
934 ny
= disp
->intreg
->data
->ny
;
940 if (GTK_TOGGLE_BUTTON(widget
)->active
) {
941 var_type
= atoi(gtk_object_get_data (GTK_OBJECT(widget
),
945 * Select which variable has to be modified
947 if (var_type
== SIZE_F
) {
948 int_size_f_tmp
= gl_piv_par
->int_size_f
;
949 gl_piv_par
->int_size_f
= atoi (gtk_object_get_data
953 * switch off temporarly display_intregs
956 lo_display_intregs
= disp
->display_intregs
;
957 disp
->display_intregs
= FALSE
;
961 adjust_radiobutton_piv_int (eval
, gl_piv_par
->int_size_f
);
964 * return display_intregs to original value
967 disp
->display_intregs
= lo_display_intregs
;
972 * BUGFIX: REMOVE Reset weight and zero_off
974 if (gl_piv_par
->int_size_i
> int_size_f_tmp
) {
975 /* gtk_widget_set_sensitive(eval->radiobutton_zerooff, TRUE); */
976 /* gtk_widget_set_sensitive(checkbutton_piv_weightkernel, TRUE); */
979 if (int_scheme_tmp != GPIV_ZERO_OFF_FORWARD
980 && int_scheme_tmp != GPIV_ZERO_OFF_CENTRAL) {
981 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
982 (eval->radiobutton_zerooff),
984 gtk_widget_set_sensitive(eval->radiobutton_zerooff, TRUE);
985 gtk_widget_set_sensitive(eval->radiobutton_weightkernel,
987 if (int_scheme_tmp == GPIV_LK_WEIGHT) {
988 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
989 (eval->radiobutton_weightkernel),
991 gtk_widget_set_sensitive(eval->radiobutton_zerooff,
993 gtk_widget_set_sensitive(eval->radiobutton_weightkernel, TRUE);
995 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
996 (eval->radiobutton_weightkernel),
998 gtk_widget_set_sensitive(eval->radiobutton_zerooff,
1000 gtk_widget_set_sensitive(eval->radiobutton_weightkernel,
1004 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1005 (eval->radiobutton_zerooff),
1007 gtk_widget_set_sensitive(eval->radiobutton_zerooff, TRUE);
1008 gtk_widget_set_sensitive(eval->radiobutton_weightkernel,
1015 * Also calls on_spinbutton_piv_int, which, on its turn, may call this function
1016 * again resulting into an infinite loop
1018 gtk_spin_button_set_value (GTK_SPIN_BUTTON
1019 (eval
->spinbutton_intsize_f
),
1020 gl_piv_par
->int_size_f
);
1023 } else if (var_type
== SIZE_I
) {
1024 gl_piv_par
->int_size_i
=
1025 atoi (gtk_object_get_data (GTK_OBJECT(widget
), "intsize_i"));
1030 gtk_adjustment_set_value (GTK_ADJUSTMENT
1031 (eval
->spinbutton_adj_intsize_i
),
1032 (gfloat
) gl_piv_par
->int_size_i
);
1034 * Save origanal settings of weight and zero_off for later resetting
1036 if (gl_piv_par
->int_size_i
> gl_piv_par
->int_size_f
) {
1037 int_scheme_tmp
= gl_piv_par
->int_scheme
;
1039 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1040 (eval->radiobutton_weightkernel), FALSE);
1041 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1042 (eval->radiobutton_zerooff), TRUE);
1043 gtk_widget_set_sensitive(eval->radiobutton_zerooff, FALSE);
1047 * Reset weight and zero_off
1050 /* if (zero_off_tmp == 0) {
1051 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1052 (eval->radiobutton_zerooff), FALSE);
1053 if (weight_tmp == 0) {
1054 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1055 (eval->radiobutton_weightkernel), FALSE);
1057 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1058 (eval->radiobutton_weightkernel), TRUE);
1061 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1062 (eval->radiobutton_zerooff), TRUE);
1064 gtk_widget_set_sensitive(eval->radiobutton_zerooff, TRUE);
1069 } else if (var_type
== SHIFT
) {
1070 gl_piv_par
->int_shift
=
1071 atoi (gtk_object_get_data (GTK_OBJECT(widget
),
1076 gtk_spin_button_set_value (GTK_SPIN_BUTTON
1077 (eval
->spinbutton_intshift
),
1078 gl_piv_par
->int_shift
);
1082 && disp
->intreg
->exist_int
1084 lo_display_intregs
= disp
->display_intregs
;
1085 destroy_all_intregs (disp
);
1086 create_all_intregs (disp
);
1087 disp
->display_intregs
= lo_display_intregs
;
1088 if (disp
->display_intregs
) show_all_intregs(disp
);
1099 on_radiobutton_fit_enter (GtkWidget
*widget
,
1102 /*-----------------------------------------------------------------------------
1105 GpivConsole
*gpiv
= gtk_object_get_data(GTK_OBJECT (widget
), "gpiv");
1106 gchar
*msg
= _("Interpolation scheme for sub-pixel estimation");
1107 gnome_appbar_set_status (GNOME_APPBAR(gpiv
->appbar
), msg
);
1114 on_radiobutton_peak_enter (GtkWidget
*widget
,
1117 /*-----------------------------------------------------------------------------
1120 GpivConsole
*gpiv
= gtk_object_get_data(GTK_OBJECT (widget
), "gpiv");
1121 gchar
*msg
= _("Chooses n-th highest top number of correlation as estimator");
1122 gnome_appbar_set_status (GNOME_APPBAR(gpiv
->appbar
), msg
);
1129 on_radiobutton_interrogatescheme_enter (GtkWidget
*widget
,
1132 /*-----------------------------------------------------------------------------
1135 GpivConsole
*gpiv
= gtk_object_get_data (GTK_OBJECT(widget
), "gpiv");
1136 gchar
*msg
= _("Bias correction scheme");
1137 gnome_appbar_set_status (GNOME_APPBAR(gpiv
->appbar
), msg
);
1144 on_radiobutton_interrogatescheme_imgdeform_enter (GtkWidget
*widget
,
1147 /*-----------------------------------------------------------------------------
1150 GpivConsole
*gpiv
= gtk_object_get_data (GTK_OBJECT(widget
), "gpiv");
1151 gchar
*msg
= _("Deforms image from PIV estimators");
1152 gnome_appbar_set_status (GNOME_APPBAR(gpiv
->appbar
), msg
);
1159 on_toggle_piv (GtkWidget
*widget
,
1162 /*-----------------------------------------------------------------------------
1165 PivEval
*eval
= gtk_object_get_data(GTK_OBJECT (widget
), "eval");
1174 * Select which variable has to be modified
1176 var_type
= atoi (gtk_object_get_data (GTK_OBJECT(widget
), "var_type"));
1178 if (var_type
== IFIT
) {
1179 gl_piv_par
->ifit
= atoi (gtk_object_get_data (GTK_OBJECT(widget
),
1182 } else if (var_type
== PEAK_NR
) {
1183 gl_piv_par
->peak
= atoi (gtk_object_get_data (GTK_OBJECT(widget
),
1187 } else if (var_type
== SCHEME
) {
1188 gl_piv_par
->int_scheme
= atoi(gtk_object_get_data(GTK_OBJECT(widget
),
1191 } else if (var_type
== CORRELATION
) {
1192 gl_image_par
->x_corr
= atoi (gtk_object_get_data (GTK_OBJECT(widget
),
1201 on_checkbutton_weight_ia_enter (GtkWidget
*widget
,
1204 /*-----------------------------------------------------------------------------
1207 GpivConsole
*gpiv
= gtk_object_get_data(GTK_OBJECT (widget
), "gpiv");
1209 _("Gauss weighting on the Interrogation Area");
1210 gnome_appbar_set_status (GNOME_APPBAR(gpiv
->appbar
), msg
);
1216 on_checkbutton_weight_ia (GtkWidget
*widget
,
1218 /*-----------------------------------------------------------------------------
1221 PivEval
*eval
= gtk_object_get_data (GTK_OBJECT(widget
), "eval");
1224 if (GTK_TOGGLE_BUTTON(widget
)->active
) {
1225 gl_piv_par
->gauss_weight_ia
= TRUE
;
1227 gl_piv_par
->gauss_weight_ia
= FALSE
;
1233 on_checkbutton_spof_enter (GtkWidget
*widget
,
1236 /*-----------------------------------------------------------------------------
1239 GpivConsole
*gpiv
= gtk_object_get_data(GTK_OBJECT (widget
), "gpiv");
1241 _("Symmetric Phase Only Filtering on the FT images");
1242 gnome_appbar_set_status (GNOME_APPBAR(gpiv
->appbar
), msg
);
1248 on_checkbutton_spof (GtkWidget
*widget
,
1250 /*-----------------------------------------------------------------------------
1253 PivEval
*eval
= gtk_object_get_data (GTK_OBJECT(widget
), "eval");
1256 if (GTK_TOGGLE_BUTTON(widget
)->active
) {
1257 gl_piv_par
->spof_filter
= TRUE
;
1259 gl_piv_par
->spof_filter
= FALSE
;
1265 adjust_radiobutton_piv_int (PivEval
*eval
,
1268 /* ----------------------------------------------------------------------------
1269 * adjusting and disabling int_size_i and its toggle buttons
1272 /* if (int_size_f == 8) { */
1273 /* gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON */
1274 /* (eval->radiobutton_intsize_i_1), TRUE); */
1277 if (int_size_f
== 16) {
1278 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
1279 (eval
->radiobutton_intsize_i_2
), TRUE
);
1281 } else if (int_size_f
== 32) {
1282 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
1283 (eval
->radiobutton_intsize_i_3
), TRUE
);
1285 } else if (int_size_f
== 64) {
1286 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
1287 (eval
->radiobutton_intsize_i_4
), TRUE
);
1289 } else if (int_size_f
>= 128) {
1290 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
1291 (eval
->radiobutton_intsize_i_5
), TRUE
);
1295 if (int_size_f
<= 64) {
1296 gtk_widget_set_sensitive (GTK_WIDGET(eval
->radiobutton_intsize_i_4
),
1298 if (int_size_f
<= 32) {
1299 gtk_widget_set_sensitive (GTK_WIDGET
1300 (eval
->radiobutton_intsize_i_3
),
1302 if (int_size_f
<= 16) {
1303 gtk_widget_set_sensitive (GTK_WIDGET
1304 (eval
->radiobutton_intsize_i_2
),
1306 /* if (int_size_f <= 8) { */
1307 /* gtk_widget_set_sensitive(GTK_WIDGET */
1308 /* (eval->radiobutton_intsize_i_1), */
1317 if (int_size_f
>= 16) {
1318 /* gtk_widget_set_sensitive(GTK_WIDGET(eval->radiobutton_intsize_i_1), */
1320 if (int_size_f
>= 32) {
1321 gtk_widget_set_sensitive (GTK_WIDGET
1322 (eval
->radiobutton_intsize_i_2
),
1324 if (int_size_f
>= 64) {
1325 gtk_widget_set_sensitive (GTK_WIDGET
1326 (eval
->radiobutton_intsize_i_3
),
1328 if (int_size_f
>= 128) {
1329 gtk_widget_set_sensitive (GTK_WIDGET
1330 (eval
->radiobutton_intsize_i_4
),
1342 on_checkbutton_piv_monitor_enter (GtkWidget
*widget
,
1345 /*-----------------------------------------------------------------------------
1348 GpivConsole
*gpiv
= gtk_object_get_data(GTK_OBJECT (widget
), "gpiv");
1350 _("Displays subimages, correlation function and PIV vector");
1351 gnome_appbar_set_status (GNOME_APPBAR(gpiv
->appbar
), msg
);
1357 on_checkbutton_piv_monitor (GtkWidget
*widget
,
1359 /*-----------------------------------------------------------------------------
1362 PivEval
*eval
= gtk_object_get_data (GTK_OBJECT(widget
), "eval");
1365 if (GTK_TOGGLE_BUTTON(widget
)->active
) {
1366 gpiv_var
->piv_disproc
= TRUE
;
1368 eval
->monitor
->gci_vec_background
=
1369 gnome_canvas_item_new (gnome_canvas_root
1370 (GNOME_CANVAS(eval
->canvas_monitor_vec
)),
1371 gnome_canvas_rect_get_type(),
1374 "x2", (double) GPIV_MAX_INTERR_SIZE
,
1375 "y2", (double) GPIV_MAX_INTERR_SIZE
,
1376 "fill_color", "darkblue",
1381 eval
->monitor
->gci_int1_background
=
1382 gnome_canvas_item_new (gnome_canvas_root
1383 (GNOME_CANVAS(eval
->canvas_monitor_int1
)),
1384 gnome_canvas_rect_get_type(),
1387 "x2", (double) GPIV_MAX_INTERR_SIZE
,
1388 "y2", (double) GPIV_MAX_INTERR_SIZE
,
1389 "fill_color", "darkgreen",
1394 eval
->monitor
->gci_int2_background
=
1395 gnome_canvas_item_new (gnome_canvas_root
1396 (GNOME_CANVAS(eval
->canvas_monitor_int2
)),
1397 gnome_canvas_rect_get_type(),
1400 "x2", (double) GPIV_MAX_INTERR_SIZE
,
1401 "y2", (double) GPIV_MAX_INTERR_SIZE
,
1402 "fill_color", "darkgreen",
1407 eval
->monitor
->gci_background_cov
=
1408 gnome_canvas_item_new (gnome_canvas_root
1409 (GNOME_CANVAS(eval
->canvas_monitor_cov
)),
1410 gnome_canvas_rect_get_type(),
1413 "x2", (double) GPIV_MAX_INTERR_SIZE
,
1414 "y2", (double) GPIV_MAX_INTERR_SIZE
,
1415 "fill_color", "darkred",
1419 gpiv_var
->piv_disproc
= FALSE
;
1421 * Destroy intreg1 image
1423 if (eval
->monitor
->gci_int1_background
!= NULL
) {
1424 gtk_object_destroy (GTK_OBJECT(eval
->monitor
->
1425 gci_int1_background
));
1426 eval
->monitor
->gci_int1_background
= NULL
;
1429 if (eval
->monitor
->rgbbuf_int1
!= NULL
) {
1430 g_free (eval
->monitor
->rgbbuf_int1
);
1431 eval
->monitor
->rgbbuf_int1
= NULL
;
1434 if (eval
->monitor
->gci_int1
!= NULL
) {
1435 gtk_object_destroy (GTK_OBJECT(eval
->monitor
->gci_int1
));
1436 eval
->monitor
->gci_int1
= NULL
;
1440 * Destroy intreg2 image
1442 if (eval
->monitor
->gci_int2_background
!= NULL
) {
1443 gtk_object_destroy (GTK_OBJECT(eval
->monitor
->
1444 gci_int2_background
));
1445 eval
->monitor
->gci_int2_background
= NULL
;
1448 if (eval
->monitor
->rgbbuf_int2
!= NULL
) {
1449 g_free (eval
->monitor
->rgbbuf_int2
);
1450 eval
->monitor
->rgbbuf_int2
= NULL
;
1453 if (eval
->monitor
->gci_int2
!= NULL
) {
1454 gtk_object_destroy (GTK_OBJECT(eval
->monitor
->gci_int2
));
1455 eval
->monitor
->gci_int2
= NULL
;
1459 * Destroy correlation image
1461 if (eval
->monitor
->gci_background_cov
!= NULL
) {
1462 gtk_object_destroy (GTK_OBJECT(eval
->monitor
->gci_background_cov
));
1463 eval
->monitor
->gci_background_cov
= NULL
;
1466 if (eval
->monitor
->rgbbuf_cov
!= NULL
) {
1467 g_free (eval
->monitor
->rgbbuf_cov
);
1468 eval
->monitor
->rgbbuf_cov
= NULL
;
1471 if (eval
->monitor
->gci_cov
!= NULL
) {
1472 gtk_object_destroy (GTK_OBJECT(eval
->monitor
->gci_cov
));
1473 eval
->monitor
->gci_cov
= NULL
;
1479 if (eval
->monitor
->gci_vec_background
!= NULL
) {
1480 gtk_object_destroy (GTK_OBJECT(eval
->monitor
->gci_vec_background
));
1481 eval
->monitor
->gci_vec_background
= NULL
;
1485 if (eval
->monitor
->gci_vec
!= NULL
) {
1486 gtk_object_destroy (GTK_OBJECT(eval
->monitor
->gci_vec
));
1487 eval
->monitor
->gci_vec
= NULL
;
1496 on_spinbutton_piv_monitor_zoom (GtkSpinButton
*widget
,
1499 /*-----------------------------------------------------------------------------
1502 PivEval
*eval
= gtk_object_get_data (GTK_OBJECT(widget
), "eval");
1503 /* gfloat piv_disproc_zoom */
1505 gpiv_var
->piv_disproc_zoom
= gtk_spin_button_get_value_as_float (widget
);
1506 gnome_config_push_prefix("/gpiv/RuntimeVariables/");
1507 gnome_config_set_float ("zoom_factor", gpiv_var
->piv_disproc_zoom
);
1508 gnome_config_pop_prefix ();
1509 gnome_config_sync();
1511 eval
->monitor
->affine
[0] = gpiv_var
->piv_disproc_zoom
;
1512 eval
->monitor
->affine
[3] = gpiv_var
->piv_disproc_zoom
;
1513 eval
->monitor
->affine
[4] =
1514 (GPIV_MAX_INTERR_SIZE
- gpiv_var
->piv_disproc_zoom
1515 * gl_piv_par
->int_size_f
) /2.0;
1516 eval
->monitor
->affine
[5] =
1517 (GPIV_MAX_INTERR_SIZE
- gpiv_var
->piv_disproc_zoom
1518 * gl_piv_par
->int_size_f
) /2.0;
1520 if(eval
->monitor
->gci_int1
!= NULL
) {
1521 gnome_canvas_item_affine_absolute (eval
->monitor
->gci_int1
,
1522 eval
->monitor
->affine
);
1525 if(eval
->monitor
->gci_int2
!= NULL
) {
1526 gnome_canvas_item_affine_absolute (eval
->monitor
->gci_int2
,
1527 eval
->monitor
->affine
);
1531 if(eval
->monitor
->gci_cov
!= NULL
) {
1532 gnome_canvas_item_affine_absolute (eval
->monitor
->gci_cov
,
1533 eval
->monitor
->affine
);
1542 on_spinbutton_piv_monitor_vectorscale (GtkSpinButton
*widget
,
1545 /*-----------------------------------------------------------------------------
1548 PivEval
*eval
= gtk_object_get_data (GTK_OBJECT (widget
), "eval");
1549 /* gint piv_disproc_vlength */
1551 gpiv_var
->piv_disproc_vlength
= gtk_spin_button_get_value_as_int (widget
);
1552 gnome_config_set_int ("vector_length", gpiv_var
->piv_disproc_vlength
);
1553 gnome_config_sync ();
1556 * Try to re-scale vector
1558 if(eval
->monitor
->gci_vec
!= NULL
) {
1559 GnomeCanvasPoints
*points
= gnome_canvas_points_new (2);
1561 points
->coords
[0] = GPIV_MAX_INTERR_SIZE
/ 2;
1562 points
->coords
[1] = GPIV_MAX_INTERR_SIZE
/ 2;
1563 points
->coords
[2] = GPIV_MAX_INTERR_SIZE
/ 2 + eval
->monitor
->pi_da
->dx
[0][0] *
1564 gpiv_var
->piv_disproc_vlength
;
1565 points
->coords
[3] = GPIV_MAX_INTERR_SIZE
/ 2 + eval
->monitor
->pi_da
->dy
[0][0] *
1566 gpiv_var
->piv_disproc_vlength
;
1568 gnome_canvas_item_set (eval
->monitor
->gci_vec
,
1572 gnome_canvas_points_free (points
);
1579 on_button_piv_enter (GtkWidget
*widget
,
1582 /*-----------------------------------------------------------------------------
1585 GpivConsole
*gpiv
= gtk_object_get_data (GTK_OBJECT (widget
), "gpiv");
1586 gchar
*msg
= _("Analyses a PIV image (pair)");
1587 gnome_appbar_set_status (GNOME_APPBAR(gpiv
->appbar
), msg
);
1593 on_button_piv (GtkWidget
*widget
,
1596 /* ----------------------------------------------------------------------------
1597 * The actual calculation of particle image displacements
1600 GpivConsole
*gpiv
= gtk_object_get_data (GTK_OBJECT (widget
), "gpiv");
1603 cancel_process
= FALSE
;
1606 for (row
= gpiv
->first_selected_row
; row
<= gpiv
->last_selected_row
;
1608 display_act
= gtk_clist_get_row_data (GTK_CLIST (gpiv
->clist_buf
),
1610 ibuf
= display_act
->id
;
1611 if (display
[ibuf
] != NULL
1612 && display_act
->mwin
!= NULL
1613 && GTK_WIDGET_VISIBLE (GTK_WIDGET (display_act
->mwin
))) {
1614 gdk_window_show (GTK_WIDGET (display_act
->mwin
)->window
);
1615 gdk_window_raise (GTK_WIDGET (display_act
->mwin
)->window
);