probe_image_extract.C

Go to the documentation of this file.
00001 /* Gnome gxsm - Gnome X Scanning Microscopy
00002  * universal STM/AFM/SARLS/SPALEED/... controlling and
00003  * data analysis software
00004  * 
00005  * Gxsm Plugin Name: probe_image_extract.C
00006  * ========================================
00007  * 
00008  * Copyright (C) 1999 The Free Software Foundation
00009  *
00010  * Authors: Percy Zahl <zahl@fkp.uni-hannover.de>
00011  * additional features: Andreas Klust <klust@fkp.uni-hannover.de>
00012  *
00013  * This program is free software; you can redistribute it and/or modify
00014  * it under the terms of the GNU General Public License as published by
00015  * the Free Software Foundation; either version 2 of the License, or
00016  * (at your option) any later version.
00017  *
00018  * This program is distributed in the hope that it will be useful,
00019  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00020  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00021  * GNU General Public License for more details.
00022  *
00023  * You should have received a copy of the GNU General Public License
00024  * along with this program; if not, write to the Free Software
00025  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
00026  */
00027 
00028 /* Please do not change the Begin/End lines of this comment section!
00029  * this is a LaTeX style section used for auto generation of the PlugIn Manual 
00030  * Chapter. Add a complete PlugIn documentation inbetween the Begin/End marks!
00031  * All "% PlugInXXX" commentary tags are mandatory
00032  * All "% OptPlugInXXX" tags are optional
00033  * --------------------------------------------------------------------------------
00034 % BeginPlugInDocuSection
00035 % PlugInDocuCaption: Probe Image Extract
00036 % PlugInName: probe_image_extract
00037 % PlugInAuthor: Bastian Weyers
00038 % PlugInAuthorEmail: weyers@users.sf.net
00039 % PlugInMenuPath: Math/Probe/Probe_Image_Extract
00040 
00041 % PlugInDescription
00042 Extract selected probe data/values and generates a new image from that.
00043 Select a \GxsmEmph{Rectangle}.
00044 
00045 % PlugInUsage
00046 Call \GxsmMenu{Math/Probe/Probe\_Image\_Extract}
00047 
00048 % OptPlugInSources
00049 The active channel is used as data source.
00050 
00051 % OptPlugInObjects
00052 A rectangle object is needed. Probe events must be present in the active scan.
00053 
00054 % OptPlugInDest
00055 The computation result is placed into an existing math channel, else into a new created math channel.
00056 
00057 % OptPlugInConfig
00058 The PlugIn configurator allows to set a default index andan chanel. If this is non
00059 zero the user is not prompted!
00060 
00061 % EndPlugInDocuSection
00062  * -------------------------------------------------------------------------------- 
00063  */
00064 
00065 #include <gtk/gtk.h>
00066 #include <glib.h>
00067 #include <math.h>
00068 #include "config.h"
00069 #include "gxsm/plugin.h"
00070 
00071 
00072 static void probe_image_extract_about( void );
00073 static void probe_image_extract_configuration( void );
00074 static gboolean probe_image_extract_run( Scan *Src, Scan *Dest );
00075 
00076 
00077 GxsmPlugin probe_image_extract_pi = {
00078         NULL,
00079         NULL,
00080         0,
00081         NULL,
00082         "Probe_Image_Extract-M1S-PX",
00083         NULL,
00084         NULL,
00085         "Bastian Weyers",
00086         "_Math/_Probe/",
00087         N_("Image Extract"),
00088         N_("Probe Image Extract of selection of scan"),
00089         "no more info",
00090         NULL,
00091         NULL,
00092         NULL,
00093         NULL,
00094         probe_image_extract_about,
00095         probe_image_extract_configuration,
00096         NULL,
00097         NULL
00098 };
00099 
00100 GxsmMathOneSrcPlugin probe_image_extract_m1s_pi = {
00101   probe_image_extract_run
00102 };
00103 
00104 static const char *about_text = N_("Gxsm (Raster-) Probe Image Extraction Math-Plugin\n\n"
00105                                    "Probe Event Data extraction:\n"
00106                                    "A new image is generated from specified probe data.");
00107 
00108 double IndexDefault = 0.;
00109 double IndexLast = 0.;
00110 
00111 GxsmPlugin *get_gxsm_plugin_info ( void ){ 
00112         probe_image_extract_pi.description = g_strdup_printf(N_("Gxsm MathOneArg probe_image_extract plugin %s"), VERSION);
00113         return &probe_image_extract_pi; 
00114 }
00115 
00116 GxsmMathOneSrcPlugin *get_gxsm_math_one_src_plugin_info( void ) { 
00117         return &probe_image_extract_m1s_pi; 
00118 }
00119 
00120 static void probe_image_extract_about(void)
00121 {
00122         const gchar *authors[] = { probe_image_extract_pi.authors, NULL};
00123         gtk_widget_show(gnome_about_new ( probe_image_extract_pi.name,
00124                                           VERSION,
00125                                           N_("(C) 2000 the Free Software Foundation"),
00126                                           about_text,
00127                                           authors,
00128                                           NULL, NULL, NULL
00129                                 ));
00130 }
00131 
00132 static void probe_image_extract_configuration( void ){
00133         probe_image_extract_pi.app->ValueRequest("Enter Number", "Index", 
00134                                                  "Default set index for data extraction.",
00135                                                  probe_image_extract_pi.app->xsm->Unity, 
00136                                                  0., 20., ".0f", &IndexDefault);
00137 }
00138 
00139 gint find_probe (gpointer *se, gpointer *default_probe_event){
00140         return (((EventEntry*) ((ScanEvent*)se)->event_list->data)->description_id () == 'P' ? 0:-1);
00141 }
00142 
00143 gint compare_events_distance (ScanEvent *a, ScanEvent *b, double *xy){
00144         double da = a->distance2 (xy);
00145         double db = b->distance2 (xy);
00146         if (da < db) return -1;
00147         if (da > db) return 1;
00148         return 0;
00149 }
00150 
00151 gint check_probe (ProbeEntry *a, ProbeEntry *b, char *Source2){
00152         //if (! 
00153         for (int j=0; j<b->get_chunk_size (); j++){
00154                 if (! strncmp (b->get_label (j), Source2, 4)) return j;
00155         }
00156 
00157         return -1;
00158 }
00159 
00160 void ChangeValue (GtkComboBox* Combo,  gchar **string){
00161         GtkTreeIter iter;
00162         GtkTreeModel *model;
00163         gtk_combo_box_get_active_iter (GTK_COMBO_BOX (Combo), &iter);
00164         model = gtk_combo_box_get_model (GTK_COMBO_BOX (Combo));
00165         gtk_tree_model_get (model, &iter, 0, &(*string), -1);
00166         //std::cout << "Channel: " << *string << std::endl;
00167 }
00168 
00169 void ChangeIndex (GtkSpinButton *spinner, double *index){
00170         *index = gtk_spin_button_get_value (spinner);
00171 
00172         //std::cout << "Change Value " << index << std::endl;
00173 }
00174 
00175 void Dialog (ProbeEntry* defaultprobe, gchar **Source1, gchar **Source2, double *index){
00176 
00177         GtkWidget *dialog;
00178         GtkWidget *label;
00179         GtkWidget *vbox;
00180         GtkWidget *hbox;
00181         GtkWidget *source1_combo;
00182         GtkWidget *source2_combo;
00183         GtkWidget *spinner;
00184         GtkAdjustment *spinner_adj;
00185         
00186         char* Source1_lookup[]  = { "Zmon", "Umon", "Time", "XS", "YS", 
00187                                      "ZS", "Bias", "Phase", NULL};
00188 
00189         char* Source2_lookup[]  = { "ADC0", "ADC1", "ADC2", "ADC3", "ADC4", "ADC5-I","ADC6","ADC7",
00190                                      "Zmon", "LockIn0", "LockIn1stA", "LockIn1stB", "LockIn2ndA",
00191                                      "LockIn2ndB", NULL};
00192         
00193         dialog = gtk_dialog_new_with_buttons (_("Settings"),
00194                                                    NULL,
00195                                                    (GtkDialogFlags)(GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT),
00196                                                    GTK_STOCK_OK,
00197                                                    GTK_RESPONSE_ACCEPT,
00198                                                    NULL);
00199 
00200         vbox = gtk_vbox_new (FALSE, 0);
00201         gtk_widget_show (vbox);
00202         gtk_box_pack_start(GTK_BOX(GNOME_DIALOG(dialog)->vbox),
00203                      vbox, FALSE, FALSE, GNOME_PAD);
00204 
00205         hbox = gtk_hbox_new (FALSE, 0);
00206         gtk_container_set_border_width (GTK_CONTAINER (hbox), 5);
00207         gtk_widget_show (hbox);
00208         gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
00209                         
00210         label = gtk_label_new (_("Source for layer: "));        
00211         gtk_widget_show (label);                        
00212         gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); 
00213 
00214         source1_combo = gtk_combo_box_new_text ();
00215         gtk_combo_box_append_text (GTK_COMBO_BOX (source1_combo), "Index");
00216         for (int i=0; i<defaultprobe->get_chunk_size (); i++){
00217                 int j=0;
00218                 while (Source1_lookup[j]){
00219                         if (!strncmp (defaultprobe->get_label (i), Source1_lookup[j], 4)){
00220                                 gtk_combo_box_append_text (GTK_COMBO_BOX (source1_combo), defaultprobe->get_label (i));
00221                                 break;
00222                         }
00223                         j++;
00224                 }
00225         }
00226         gtk_combo_box_set_active (GTK_COMBO_BOX (source1_combo), 0);
00227         ChangeValue(GTK_COMBO_BOX (source1_combo), &(*Source1));                //init Source1
00228         gtk_widget_show (source1_combo);                        
00229         gtk_signal_connect(GTK_OBJECT (source1_combo), "changed", GTK_SIGNAL_FUNC (ChangeValue), &(*Source1));
00230         gtk_box_pack_start (GTK_BOX (hbox), source1_combo, FALSE, FALSE, 0);
00231          
00232 
00233         hbox = gtk_hbox_new (FALSE, 0);
00234         gtk_container_set_border_width (GTK_CONTAINER (hbox), 5);
00235         gtk_widget_show (hbox);
00236         gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
00237                         
00238         label = gtk_label_new (_("Channel to map: "));  
00239         gtk_widget_show (label);                        
00240         gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); 
00241 
00242         source2_combo = gtk_combo_box_new_text ();
00243         for (int i=0; i<defaultprobe->get_chunk_size (); i++){
00244                 int j=0;
00245                 while (Source2_lookup[j]){
00246                         if (!strncmp (defaultprobe->get_label (i), Source2_lookup[j], 4)){
00247                                 gtk_combo_box_append_text (GTK_COMBO_BOX (source2_combo), defaultprobe->get_label (i));
00248                                 break;
00249                         }
00250                         j++;
00251                 }
00252         }
00253         gtk_combo_box_set_active (GTK_COMBO_BOX (source2_combo), 0);
00254         ChangeValue(GTK_COMBO_BOX (source2_combo), &(*Source2));                //init Source2
00255         gtk_widget_show (source2_combo);                        
00256         gtk_signal_connect(GTK_OBJECT (source2_combo), "changed", GTK_SIGNAL_FUNC (ChangeValue), &(*Source2));
00257         gtk_box_pack_start (GTK_BOX (hbox), source2_combo, FALSE, FALSE, 0);
00258 
00259         hbox = gtk_hbox_new (FALSE, 0);
00260         gtk_container_set_border_width (GTK_CONTAINER (hbox), 8);
00261         gtk_widget_show (hbox);
00262         gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
00263                         
00264         label = gtk_label_new (_("Image Filter\n0 (sharp) ... 10 (smooth)"));   
00265         gtk_widget_show (label);                        
00266         gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); 
00267 
00268         spinner_adj = (GtkAdjustment *) gtk_adjustment_new (IndexLast, 0.0, 10.0, 0.1, 1.0, 1.0);
00269         spinner = gtk_spin_button_new (spinner_adj, 0.1, 1);
00270         gtk_widget_show (spinner);                      
00271         gtk_signal_connect(GTK_OBJECT (spinner), "changed", GTK_SIGNAL_FUNC (ChangeIndex), &(*index));
00272         gtk_box_pack_start (GTK_BOX (hbox), spinner, FALSE, FALSE, 0);
00273 
00274 /*      
00275         gtk_widget_set_usize (VarName, 100, -1);
00276         gtk_widget_show (VarName);
00277         gtk_label_set_justify(GTK_LABEL(VarName), GTK_JUSTIFY_LEFT);
00278         gtk_misc_set_alignment (GTK_MISC (VarName), 0.0, 0.5);
00279         gtk_misc_set_padding (GTK_MISC (VarName), 5, 0);
00280         gtk_box_pack_start (GTK_BOX (hbox), VarName, TRUE, TRUE, 0);
00281 
00282 */      
00283         gtk_dialog_run(GTK_DIALOG(dialog));
00284         gtk_widget_destroy (dialog);
00285 
00286 }
00287 
00288 
00289 // PlugIn run function, called by menu via PlugIn mechanism.
00290 static gboolean probe_image_extract_run(Scan *Src, Scan *Dest)
00291 {
00292         PI_DEBUG (DBG_L2, "Probe_Image_Extract Scan");
00293 
00294         int numsets = Dest->mem2d->GetNv ();
00295         int avgvectors = 5;             // minimum number of vectors used for interpolation
00296         double radius;                  // the catchment area of each point, usually there should be #acgvectors in it.
00297         double xy[2];                   // real world position of a probe_event
00298         double index = IndexLast;
00299         gchar *Source1;                 // is the channel for layers V
00300         gchar *Source2;                 // is the channel, that will be mapped
00301         int iSource1 = -1;              // -1 means "Index" that is not available as a real channel
00302         int iSource2 = -1;              // -1 means no channel to map -> break
00303         int jSource2 = -1;              // -1 means no channel to map -> break
00304         int Nx = Src->mem2d->GetNx ();  // total Number of points in x
00305         int Ny = Src->mem2d->GetNy ();  // total Number of points in y
00306         int xmin, xmax, ymin, ymax;     // region that is taken into account for averaging
00307 
00308 
00309         GSList *ProbeEventList = g_slist_find_custom (Src->mem2d->scan_event_list, NULL, (GCompareFunc)find_probe);
00310         ScanEvent* default_probe_event = (ScanEvent*) ProbeEventList->data;
00311         if (!default_probe_event) return MATH_OK;  // in case of no probe event in the scan
00312         ProbeEntry* defaultprobe = (ProbeEntry*) default_probe_event->event_list->data; // define a default pattern all probes should match
00313 
00314         Dialog (defaultprobe, &Source1, &Source2, &index);  // Asks for channels to use
00315         IndexLast = index; 
00316 
00317         // if no valid channel is found for Source1, we will use a numerator #
00318         PI_DEBUG (DBG_L2, "Source1 = " << Source1 << std::endl);
00319         PI_DEBUG (DBG_L2, "Source2 = " << Source2 << std::endl);
00320         PI_DEBUG (DBG_L2, "Index: " << index << std::endl);
00321         
00322         
00323         for (int j=0; j<defaultprobe->get_chunk_size (); j++){
00324                 // std::cout << "Label = " << defaultprobe->get_label (j) << std::endl;
00325                 if (! strncmp (defaultprobe->get_label (j), Source1, 4)) iSource1 = j;
00326                 if (! strncmp (defaultprobe->get_label (j), Source2, 4)) iSource2 = j;
00327         }
00328         if (iSource2 < 0) return MATH_OK;  // No valid channel found for Source2, so stop at this point
00329 
00330         numsets = defaultprobe->get_num_sets ();             // #points of a probe = #layers
00331         Dest->mem2d->Resize(Dest->mem2d->GetNx (), Dest->mem2d->GetNy (), numsets, ZD_FLOAT);
00332         Dest->mem2d->data->MkVLookup(0., (double)numsets);
00333         Dest->data.s.nvalues=numsets;
00334         Dest->data.s.ntimes=1;
00335         Dest->data.s.dz=1.;
00336         
00337         if (Source1 < 0){
00338                 UnitObj *NUnit = new UnitObj( " "," ",".0f", "#");
00339                 Dest->data.SetVUnit (NUnit);
00340                 delete NUnit;
00341                 for (int n=0; n<numsets; n++) Dest->mem2d->data->SetVLookup(n, n);
00342         } else {
00343                 UnitObj *NUnit = new UnitObj( defaultprobe->get_unit_symbol(iSource1), defaultprobe->get_unit_symbol(iSource1),".3f", defaultprobe->get_label (iSource1));
00344                 Dest->data.SetVUnit (NUnit);
00345                 delete NUnit;
00346                 for (int n=0; n<numsets; n++) Dest->mem2d->data->SetVLookup(n, defaultprobe->get (n, iSource1));
00347         }               
00348 
00349         UnitObj *VoltUnit = new UnitObj( defaultprobe->get_unit_symbol (iSource2), defaultprobe->get_unit_symbol (iSource2),".3f", defaultprobe->get_label (iSource2));
00350         Dest->data.SetZUnit (VoltUnit);
00351         delete VoltUnit;
00352 
00353 
00354         double smoothness = pow(2., index-1.);
00355         radius = sqrt( (double)(Dest->mem2d->GetNx () * Dest->mem2d->GetNy () * avgvectors)/(double)(3*g_slist_length (Src->mem2d->scan_event_list)))+smoothness;
00356         PI_DEBUG (DBG_L2, "radius = " << radius << std::endl);
00357 
00358         PI_DEBUG (DBG_L2, "Initialising lookup table for " << g_slist_length (Src->mem2d->scan_event_list) << " probe events." << std::endl);
00359 
00360         // a 'matrix' with information about the position of probe events.
00361         int* matrix = new int [Nx * Ny];
00362         for (int i=0; i < Nx * Ny; i++) matrix[i]=-1;   // set all elements to -1, after analysing all probe events -1 will mean no probe at this point
00363 
00364         for (int n=0; n < g_slist_length (Src->mem2d->scan_event_list); n++){
00365                 ScanEvent* se = (ScanEvent*) g_slist_nth_data (Src->mem2d->scan_event_list, n); // get the nth scan_event
00366                 if (!se) {
00367                         PI_DEBUG (DBG_L2, "Empty Scan_Event found!");
00368                 }
00369                 else if (((EventEntry*) (se->event_list->data))->description_id () == 'P'){     // let's look if it is a valid probe_event
00370                                 int xn,yn = 0;
00371                                 ProbeEntry* pe = (ProbeEntry*) se->event_list->data;
00372                                 se->get_position(xy[0], xy[1]);
00373                                 Dest->World2Pixel(xy[0],xy[1], xn , yn);
00374                                 if ( xn >= 0 && xn < Nx && yn >= 0 && yn < Ny ){
00375                                         matrix[yn*Nx+xn] = n;
00376                                         //PI_DEBUG (DBG_L2, "PE" << n << " @ ( " << xn << " | " << yn << " ) " );
00377                                 }
00378         }}
00379         
00380 
00381 
00382         double avgvalues[numsets], avgnorm;
00383         int dead_pixel = 0;     //dead pixel indicator. Did not found a vektor in the near? Shit we have a dead pixel with all values equal to zero :(
00384 
00385         gapp->progress_info_new ("Converting Probe Data...", 1);
00386         gapp->progress_info_set_bar_fraction (0., 1);
00387         gapp->progress_info_set_bar_text (" ", 1);
00388 //      gapp->progress_info_set_bar_fraction (0., 2);
00389 //      gapp->progress_info_set_bar_text ("0 %% ", 2);
00390 
00391         for (int yi=0; yi < Dest->mem2d->GetNy (); yi++){
00392         // std::cout << (double) yi/(Dest->mem2d->GetNy ())*100. << std::endl;
00393         gapp->progress_info_set_bar_fraction ( (double) (yi+1)/Dest->mem2d->GetNy () , 1);
00394         gapp->progress_info_set_bar_text (g_strdup_printf("Line %i of %i", yi+1, Dest->mem2d->GetNy ()), 1);
00395 /*
00396         std::cout << "Total rows: " << Dest->mem2d->GetNy () << std::endl;
00397         std::cout << "Total columns: " << Dest->mem2d->GetNx () << std::endl;
00398         std::cout << "Total spectra: " << g_slist_length (Src->mem2d->scan_event_list) << std::endl;
00399 */
00400         int counter = 0;
00401         int pe_number = -1;             // position of the probe event in the event list
00402 
00403         for (int xi=0; xi < Dest->mem2d->GetNx (); xi++){
00404                 //gapp->progress_info_set_bar_fraction ( (double) (xi+1)/(Dest->mem2d->GetNy ()) , 2);
00405                 //gapp->progress_info_set_bar_text (g_strdup_printf("Point %i of %i", xi+1, Dest->mem2d->GetNx ()), 2);
00406 
00407                 int found_a_vector = 0;         // number of vectors found in the given perimeter round (xi,yi)
00408                 for (int i=0; i<numsets; i++) avgvalues[i] = avgnorm = 0.;      // initialises avg vectors and the kalibration value
00409 
00410                 if ( (xmin = xi - (int)radius) < 0) xmin = 0;
00411                 if ( (xmax = xi + (int)radius) > Nx) xmax = Nx;
00412                 if ( (ymin = yi - (int)radius) < 0) ymin = 0;
00413                 if ( (ymax = yi + (int)radius) > Ny) ymax = Ny;
00414 
00415                 for (int xpos=xmin; xpos < xmax; xpos++){
00416                 for (int ypos=ymin; ypos < ymax; ypos++){
00417                         if ( (pe_number = matrix[ypos*Nx+xpos]) >= 0){
00418                                 counter++;
00419                                 // get the probe data of the scan_event found with matrix
00420                                 ProbeEntry* pe = (ProbeEntry*) ((ScanEvent*) g_slist_nth_data (Src->mem2d->scan_event_list, pe_number))->event_list->data;      
00421                                 jSource2 = check_probe(defaultprobe, pe, Source2);
00422                                 if ( jSource2 >= 0 ){
00423                                         double norm = exp(-sqrt((double)((xpos-xi)*(xpos-xi)+(ypos-yi)*(ypos-yi))/smoothness));
00424                                         avgnorm += norm;
00425                                         for (int zi=0; zi < numsets; zi++){
00426                                                 avgvalues[zi] += norm * pe->get(zi, jSource2);
00427                                         }
00428                                         found_a_vector++;
00429                                 }
00430                         }
00431                         
00432                 }}
00433                 
00434 /*              for (int n=0; n < g_slist_length (Src->mem2d->scan_event_list); n++){   // have a look on all available vectors and check if they are matching
00435 //                      std::cout << "Counter: " << counter << std::endl;
00436                         counter++;
00437                         ScanEvent* se = (ScanEvent*) g_slist_nth_data (Src->mem2d->scan_event_list, n); // get the nth scan_event
00438                         if (!se) {
00439                                 PI_DEBUG (DBG_L2, "Empty Scan_Event found!");
00440                         }
00441                         else if (((EventEntry*) (se->event_list->data))->description_id () == 'P'){     // let's look if it is a probe_event
00442                                 int xn,yn = 0;
00443                                 ProbeEntry* pe = (ProbeEntry*) se->event_list->data;
00444                                 se->get_position(xy[0], xy[1]);
00445                                 Dest->World2Pixel(xy[0],xy[1], xn , yn);
00446                                 jSource2 = check_probe(defaultprobe, pe, Source2);
00447                                 if ( jSource2 >= 0 && (xn-xi)*(xn-xi)+(yn-yi)*(yn-yi) < (int) (radius*radius)){
00448                                         double norm = exp(-sqrt((double)((xn-xi)*(xn-xi)+(yn-yi)*(yn-yi))/smoothness));
00449                                         avgnorm += norm;
00450                                         for (int zi=0; zi < numsets; zi++){
00451                                                 avgvalues[zi] += norm * pe->get(zi, jSource2);
00452                                         }
00453                                         found_a_vector++;
00454                                 }
00455                                 //std::cout << ((EventEntry*) (se->event_list->data))->description_id () << std::endl;
00456                                 //std::cout << "x: " << xy[0] << "  y: " << xy[1] << std::endl;
00457                                 //std::cout << "x: " << xn << "  y: " << yn << std::endl;
00458                         }
00459                 }
00460 */
00461                 //std::cout << "found_a_vector: " << found_a_vector << std::endl;
00462                 for (int i=0; i<numsets; i++) {
00463                         if (found_a_vector == 0){
00464                                 dead_pixel++;
00465                                 PI_DEBUG (DBG_L2, "dead_pixel at X" << xi << " Y" << yi << std::endl);
00466                         }
00467                         else {
00468                                 for (int zi=0; zi<numsets; zi++){
00469                                         Dest->mem2d->PutDataPkt ( avgvalues[zi]/avgnorm, xi, yi, zi);
00470                                 }
00471                         }
00472                 //std::cout << "avgvalue: " << avgvalues[0] << "avgnorm: " << avgnorm << std::endl;
00473                 
00474                 }
00475         }}
00476 
00477         delete [] matrix;
00478 
00479         gapp->progress_info_close ();
00480         PI_DEBUG (DBG_L2, "Total number of dead_pixel: " << dead_pixel << std::endl);
00481         return MATH_OK;
00482 }

Generated on Sat Apr 1 09:04:22 2006 for GXSM by  doxygen 1.4.6