Skip to content

Commit 3690621

Browse files
committed
provide an option to the user for the SSSIG threshold
1 parent cc2062e commit 3690621

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

src/base/DICe.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,8 @@ const char* const max_solver_iterations_robust = "max_solver_iterations_robust";
177177
/// String parameter name
178178
const char* const robust_solver_tolerance = "robust_solver_tolerance";
179179
/// String parameter name
180+
const char* const sssig_threshold = "sssig_threshold";
181+
/// String parameter name
180182
const char* const initial_gamma_threshold = "initial_gamma_threshold";
181183
/// String parameter name
182184
const char* const final_gamma_threshold = "final_gamma_threshold";
@@ -996,6 +998,8 @@ const Correlation_Parameter skip_solve_gamma_threshold_param(skip_solve_gamma_th
996998
/// Correlation parameter and properties
997999
const Correlation_Parameter initial_gamma_threshold_param(initial_gamma_threshold,SCALAR_PARAM,true,
9981000
"If the gamma evaluation for the initial deformation guess is not below this value, initialization will fail");
1001+
const Correlation_Parameter sssig_threshold_param(sssig_threshold,SCALAR_PARAM,true,
1002+
"filters out areas of the image with low gradients, if a subset has an SSSIG below this value it gets excluded");
9991003
/// Correlation parameter and properties
10001004
const Correlation_Parameter final_gamma_threshold_param(final_gamma_threshold,SCALAR_PARAM,true,
10011005
"If the gamma evaluation for the final deformation guess is not below this value, the step will fail for this subset");
@@ -1168,7 +1172,7 @@ const Correlation_Parameter filter_failed_cine_pixels_param(filter_failed_cine_p
11681172
// TODO don't forget to update this when adding a new one
11691173
/// The total number of valid correlation parameters
11701174
/// Vector of valid parameter names
1171-
const int_t num_valid_correlation_params = 79;
1175+
const int_t num_valid_correlation_params = 80;
11721176
/// Vector oIf valid parameter names
11731177
const Correlation_Parameter valid_correlation_params[num_valid_correlation_params] = {
11741178
correlation_routine_param,
@@ -1194,6 +1198,7 @@ const Correlation_Parameter valid_correlation_params[num_valid_correlation_param
11941198
skip_all_solves_param,
11951199
skip_solve_gamma_threshold_param,
11961200
initial_gamma_threshold_param,
1201+
sssig_threshold_param,
11971202
final_gamma_threshold_param,
11981203
path_distance_threshold_param,
11991204
disp_jump_tol_param,

src/core/DICe_Decomp.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -577,12 +577,9 @@ Decomp::populate_global_coordinate_vector(Teuchos::ArrayRCP<scalar_t> & subset_c
577577
}
578578
}
579579
}
580-
if(optimization_method==GRADIENT_BASED || optimization_method==GRADIENT_BASED_THEN_SIMPLEX){
581-
const scalar_t grad_threshold = 50.0; // threshold determined from example images
582-
DICe::create_regular_grid_of_correlation_points(*subset_centroids_on_0,*neighbor_ids_on_0,input_params,image,subset_info,grad_threshold);
583-
}
584-
else
585-
DICe::create_regular_grid_of_correlation_points(*subset_centroids_on_0,*neighbor_ids_on_0,input_params,image,subset_info);
580+
const scalar_t default_threshold = optimization_method==GRADIENT_BASED || optimization_method==GRADIENT_BASED_THEN_SIMPLEX ? 50.0: -1.0;
581+
const scalar_t grad_threshold = correlation_params->get<double>(DICe::sssig_threshold,default_threshold);
582+
DICe::create_regular_grid_of_correlation_points(*subset_centroids_on_0,*neighbor_ids_on_0,input_params,image,subset_info,grad_threshold);
586583
// check all the subsets and eliminate ones with a gradient ratio too low
587584
num_global_subsets = subset_centroids_on_0->size()/dim; // divide by three because the stride is x y neighbor_id
588585
assert(neighbor_ids_on_0->size()==subset_centroids_on_0->size()/2);

src/core/DICe_ParameterUtilities.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,7 @@ DICE_LIB_DLL_EXPORT void tracking_default_params(Teuchos::ParameterList * defau
370370
defaultParams->set(DICe::skip_solve_gamma_threshold,1.0E-10);
371371
defaultParams->set(DICe::skip_all_solves,false);
372372
defaultParams->set(DICe::initial_gamma_threshold,-1.0);
373+
defaultParams->set(DICe::sssig_threshold,-1.0);
373374
defaultParams->set(DICe::final_gamma_threshold,-1.0);
374375
defaultParams->set(DICe::path_distance_threshold,-1.0);
375376
defaultParams->set(DICe::rotate_ref_image_90,false);
@@ -425,6 +426,7 @@ DICE_LIB_DLL_EXPORT void dice_default_params(Teuchos::ParameterList * defaultPa
425426
defaultParams->set(DICe::skip_solve_gamma_threshold,1.0E-10);
426427
defaultParams->set(DICe::skip_all_solves,false);
427428
defaultParams->set(DICe::initial_gamma_threshold,-1.0);
429+
defaultParams->set(DICe::sssig_threshold,-1.0);
428430
defaultParams->set(DICe::final_gamma_threshold,-1.0);
429431
defaultParams->set(DICe::path_distance_threshold,-1.0);
430432
defaultParams->set(DICe::rotate_ref_image_90,false);

src/core/DICe_Parser.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1554,7 +1554,6 @@ bool valid_correlation_point(const int_t x_coord,
15541554
std::set<std::pair<int_t,int_t> > & coords,
15551555
std::set<std::pair<int_t,int_t> > & excluded_coords,
15561556
const scalar_t & grad_threshold){
1557-
15581557
// need to check if the point is interior to the image by at least one subset_size
15591558
if(x_coord<subset_size-1) return false;
15601559
if(x_coord>image->width()-subset_size) return false;

0 commit comments

Comments
 (0)