for sigma_idx in range(0,len(sigma)):

            print "***** Iter: " , niter

            IA_error = np.zeros((ntrials, 3));
            ICP_error = np.zeros((ntrials, 3));

            for trial in range(0,ntrials):

              trial_root_dir = root_dir + "/pert_" + sigma_str[sigma_idx] + "_" + str(trial)

              print "***** Trial: " , trial
              IA_error[trial,:], ICP_error[trial,:] = reg3d.transformation_error(root_dir = trial_root_dir,
                                                                                 descriptor_type = descriptor,
                                                                                 percentile = percentile,
                                                                                 nr_iterations = niter,
                                                                                 gt_fname = "Hs-identity.txt",
                                                                                 geo_tfile = geo_tfile)

            print "IA:"
            print IA_error
            print "ICP Error:"
            print ICP_error

            #Compute mean, max and min
            IA_error_mean[sigma_idx, :] = np.mean(IA_error, axis=0)
            ICP_error_mean[sigma_idx, :]= np.mean(ICP_error, axis=0)
            IA_error_max[sigma_idx, :] = np.max(IA_error, axis=0)
            ICP_error_max[sigma_idx, :]= np.max(ICP_error, axis=0)
            IA_error_min[sigma_idx, :] = np.min(IA_error, axis=0)
            ICP_error_min[sigma_idx, :]= np.min(ICP_error, axis=0)
                    descriptor_string = descriptor_string + "_cropped"
                    aux_output_string = aux_output_string + "-cropped"


                if compute_scale:
                    aux_output_string = aux_output_string + "_scale"
                    if bound_scale:
                        aux_output_string = aux_output_string + "_bound_" + str(bound_percentile)

                print descriptor_string, aux_output_string

                IA_error_FPFH, ICP_error_FPFH = reg3d.transformation_error( root_dir = trial_root_dir,
                                                                            descriptor_type = "FPFH",
                                                                            percentile = 99,
                                                                            nr_iterations = nr_iter,
                                                                            aux_output_string = aux_output_string,
                                                                            gt_fname = gt_fname,
                                                                            geo_tfile = geo_tfile,
                                                                            nsamples          = nsamples[ns],
                                                                            sample_distance   = sample_distance[sd],
                                                                            compute_scale     = True)

                IA_error_SHOT, ICP_error_SHOT = reg3d.transformation_error( root_dir = trial_root_dir,
                                                                            descriptor_type = "SHOT",
                                                                            percentile = 99,
                                                                            nr_iterations = nr_iter,
                                                                            aux_output_string = aux_output_string,
                                                                            gt_fname = gt_fname,
                                                                            geo_tfile = geo_tfile,
                                                                            nsamples          = nsamples[ns],
                                                                            sample_distance   = sample_distance[sd],
                                                                            compute_scale     = True)
        if cropped:
          descriptor_string = "descriptors_cropped"
          # aux_output_string = flight + "-" + gt_flight + "-cropped"
          #Note: when I run the experiment the output files were labeled by mistake src-src
          aux_output_string = flight + "-" + flight + "-cropped"


        else:
          descriptor_string = "descriptors"
          aux_output_string = flight + "-" + gt_flight

        IA_error_FPFH_99, ICP_error_FPFH_99 = reg3d.transformation_error(root_dir = trial_root_dir,
                                                         descriptor_type = "FPFH",
                                                         percentile = 99,
                                                         nr_iterations = nr_iter,
                                                         aux_output_string = aux_output_string,
                                                         gt_fname = gt_fname,
                                                         geo_tfile = geo_tfile)
        IA_error_FPFH_95, ICP_error_FPFH_95 = reg3d.transformation_error(root_dir = trial_root_dir,
                                                         descriptor_type = "FPFH",
                                                         percentile = 95,
                                                         nr_iterations = nr_iter,
                                                         aux_output_string = aux_output_string,
                                                         gt_fname = gt_fname,
                                                         geo_tfile = geo_tfile)
        IA_error_FPFH_90, ICP_error_FPFH_90 = reg3d.transformation_error(root_dir = trial_root_dir,
                                                         descriptor_type = "FPFH",
                                                         percentile = 90,
                                                         nr_iterations = nr_iter,
                                                         aux_output_string = aux_output_string,