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 Gerber van der Graaf
10 This file is part of gpiv.
12 Gpiv is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; either version 2, or (at your option)
17 This program is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
22 You should have received a copy of the GNU General Public License
23 along with this program; if not, write to the Free Software Foundation,
24 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26 ----------------------------------------------------------------------*/
29 * (callback) functions for Piv evaluation window/tabulator
31 * Revision 1.23 2008-04-28 12:00:57 gerber
32 * hdf-formatted files are now with .hdf extension (previously: .gpi)
34 * Revision 1.22 2007-11-23 16:24:07 gerber
35 * release 0.5.0: Kafka
37 * Revision 1.21 2007-06-06 17:00:48 gerber
38 * Retreives images/data from URI using Gnome Virtual File System.
40 * Revision 1.20 2007-03-22 16:00:32 gerber
41 * Added image processing tabulator
43 * Revision 1.19 2007-02-16 17:09:48 gerber
44 * added Gauss weighting on I.A. and SPOF filtering (on correlation function)
46 * Revision 1.18 2007/02/05 15:17:09 gerber
47 * auto stretching, broadcast display settings to buffers from preferences
49 * Revision 1.17 2007-01-29 11:27:43 gerber
50 * added image formats png, gif, tif png, bmp, improved buffer display
52 * Revision 1.16 2006-09-18 07:27:06 gerber
53 * *** empty log message ***
55 * Revision 1.15 2006/01/31 14:28:12 gerber
58 * Revision 1.13 2005/02/26 09:43:30 gerber
59 * parameter flags (parameter_logic) defined as gboolean
61 * Revision 1.12 2005/02/26 09:17:14 gerber
62 * structured of interrogate function by using gpiv_piv_isiadapt
64 * Revision 1.11 2005/01/19 15:53:42 gerber
65 * Initiation of Data Acquisition (DAC); trigerring of lasers and camera
66 * by using RTAI and Realtime Linux, recording images from IEEE1394
67 * (Firewire) IIDC compliant camera's
69 * Revision 1.10 2004/10/15 19:24:05 gerber
70 * GPIV_ and Gpiv prefix to defines and structure names of libgpiv
72 * Revision 1.9 2004/06/14 21:19:23 gerber
73 * Image depth up to 16 bits.
74 * Improvement "single int" and "drag int" in Eval tab.
75 * Viewer's pop-up menu.
76 * Adaption for gpiv_matrix_* and gpiv_vector_*.
78 * See Changelog for further info.
80 * Revision 1.8 2003/09/01 11:17:15 gerber
81 * improved monitoring of interrogation process
83 * Revision 1.7 2003/08/22 15:24:52 gerber
84 * interactive spatial scaling
86 * Revision 1.6 2003/07/13 14:38:18 gerber
87 * changed error handling of libgpiv
89 * Revision 1.5 2003/07/12 21:21:16 gerber
90 * changed error handling libgpiv
92 * Revision 1.3 2003/07/10 11:56:07 gerber
95 * Revision 1.2 2003/06/27 13:47:26 gerber
96 * display ruler, line/point evaluation
98 * Revision 1.1.1.1 2003/06/17 17:10:52 gerber
104 #include "gpiv_gui.h"
107 #include "piveval_interrogate.h"
112 * Private piv evaluation functions
117 display_img (float **img
,
127 GnomeCanvasItem
**gci
,
131 /* ----------------------------------------------------------------------------
132 * Displaying routine in gnome canvas
137 float min
= 1000.0, max
= -1000.0;
139 GdkPixbuf
*pixbuf
= NULL
;
143 assert (img
[0] != NULL
);
145 fact
= fact
<< (gl_image_par
->depth
- depth
);
146 /* g_message ("DISPLAY_IMG:: fact = %d", fact); */
148 if (*rgbbuf
!= NULL
) {
153 if (*rgbbuf
== NULL
) {
155 * row stride; each row is a 4-byte buffer array
157 rgb_width
= (i_max
- i_min
) * 3;
158 while ((rgb_width
) % 4 != 0) {
162 *rgbbuf
= g_malloc (rgb_width
* 3 * (j_max
- j_min
));
167 gtk_object_destroy (GTK_OBJECT(*gci
));
172 pixbuf
= gdk_pixbuf_new_from_data (*rgbbuf
,
184 *gci
= gnome_canvas_item_new (gnome_canvas_root( GNOME_CANVAS
186 gnome_canvas_pixbuf_get_type (),
189 /* BUGFIX: new (check mem) */
190 /* gdk_pixbuf_unref (pixbuf); */
193 affine
[4] = (GPIV_MAX_INTERR_SIZE
- gpiv_var
->piv_disproc_zoom
195 affine
[5] = (GPIV_MAX_INTERR_SIZE
- gpiv_var
->piv_disproc_zoom
197 gnome_canvas_item_affine_absolute (*gci
, affine
);
200 * As the mean has been subtracted from the image data, image intensities
201 * will have to be tilted above zero
204 for (j
= j_min
; j
< j_max
; j
++) {
205 for (i
= i_min
; i
< i_max
; i
++) {
214 for (j
= j_min
; j
< j_max
; j
++) {
215 for (i
= i_min
; i
< i_max
; i
++) {
217 img
[j
][i
] = (255.0 / (max
- min
)) * img
[j
][i
];
218 *pos
++ = (unsigned char) img
[j
][i
];
219 *pos
++ = (unsigned char) img
[j
][i
];
220 *pos
++ = (unsigned char) img
[j
][i
];
229 for (j
= j_min
; j
< j_max
; j
++) {
230 for (i
= i_min
; i
< i_max
; i
++) {
236 /* if ( min < display_act->img.img_mean) */
237 /* display_act->img.img_mean = min; */
241 for (j
= j_min
; j
< j_max
; j
++) {
242 for (i
= i_min
; i
< i_max
; i
++) {
243 /* *pos++ = (unsigned char) img[j][i] - (unsigned char) min */
244 /* + (unsigned char) display_act->img.img_mean; */
245 /* *pos++ = (unsigned char) img[j][i] - (unsigned char) min */
246 /* + (unsigned char) display_act->img.img_mean; */
247 /* *pos++ = (unsigned char) img[j][i] - (unsigned char) min */
248 /* + (unsigned char) display_act->img.img_mean; */
250 * BUGFIX: display image intars with: 8 < depth < 16
253 *pos
++ = (guchar
) ((img
[j
][i
] - /* (guchar) */ min
+
254 /* (guchar) */ display_act
->img
->img_mean
)
256 *pos
++ = (guchar
) ((img
[j
][i
] - /* (guchar) */ min
+
257 /* (guchar) */ display_act
->img
->img_mean
)
259 *pos
++ = (guchar
) ((img
[j
][i
] - /* (guchar) */ min
+
260 /* (guchar) */ display_act
->img
->img_mean
)
267 gdk_pixbuf_unref (pixbuf
);
268 *int_size_old
= int_size
;
269 /* g_free(rgbbuf); */
276 alloc_bufmem_per_intarea (int index_y
,
279 GpivImagePar image_par
,
282 /* ----------------------------------------------------------------------------
283 * Memory allocation of covariance in a packed interrogation area array
291 free_bufmem_per_intarea (int index_y
,
294 GpivImagePar image_par
,
297 /*-----------------------------------------------------------------------------
305 adjust_radio_button_intsize_f (GpivPivPar
*piv_par
,
308 /* ----------------------------------------------------------------------------
309 * Adjust radio button interrogation size 1 in PIV interrogation tab
312 if (piv_par
->int_size_f
== 16) {
313 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
314 (eval
->radiobutton_intsize_f_2
), TRUE
);
315 } else if (piv_par
->int_size_f
== 32) {
316 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
317 (eval
->radiobutton_intsize_f_3
), TRUE
);
318 } else if (piv_par
->int_size_f
== 64) {
319 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
320 (eval
->radiobutton_intsize_f_4
), TRUE
);
321 } else if (piv_par
->int_size_f
== 128) {
322 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
323 (eval
->radiobutton_intsize_f_5
), TRUE
);
330 adjust_radio_button_intsize_i (GpivPivPar
*piv_par
,
333 /* ----------------------------------------------------------------------------
334 * Adjust radio button interrogation size 1 in PIV interrogation tab
337 if (piv_par
->int_size_i
== 16) {
338 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
339 (eval
->radiobutton_intsize_i_2
), TRUE
);
340 } else if (piv_par
->int_size_i
== 32) {
341 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
342 (eval
->radiobutton_intsize_i_3
), TRUE
);
343 } else if (piv_par
->int_size_i
== 64) {
344 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
345 (eval
->radiobutton_intsize_i_4
), TRUE
);
346 } else if (piv_par
->int_size_i
== 128) {
347 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
348 (eval
->radiobutton_intsize_i_5
), TRUE
);
356 adjust_radio_button_intshift (GpivPivPar
*piv_par
,
358 /* ----------------------------------------------------------------------------
359 * Adjust radio button interrogation area shift in PIV interrogation tab
362 if (piv_par
->int_shift
== 8) {
363 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
364 (eval
->radiobutton_intshift_1
), TRUE
);
365 } else if (piv_par
->int_shift
== 16) {
366 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
367 (eval
->radiobutton_intshift_2
), TRUE
);
368 } else if (piv_par
->int_shift
== 32) {
369 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
370 (eval
->radiobutton_intshift_3
), TRUE
);
371 } else if (piv_par
->int_shift
== 64) {
372 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
373 (eval
->radiobutton_intshift_4
), TRUE
);
374 } else if (piv_par
->int_shift
== 128) {
375 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
376 (eval
->radiobutton_intshift_5
), TRUE
);
383 * Display functions in PIV tabulator canvas
388 display_piv_vector (guint i
,
390 GpivPivData
*piv_data
,
393 /* ----------------------------------------------------------------------------
394 * Displays values in PIV tabulator of the GUI
397 /* float **dx = piv_data->dx, **dy = piv_data->dy; */
398 /* int **peak_no = piv_data->peak_no; */
399 GnomeCanvasPoints
*points
;
400 float dl
= sqrt (piv_data
->dx
[i
][j
] * piv_data
->dx
[i
][j
] +
401 piv_data
->dy
[i
][j
] * piv_data
->dy
[i
][j
]);
403 points
= gnome_canvas_points_new (2);
405 eval
->monitor
->pi_da
->dx
[0][0] = piv_data
->dx
[i
][j
];
406 eval
->monitor
->pi_da
->dy
[0][0] = piv_data
->dy
[i
][j
];
407 eval
->monitor
->pi_da
->peak_no
[0][0] = piv_data
->peak_no
[i
][j
];
409 if (eval
->monitor
->pi_da
->peak_no
[0][0] == -1) {
411 } else if (eval
->monitor
->pi_da
->peak_no
[0][0] == 0) {
413 } else if (eval
->monitor
->pi_da
->peak_no
[0][0] == 1) {
415 } else if (eval
->monitor
->pi_da
->peak_no
[0][0] == 2) {
418 /* if (eval->monitor->pi_da->peak_no[i][j] == 3) */
422 points
->coords
[0] = GPIV_MAX_INTERR_SIZE
/ 2;
423 points
->coords
[1] = GPIV_MAX_INTERR_SIZE
/ 2;
424 points
->coords
[2] = GPIV_MAX_INTERR_SIZE
/ 2 + eval
->monitor
->pi_da
->dx
[0][0]
425 * gpiv_var
->piv_disproc_vlength
;
426 points
->coords
[3] = GPIV_MAX_INTERR_SIZE
/ 2 + eval
->monitor
->pi_da
->dy
[0][0]
427 * gpiv_var
->piv_disproc_vlength
;
430 if (eval
->monitor
->gci_vec
!= NULL
) {
431 gnome_canvas_item_set (eval
->monitor
->gci_vec
,
434 "width_units", (double) THICKNESS
,
435 "first_arrowhead", FALSE
,
436 "last_arrowhead", TRUE
,
437 "arrow_shape_a", (double) ARROW_LENGTH
*
438 ARROW_FACT
*dl
* gpiv_par
->display__vector_scale
+
440 "arrow_shape_b", (double) ARROW_EDGE
*
441 ARROW_FACT
* dl
* gpiv_par
->display__vector_scale
+
443 "arrow_shape_c", (double) ARROW_WIDTH
*
444 ARROW_FACT
* dl
* gpiv_par
->display__vector_scale
+
448 eval
->monitor
->gci_vec
=
449 gnome_canvas_item_new (gnome_canvas_root
450 (GNOME_CANVAS(eval
->canvas_monitor_vec
)),
451 gnome_canvas_line_get_type(),
454 "width_units",(double) THICKNESS
,
455 "first_arrowhead", TRUE
,
456 "arrow_shape_a", (double) ARROW_LENGTH
*
457 ARROW_FACT
*dl
* gpiv_par
->display__vector_scale
+
459 "arrow_shape_b", (double) ARROW_EDGE
*
460 ARROW_FACT
* dl
* gpiv_par
->display__vector_scale
+
462 "arrow_shape_c", (double) ARROW_WIDTH
*
463 ARROW_FACT
* dl
* gpiv_par
->display__vector_scale
+
466 /* "arrow_shape_a", (double) THICKNESS, */
471 gnome_canvas_points_free (points
);
477 display_img_intreg1 (float **intreg1
,
481 /* ----------------------------------------------------------------------------
482 * Displays image of intreg1 for drawing area
483 * row stride; each row is a 4-byte buffer array
486 display_img (intreg1
,
488 &eval
->monitor
->int_size_old
,
493 eval
->monitor
->rgb_int_width
,
494 &eval
->monitor
->rgbbuf_int1
,
495 eval
->canvas_monitor_int1
,
496 &eval
->monitor
->gci_int1
,
497 eval
->monitor
->affine
,
503 void display_img_intreg2 (float **intreg2
,
507 /* ----------------------------------------------------------------------------
508 * Displays image of intreg2 for drawing area
511 display_img (intreg2
,
513 &eval
->monitor
->int_size_old
,
518 eval
->monitor
->rgb_int_width
,
519 &eval
->monitor
->rgbbuf_int2
,
520 eval
->canvas_monitor_int2
,
521 &eval
->monitor
->gci_int2
,
522 eval
->monitor
->affine
,
529 void display_img_cov (GpivCov
*cov
,
533 /* ----------------------------------------------------------------------------
534 * Displays image of intreg1 for drawing area
539 &eval
->monitor
->cov_size_old
,
544 eval
->monitor
->rgb_cov_width
,
545 &eval
->monitor
->rgbbuf_cov
,
546 eval
->canvas_monitor_cov
,
547 &eval
->monitor
->gci_cov
,
548 eval
->monitor
->affine
,
555 * Piv evaluation window/tabulator callbacks
560 on_radiobutton_piv_mouse (GtkWidget
*widget
,
563 /*-----------------------------------------------------------------------------
566 GpivConsole
*gpiv
= gtk_object_get_data(GTK_OBJECT(widget
), "gpiv");
567 m_select
= atoi(gtk_object_get_data(GTK_OBJECT(widget
),
570 /* g_message ("on_radiobutton_piv_mouse:: 0 m_select = %d", m_select); */
571 if (m_select
== NO_MS
) {
572 gl_piv_par
->int_geo
= GPIV_AOI
;
574 } else if (m_select
== AOI_MS
) {
575 gl_piv_par
->int_geo
= GPIV_AOI
;
576 } else if (m_select
== SINGLE_POINT_MS
) {
577 gl_piv_par
->int_geo
= GPIV_POINT
;
578 } else if (m_select
== V_LINE_MS
) {
579 /* gl_piv_par->int_geo = GPIV_LINE_C; */
580 gl_piv_par
->int_geo
= GPIV_AOI
;
581 } else if (m_select
== H_LINE_MS
) {
582 /* gl_piv_par->int_geo = GPIV_LINE_R; */
583 gl_piv_par
->int_geo
= GPIV_AOI
;
584 } else if (m_select
== SINGLE_AREA_MS
||
585 m_select
== DRAG_MS
) {
586 gl_piv_par
->int_geo
= GPIV_POINT
;
590 * (Re)setting interrogation scheme if necessary
592 if ((m_select
== SINGLE_AREA_MS
593 || m_select
== DRAG_MS
594 || m_select
== SINGLE_POINT_MS
595 || m_select
== V_LINE_MS
596 || m_select
== H_LINE_MS
)
597 && gl_piv_par
->int_scheme
== GPIV_IMG_DEFORM
599 char message
[2 * GPIV_MAX_CHARS
];
600 g_snprintf (message
, 2 * GPIV_MAX_CHARS
,
601 _("Image deformation is impossibe with this Mouse select.\n\
602 Setting Interrogation scheme to Central difference.\n\
603 This will be reset automatically after interrogating."));
604 warning_gpiv (message
);
605 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
606 (gpiv
->piveval
->radiobutton_centraldiff
),
608 int_scheme_autochanged
= TRUE
;
610 if (int_scheme_autochanged
) {
611 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
612 (gpiv
->piveval
->radiobutton_imgdeform
),
614 int_scheme_autochanged
= FALSE
;
622 on_radiobutton_piv_mouse1_enter (GtkWidget
*widget
,
625 /*-----------------------------------------------------------------------------
628 GpivConsole
*gpiv
= gtk_object_get_data (GTK_OBJECT(widget
), "gpiv");
629 gchar
*msg
= _("No mouse activity within displayer");
630 gnome_appbar_set_status (GNOME_APPBAR(gpiv
->appbar
), msg
);
636 on_radiobutton_piv_mouse2_enter (GtkWidget
*widget
,
639 /*-----------------------------------------------------------------------------
642 GpivConsole
*gpiv
= gtk_object_get_data (GTK_OBJECT (widget
), "gpiv");
643 gchar
*msg
= _("Selects an area within the image to be analyzed");
644 gnome_appbar_set_status (GNOME_APPBAR(gpiv
->appbar
), msg
);
650 on_radiobutton_piv_mouse3_enter (GtkWidget
*widget
,
653 /*-----------------------------------------------------------------------------
656 GpivConsole
*gpiv
= gtk_object_get_data (GTK_OBJECT(widget
), "gpiv");
657 gchar
*msg
= _("Piv evaluation at a single interrogation area. "
658 "Conserves other existing data");
659 gnome_appbar_set_status (GNOME_APPBAR(gpiv
->appbar
), msg
);
665 on_radiobutton_piv_mouse4_enter (GtkWidget
*widget
,
668 /*-----------------------------------------------------------------------------
671 GpivConsole
*gpiv
= gtk_object_get_data (GTK_OBJECT(widget
), "gpiv");
672 gchar
*msg
= _("Piv evaluation at a single point in the image. "
673 "Rejects all existing data!!");
674 gnome_appbar_set_status (GNOME_APPBAR(gpiv
->appbar
), msg
);
680 on_radiobutton_piv_mouse5_enter (GtkWidget
*widget
,
683 /*-----------------------------------------------------------------------------
686 GpivConsole
*gpiv
= gtk_object_get_data (GTK_OBJECT(widget
), "gpiv");
687 gchar
*msg
= _("Displaces a single interrogation area and analyzes");
688 gnome_appbar_set_status (GNOME_APPBAR (gpiv
->appbar
), msg
);
694 on_radiobutton_piv_mouse6_enter (GtkWidget
*widget
,
697 /*-----------------------------------------------------------------------------
700 GpivConsole
*gpiv
= gtk_object_get_data (GTK_OBJECT(widget
), "gpiv");
701 gchar
*msg
= _("Evaluation at a vertical line. ");
702 gnome_appbar_set_status (GNOME_APPBAR(gpiv
->appbar
), msg
);
708 on_radiobutton_piv_mouse7_enter (GtkWidget
*widget
,
711 /*-----------------------------------------------------------------------------
714 GpivConsole
*gpiv
= gtk_object_get_data (GTK_OBJECT(widget
), "gpiv");
715 gchar
*msg
= _("Evaluation at a horizontal line. ");
716 gnome_appbar_set_status (GNOME_APPBAR(gpiv
->appbar
), msg
);
722 on_spinbutton_piv_int (GtkSpinButton
*widget
,
725 /*-----------------------------------------------------------------------------
728 char *err_msg
= NULL
;
729 PivEval
*eval
= gtk_object_get_data(GTK_OBJECT (widget
), "eval");
730 guint nx
= 0, ny
= 0;
731 guint nx_img
= 0, ny_img
= 0;
732 gboolean renew
= TRUE
, lo_display_intregs
= FALSE
;
747 /* eval = gtk_object_get_data(GTK_OBJECT(widget), "eval"); */
751 /* Display display_act; */
752 /* display_act = gtk_object_get_data(widget, display_act); */
755 * Select which variable has to be modified
757 setby_spinbutton
= 1;
758 var_type
= atoi(gtk_object_get_data (GTK_OBJECT (widget
), "var_type"));
760 if (var_type
== COL_START
) {
761 gl_piv_par
->col_start
= gtk_spin_button_get_value_as_int (widget
);
763 } else if (var_type
== COL_END
) {
764 gl_piv_par
->col_end
= gtk_spin_button_get_value_as_int (widget
);
766 } else if (var_type
== PRESHIFT_COL
) {
767 gl_piv_par
->pre_shift_col
= gtk_spin_button_get_value_as_int (widget
);
769 } else if (var_type
== ROWSTART
) {
770 gl_piv_par
->row_start
= gtk_spin_button_get_value_as_int (widget
);
772 } else if (var_type
== ROWEND
) {
773 gl_piv_par
->row_end
= gtk_spin_button_get_value_as_int (widget
);
775 } else if (var_type
== PRESHIFT_ROW
) {
776 gl_piv_par
->pre_shift_row
= gtk_spin_button_get_value_as_int (widget
);
778 } else if (var_type
== INT_SIZE_F
) {
779 gl_piv_par
->int_size_f
= gtk_spin_button_get_value_as_int (widget
);
782 * Adapt spinbutton of int_size_i
784 GTK_ADJUSTMENT(eval
->spinbutton_adj_intsize_i
)->lower
=
785 (gfloat
) gl_piv_par
->int_size_f
;
786 GTK_ADJUSTMENT(eval
->spinbutton_adj_intsize_i
)->upper
=
788 gtk_adjustment_changed (GTK_ADJUSTMENT(eval
->spinbutton_adj_intsize_i
));
789 gtk_adjustment_set_value (GTK_ADJUSTMENT(eval
->spinbutton_adj_intsize_i
),
790 (gfloat
) gl_piv_par
->int_size_f
);
793 * Adjust radio buttons for final interrogation size
795 adjust_radio_button_intsize_f (gl_piv_par
, eval
);
797 } else if (var_type
== INT_SIZE_I
) {
798 char message
[GPIV_MAX_CHARS
];
800 gl_piv_par
->int_size_i
= gtk_spin_button_get_value_as_int (widget
);
801 if ((gl_piv_par
->int_scheme
== GPIV_NO_CORR
802 || gl_piv_par
->int_scheme
== GPIV_LK_WEIGHT
)
803 && gl_piv_par
->int_size_i
> gl_piv_par
->int_size_f
) {
804 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
805 (eval
->radiobutton_imgdeform
),
807 g_snprintf (message
, GPIV_MAX_CHARS
,
808 _("Int Size 2 > Int Size 1 \nSetting Interrogation scheme to Image deformation"));
809 warning_gpiv(message
);
812 /* gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON */
813 /* (eval->radiobutton_zerooff), */
818 * Adjust radio buttons for initial interrogation size
820 adjust_radio_button_intsize_i (gl_piv_par
, eval
);
822 } else if (var_type
== INT_SHIFT
) {
823 gl_piv_par
->int_shift
= gtk_spin_button_get_value_as_int (widget
);
826 * Adjust radio buttons for interrogation area shift
828 adjust_radio_button_intshift (gl_piv_par
, eval
);
832 * Update eventually interrogation region contours.
834 if (display_act
!= NULL
) {
836 gpiv_piv_testadjust_parameters (display_act
->img
->image
->header
,
839 warning_gpiv ("%s", err_msg
);
843 display_act
->intreg
->par
->row_start
= gl_piv_par
->row_start
;
844 display_act
->intreg
->par
->row_end
= gl_piv_par
->row_end
;
845 display_act
->intreg
->par
->col_start
= gl_piv_par
->col_start
;
846 display_act
->intreg
->par
->col_end
= gl_piv_par
->col_end
;
847 display_act
->intreg
->par
->int_shift
= gl_piv_par
->int_shift
;
848 display_act
->intreg
->par
->int_size_f
= gl_piv_par
->int_size_f
;
849 display_act
->intreg
->par
->int_size_i
= gl_piv_par
->int_size_i
;
850 display_act
->intreg
->par
->pre_shift_row
= gl_piv_par
->pre_shift_row
;
851 display_act
->intreg
->par
->pre_shift_col
= gl_piv_par
->pre_shift_col
;
853 display_act
->intreg
->par
->row_start__set
= TRUE
;
854 display_act
->intreg
->par
->row_end__set
= TRUE
;
855 display_act
->intreg
->par
->col_start__set
= TRUE
;
856 display_act
->intreg
->par
->col_end__set
= TRUE
;
857 display_act
->intreg
->par
->int_size_f__set
= TRUE
;
858 display_act
->intreg
->par
->int_size_i__set
= TRUE
;
859 display_act
->intreg
->par
->int_shift__set
= TRUE
;
860 display_act
->intreg
->par
->pre_shift_row__set
= TRUE
;
861 display_act
->intreg
->par
->pre_shift_col__set
= TRUE
;
863 if (display_act
->intreg
->exist_int
) {
864 nx
= display_act
->intreg
->data
->nx
;
865 ny
= display_act
->intreg
->data
->ny
;
868 gpiv_piv_count_pivdata_fromimage (display_act
->img
->image
->header
,
869 display_act
->intreg
->par
,
873 warning_gpiv ("on_spinbutton_piv_int: %s", err_msg
);
874 g_warning ("on_spinbutton_piv_int: %s", err_msg
);
878 * For some operations the intregs have to be renewed unconditionally,
879 * for others only in case if the number of intregs has been changed
881 if (var_type
== COL_START
|| var_type
== COL_END
882 || var_type
== ROWSTART
|| var_type
== ROWEND
) {
892 lo_display_intregs
= display_act
->display_intregs
;
893 destroy_all_intregs (display_act
);
894 create_all_intregs (display_act
);
895 display_act
->display_intregs
= lo_display_intregs
;
896 if (display_act
->display_intregs
) show_all_intregs(display_act
);
902 setby_spinbutton
= 0;
908 on_radiobutton_piv_int (GtkWidget
*widget
,
911 /*-----------------------------------------------------------------------------
915 gboolean lo_display_intregs
= FALSE
;
916 gint nx_tmp
= 0, ny_tmp
= 0;
917 /* gint setby_spinbutton = atoi(gtk_object_get_data(GTK_OBJECT(widget), */
918 /* "setby_spinbutton")); */
919 PivEval
*eval
= gtk_object_get_data(GTK_OBJECT (widget
), "eval");
920 Display
*disp
= display_act
;
931 && disp
->intreg
->exist_int
) {
932 nx
= disp
->intreg
->data
->nx
;
933 ny
= disp
->intreg
->data
->ny
;
939 if (GTK_TOGGLE_BUTTON(widget
)->active
) {
940 var_type
= atoi(gtk_object_get_data (GTK_OBJECT(widget
),
944 * Select which variable has to be modified
946 if (var_type
== SIZE_F
) {
947 int_size_f_tmp
= gl_piv_par
->int_size_f
;
948 gl_piv_par
->int_size_f
= atoi (gtk_object_get_data
952 * switch off temporarly display_intregs
955 lo_display_intregs
= disp
->display_intregs
;
956 disp
->display_intregs
= FALSE
;
960 adjust_radiobutton_piv_int (eval
, gl_piv_par
->int_size_f
);
963 * return display_intregs to original value
966 disp
->display_intregs
= lo_display_intregs
;
971 * BUGFIX: REMOVE Reset weight and zero_off
973 if (gl_piv_par
->int_size_i
> int_size_f_tmp
) {
974 /* gtk_widget_set_sensitive(eval->radiobutton_zerooff, TRUE); */
975 /* gtk_widget_set_sensitive(checkbutton_piv_weightkernel, TRUE); */
978 if (int_scheme_tmp != GPIV_ZERO_OFF_FORWARD
979 && int_scheme_tmp != GPIV_ZERO_OFF_CENTRAL) {
980 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
981 (eval->radiobutton_zerooff),
983 gtk_widget_set_sensitive(eval->radiobutton_zerooff, TRUE);
984 gtk_widget_set_sensitive(eval->radiobutton_weightkernel,
986 if (int_scheme_tmp == GPIV_LK_WEIGHT) {
987 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
988 (eval->radiobutton_weightkernel),
990 gtk_widget_set_sensitive(eval->radiobutton_zerooff,
992 gtk_widget_set_sensitive(eval->radiobutton_weightkernel, TRUE);
994 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
995 (eval->radiobutton_weightkernel),
997 gtk_widget_set_sensitive(eval->radiobutton_zerooff,
999 gtk_widget_set_sensitive(eval->radiobutton_weightkernel,
1003 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1004 (eval->radiobutton_zerooff),
1006 gtk_widget_set_sensitive(eval->radiobutton_zerooff, TRUE);
1007 gtk_widget_set_sensitive(eval->radiobutton_weightkernel,
1014 * Also calls on_spinbutton_piv_int, which, on its turn, may call this function
1015 * again resulting into an infinite loop
1017 gtk_spin_button_set_value (GTK_SPIN_BUTTON
1018 (eval
->spinbutton_intsize_f
),
1019 gl_piv_par
->int_size_f
);
1022 } else if (var_type
== SIZE_I
) {
1023 gl_piv_par
->int_size_i
=
1024 atoi (gtk_object_get_data (GTK_OBJECT(widget
), "intsize_i"));
1029 gtk_adjustment_set_value (GTK_ADJUSTMENT
1030 (eval
->spinbutton_adj_intsize_i
),
1031 (gfloat
) gl_piv_par
->int_size_i
);
1033 * Save origanal settings of weight and zero_off for later resetting
1035 if (gl_piv_par
->int_size_i
> gl_piv_par
->int_size_f
) {
1036 int_scheme_tmp
= gl_piv_par
->int_scheme
;
1038 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1039 (eval->radiobutton_weightkernel), FALSE);
1040 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1041 (eval->radiobutton_zerooff), TRUE);
1042 gtk_widget_set_sensitive(eval->radiobutton_zerooff, FALSE);
1046 * Reset weight and zero_off
1049 /* if (zero_off_tmp == 0) {
1050 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1051 (eval->radiobutton_zerooff), FALSE);
1052 if (weight_tmp == 0) {
1053 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1054 (eval->radiobutton_weightkernel), FALSE);
1056 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1057 (eval->radiobutton_weightkernel), TRUE);
1060 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1061 (eval->radiobutton_zerooff), TRUE);
1063 gtk_widget_set_sensitive(eval->radiobutton_zerooff, TRUE);
1068 } else if (var_type
== SHIFT
) {
1069 gl_piv_par
->int_shift
=
1070 atoi (gtk_object_get_data (GTK_OBJECT(widget
),
1075 gtk_spin_button_set_value (GTK_SPIN_BUTTON
1076 (eval
->spinbutton_intshift
),
1077 gl_piv_par
->int_shift
);
1081 && disp
->intreg
->exist_int
1083 lo_display_intregs
= disp
->display_intregs
;
1084 destroy_all_intregs (disp
);
1085 create_all_intregs (disp
);
1086 disp
->display_intregs
= lo_display_intregs
;
1087 if (disp
->display_intregs
) show_all_intregs(disp
);
1098 on_radiobutton_fit_enter (GtkWidget
*widget
,
1101 /*-----------------------------------------------------------------------------
1104 GpivConsole
*gpiv
= gtk_object_get_data(GTK_OBJECT (widget
), "gpiv");
1105 gchar
*msg
= _("Interpolation scheme for sub-pixel estimation");
1106 gnome_appbar_set_status (GNOME_APPBAR(gpiv
->appbar
), msg
);
1113 on_radiobutton_peak_enter (GtkWidget
*widget
,
1116 /*-----------------------------------------------------------------------------
1119 GpivConsole
*gpiv
= gtk_object_get_data(GTK_OBJECT (widget
), "gpiv");
1120 gchar
*msg
= _("Chooses n-th highest top number of correlation as estimator");
1121 gnome_appbar_set_status (GNOME_APPBAR(gpiv
->appbar
), msg
);
1128 on_radiobutton_interrogatescheme_enter (GtkWidget
*widget
,
1131 /*-----------------------------------------------------------------------------
1134 GpivConsole
*gpiv
= gtk_object_get_data (GTK_OBJECT(widget
), "gpiv");
1135 gchar
*msg
= _("Bias correction scheme");
1136 gnome_appbar_set_status (GNOME_APPBAR(gpiv
->appbar
), msg
);
1143 on_radiobutton_interrogatescheme_imgdeform_enter (GtkWidget
*widget
,
1146 /*-----------------------------------------------------------------------------
1149 GpivConsole
*gpiv
= gtk_object_get_data (GTK_OBJECT(widget
), "gpiv");
1150 gchar
*msg
= _("Deforms image from PIV estimators");
1151 gnome_appbar_set_status (GNOME_APPBAR(gpiv
->appbar
), msg
);
1158 on_toggle_piv (GtkWidget
*widget
,
1161 /*-----------------------------------------------------------------------------
1164 PivEval
*eval
= gtk_object_get_data(GTK_OBJECT (widget
), "eval");
1173 * Select which variable has to be modified
1175 var_type
= atoi (gtk_object_get_data (GTK_OBJECT(widget
), "var_type"));
1177 if (var_type
== IFIT
) {
1178 gl_piv_par
->ifit
= atoi (gtk_object_get_data (GTK_OBJECT(widget
),
1181 } else if (var_type
== PEAK_NR
) {
1182 gl_piv_par
->peak
= atoi (gtk_object_get_data (GTK_OBJECT(widget
),
1186 } else if (var_type
== SCHEME
) {
1187 gl_piv_par
->int_scheme
= atoi(gtk_object_get_data(GTK_OBJECT(widget
),
1190 } else if (var_type
== CORRELATION
) {
1191 gl_image_par
->x_corr
= atoi (gtk_object_get_data (GTK_OBJECT(widget
),
1200 on_checkbutton_weight_ia_enter (GtkWidget
*widget
,
1203 /*-----------------------------------------------------------------------------
1206 GpivConsole
*gpiv
= gtk_object_get_data(GTK_OBJECT (widget
), "gpiv");
1208 _("Gauss weighting on the Interrogation Area");
1209 gnome_appbar_set_status (GNOME_APPBAR(gpiv
->appbar
), msg
);
1215 on_checkbutton_weight_ia (GtkWidget
*widget
,
1217 /*-----------------------------------------------------------------------------
1220 PivEval
*eval
= gtk_object_get_data (GTK_OBJECT(widget
), "eval");
1223 if (GTK_TOGGLE_BUTTON(widget
)->active
) {
1224 gl_piv_par
->gauss_weight_ia
= TRUE
;
1226 gl_piv_par
->gauss_weight_ia
= FALSE
;
1232 on_checkbutton_spof_enter (GtkWidget
*widget
,
1235 /*-----------------------------------------------------------------------------
1238 GpivConsole
*gpiv
= gtk_object_get_data(GTK_OBJECT (widget
), "gpiv");
1240 _("Symmetric Phase Only Filtering on the FT images");
1241 gnome_appbar_set_status (GNOME_APPBAR(gpiv
->appbar
), msg
);
1247 on_checkbutton_spof (GtkWidget
*widget
,
1249 /*-----------------------------------------------------------------------------
1252 PivEval
*eval
= gtk_object_get_data (GTK_OBJECT(widget
), "eval");
1255 if (GTK_TOGGLE_BUTTON(widget
)->active
) {
1256 gl_piv_par
->spof_filter
= TRUE
;
1258 gl_piv_par
->spof_filter
= FALSE
;
1264 adjust_radiobutton_piv_int (PivEval
*eval
,
1267 /* ----------------------------------------------------------------------------
1268 * adjusting and disabling int_size_i and its toggle buttons
1271 /* if (int_size_f == 8) { */
1272 /* gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON */
1273 /* (eval->radiobutton_intsize_i_1), TRUE); */
1276 if (int_size_f
== 16) {
1277 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
1278 (eval
->radiobutton_intsize_i_2
), TRUE
);
1280 } else if (int_size_f
== 32) {
1281 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
1282 (eval
->radiobutton_intsize_i_3
), TRUE
);
1284 } else if (int_size_f
== 64) {
1285 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
1286 (eval
->radiobutton_intsize_i_4
), TRUE
);
1288 } else if (int_size_f
>= 128) {
1289 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
1290 (eval
->radiobutton_intsize_i_5
), TRUE
);
1294 if (int_size_f
<= 64) {
1295 gtk_widget_set_sensitive (GTK_WIDGET(eval
->radiobutton_intsize_i_4
),
1297 if (int_size_f
<= 32) {
1298 gtk_widget_set_sensitive (GTK_WIDGET
1299 (eval
->radiobutton_intsize_i_3
),
1301 if (int_size_f
<= 16) {
1302 gtk_widget_set_sensitive (GTK_WIDGET
1303 (eval
->radiobutton_intsize_i_2
),
1305 /* if (int_size_f <= 8) { */
1306 /* gtk_widget_set_sensitive(GTK_WIDGET */
1307 /* (eval->radiobutton_intsize_i_1), */
1316 if (int_size_f
>= 16) {
1317 /* gtk_widget_set_sensitive(GTK_WIDGET(eval->radiobutton_intsize_i_1), */
1319 if (int_size_f
>= 32) {
1320 gtk_widget_set_sensitive (GTK_WIDGET
1321 (eval
->radiobutton_intsize_i_2
),
1323 if (int_size_f
>= 64) {
1324 gtk_widget_set_sensitive (GTK_WIDGET
1325 (eval
->radiobutton_intsize_i_3
),
1327 if (int_size_f
>= 128) {
1328 gtk_widget_set_sensitive (GTK_WIDGET
1329 (eval
->radiobutton_intsize_i_4
),
1341 on_checkbutton_piv_monitor_enter (GtkWidget
*widget
,
1344 /*-----------------------------------------------------------------------------
1347 GpivConsole
*gpiv
= gtk_object_get_data(GTK_OBJECT (widget
), "gpiv");
1349 _("Displays subimages, correlation function and PIV vector");
1350 gnome_appbar_set_status (GNOME_APPBAR(gpiv
->appbar
), msg
);
1356 on_checkbutton_piv_monitor (GtkWidget
*widget
,
1358 /*-----------------------------------------------------------------------------
1361 PivEval
*eval
= gtk_object_get_data (GTK_OBJECT(widget
), "eval");
1364 if (GTK_TOGGLE_BUTTON(widget
)->active
) {
1365 gpiv_var
->piv_disproc
= TRUE
;
1367 eval
->monitor
->gci_vec_background
=
1368 gnome_canvas_item_new (gnome_canvas_root
1369 (GNOME_CANVAS(eval
->canvas_monitor_vec
)),
1370 gnome_canvas_rect_get_type(),
1373 "x2", (double) GPIV_MAX_INTERR_SIZE
,
1374 "y2", (double) GPIV_MAX_INTERR_SIZE
,
1375 "fill_color", "darkblue",
1380 eval
->monitor
->gci_int1_background
=
1381 gnome_canvas_item_new (gnome_canvas_root
1382 (GNOME_CANVAS(eval
->canvas_monitor_int1
)),
1383 gnome_canvas_rect_get_type(),
1386 "x2", (double) GPIV_MAX_INTERR_SIZE
,
1387 "y2", (double) GPIV_MAX_INTERR_SIZE
,
1388 "fill_color", "darkgreen",
1393 eval
->monitor
->gci_int2_background
=
1394 gnome_canvas_item_new (gnome_canvas_root
1395 (GNOME_CANVAS(eval
->canvas_monitor_int2
)),
1396 gnome_canvas_rect_get_type(),
1399 "x2", (double) GPIV_MAX_INTERR_SIZE
,
1400 "y2", (double) GPIV_MAX_INTERR_SIZE
,
1401 "fill_color", "darkgreen",
1406 eval
->monitor
->gci_background_cov
=
1407 gnome_canvas_item_new (gnome_canvas_root
1408 (GNOME_CANVAS(eval
->canvas_monitor_cov
)),
1409 gnome_canvas_rect_get_type(),
1412 "x2", (double) GPIV_MAX_INTERR_SIZE
,
1413 "y2", (double) GPIV_MAX_INTERR_SIZE
,
1414 "fill_color", "darkred",
1418 gpiv_var
->piv_disproc
= FALSE
;
1420 * Destroy intreg1 image
1422 if (eval
->monitor
->gci_int1_background
!= NULL
) {
1423 gtk_object_destroy (GTK_OBJECT(eval
->monitor
->
1424 gci_int1_background
));
1425 eval
->monitor
->gci_int1_background
= NULL
;
1428 if (eval
->monitor
->rgbbuf_int1
!= NULL
) {
1429 g_free (eval
->monitor
->rgbbuf_int1
);
1430 eval
->monitor
->rgbbuf_int1
= NULL
;
1433 if (eval
->monitor
->gci_int1
!= NULL
) {
1434 gtk_object_destroy (GTK_OBJECT(eval
->monitor
->gci_int1
));
1435 eval
->monitor
->gci_int1
= NULL
;
1439 * Destroy intreg2 image
1441 if (eval
->monitor
->gci_int2_background
!= NULL
) {
1442 gtk_object_destroy (GTK_OBJECT(eval
->monitor
->
1443 gci_int2_background
));
1444 eval
->monitor
->gci_int2_background
= NULL
;
1447 if (eval
->monitor
->rgbbuf_int2
!= NULL
) {
1448 g_free (eval
->monitor
->rgbbuf_int2
);
1449 eval
->monitor
->rgbbuf_int2
= NULL
;
1452 if (eval
->monitor
->gci_int2
!= NULL
) {
1453 gtk_object_destroy (GTK_OBJECT(eval
->monitor
->gci_int2
));
1454 eval
->monitor
->gci_int2
= NULL
;
1458 * Destroy correlation image
1460 if (eval
->monitor
->gci_background_cov
!= NULL
) {
1461 gtk_object_destroy (GTK_OBJECT(eval
->monitor
->gci_background_cov
));
1462 eval
->monitor
->gci_background_cov
= NULL
;
1465 if (eval
->monitor
->rgbbuf_cov
!= NULL
) {
1466 g_free (eval
->monitor
->rgbbuf_cov
);
1467 eval
->monitor
->rgbbuf_cov
= NULL
;
1470 if (eval
->monitor
->gci_cov
!= NULL
) {
1471 gtk_object_destroy (GTK_OBJECT(eval
->monitor
->gci_cov
));
1472 eval
->monitor
->gci_cov
= NULL
;
1478 if (eval
->monitor
->gci_vec_background
!= NULL
) {
1479 gtk_object_destroy (GTK_OBJECT(eval
->monitor
->gci_vec_background
));
1480 eval
->monitor
->gci_vec_background
= NULL
;
1484 if (eval
->monitor
->gci_vec
!= NULL
) {
1485 gtk_object_destroy (GTK_OBJECT(eval
->monitor
->gci_vec
));
1486 eval
->monitor
->gci_vec
= NULL
;
1495 on_spinbutton_piv_monitor_zoom (GtkSpinButton
*widget
,
1498 /*-----------------------------------------------------------------------------
1501 PivEval
*eval
= gtk_object_get_data (GTK_OBJECT(widget
), "eval");
1502 /* gfloat piv_disproc_zoom */
1504 gpiv_var
->piv_disproc_zoom
= gtk_spin_button_get_value_as_float (widget
);
1505 gnome_config_push_prefix("/gpiv/RuntimeVariables/");
1506 gnome_config_set_float ("zoom_factor", gpiv_var
->piv_disproc_zoom
);
1507 gnome_config_pop_prefix ();
1508 gnome_config_sync();
1510 eval
->monitor
->affine
[0] = gpiv_var
->piv_disproc_zoom
;
1511 eval
->monitor
->affine
[3] = gpiv_var
->piv_disproc_zoom
;
1512 eval
->monitor
->affine
[4] =
1513 (GPIV_MAX_INTERR_SIZE
- gpiv_var
->piv_disproc_zoom
1514 * gl_piv_par
->int_size_f
) /2.0;
1515 eval
->monitor
->affine
[5] =
1516 (GPIV_MAX_INTERR_SIZE
- gpiv_var
->piv_disproc_zoom
1517 * gl_piv_par
->int_size_f
) /2.0;
1519 if(eval
->monitor
->gci_int1
!= NULL
) {
1520 gnome_canvas_item_affine_absolute (eval
->monitor
->gci_int1
,
1521 eval
->monitor
->affine
);
1524 if(eval
->monitor
->gci_int2
!= NULL
) {
1525 gnome_canvas_item_affine_absolute (eval
->monitor
->gci_int2
,
1526 eval
->monitor
->affine
);
1530 if(eval
->monitor
->gci_cov
!= NULL
) {
1531 gnome_canvas_item_affine_absolute (eval
->monitor
->gci_cov
,
1532 eval
->monitor
->affine
);
1541 on_spinbutton_piv_monitor_vectorscale (GtkSpinButton
*widget
,
1544 /*-----------------------------------------------------------------------------
1547 PivEval
*eval
= gtk_object_get_data (GTK_OBJECT (widget
), "eval");
1548 /* gint piv_disproc_vlength */
1550 gpiv_var
->piv_disproc_vlength
= gtk_spin_button_get_value_as_int (widget
);
1551 gnome_config_set_int ("vector_length", gpiv_var
->piv_disproc_vlength
);
1552 gnome_config_sync ();
1555 * Try to re-scale vector
1557 if(eval
->monitor
->gci_vec
!= NULL
) {
1558 GnomeCanvasPoints
*points
= gnome_canvas_points_new (2);
1560 points
->coords
[0] = GPIV_MAX_INTERR_SIZE
/ 2;
1561 points
->coords
[1] = GPIV_MAX_INTERR_SIZE
/ 2;
1562 points
->coords
[2] = GPIV_MAX_INTERR_SIZE
/ 2 + eval
->monitor
->pi_da
->dx
[0][0] *
1563 gpiv_var
->piv_disproc_vlength
;
1564 points
->coords
[3] = GPIV_MAX_INTERR_SIZE
/ 2 + eval
->monitor
->pi_da
->dy
[0][0] *
1565 gpiv_var
->piv_disproc_vlength
;
1567 gnome_canvas_item_set (eval
->monitor
->gci_vec
,
1571 gnome_canvas_points_free (points
);
1578 on_button_piv_enter (GtkWidget
*widget
,
1581 /*-----------------------------------------------------------------------------
1584 GpivConsole
*gpiv
= gtk_object_get_data (GTK_OBJECT (widget
), "gpiv");
1585 gchar
*msg
= _("Analyses a PIV image (pair)");
1586 gnome_appbar_set_status (GNOME_APPBAR(gpiv
->appbar
), msg
);
1592 on_button_piv (GtkWidget
*widget
,
1595 /* ----------------------------------------------------------------------------
1596 * The actual calculation of particle image displacements
1599 GpivConsole
*gpiv
= gtk_object_get_data (GTK_OBJECT (widget
), "gpiv");
1602 cancel_process
= FALSE
;
1605 for (row
= gpiv
->first_selected_row
; row
<= gpiv
->last_selected_row
;
1607 display_act
= gtk_clist_get_row_data (GTK_CLIST (gpiv
->clist_buf
),
1609 ibuf
= display_act
->id
;
1610 if (display
[ibuf
] != NULL
1611 && display_act
->mwin
!= NULL
1612 && GTK_WIDGET_VISIBLE (GTK_WIDGET (display_act
->mwin
))) {
1613 gdk_window_show (GTK_WIDGET (display_act
->mwin
)->window
);
1614 gdk_window_raise (GTK_WIDGET (display_act
->mwin
)->window
);