Skip to content

Commit 2627d09

Browse files
committed
add autoparameters to APRConverterBatch
1 parent f750ef5 commit 2627d09

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

src/algorithm/APRConverterBatch.hpp

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,13 @@
1313

1414
#ifdef HAVE_LIBTIFF // This class requires LibTIFF to read tiles from file
1515

16+
#include "AutoParameters.hpp"
1617
#include "data_structures/Mesh/PixelData.hpp"
1718
#include "data_structures/Mesh/ImagePatch.hpp"
1819

1920
#include "io/TiffUtils.hpp"
2021
#include "data_structures/APR/APR.hpp"
2122

22-
#include "APRConverter.hpp"
23-
2423
#include "ComputeGradient.hpp"
2524
#include "LocalIntensityScale.hpp"
2625
#include "LocalParticleCellSet.hpp"
@@ -228,7 +227,6 @@ bool APRConverterBatch<ImageType>::get_apr_method_patch(APR &aAPR, PixelData<T>&
228227
}
229228
fine_grained_timer.stop_timer();
230229

231-
//#ifndef APR_USE_CUDA
232230
method_timer.start_timer("compute_gradient_magnitude_using_bsplines");
233231
iComputeGradient.get_gradient(image_temp, grad_temp, local_scale_temp, par);
234232
method_timer.stop_timer();
@@ -245,16 +243,16 @@ bool APRConverterBatch<ImageType>::get_apr_method_patch(APR &aAPR, PixelData<T>&
245243
TiffUtils::saveMeshAsTiff(par.output_dir + "local_intensity_scale_step.tif", local_scale_temp);
246244
}
247245

248-
//#else
249-
// method_timer.start_timer("compute_gradient_magnitude_using_bsplines and local instensity scale CUDA");
250-
// getFullPipeline(image_temp, grad_temp, local_scale_temp, local_scale_temp2,bspline_offset, par);
251-
// method_timer.stop_timer();
252-
//#endif
246+
if (par.auto_parameters) {
247+
method_timer.start_timer("autoParameters");
248+
autoParametersLiEntropy(par, local_scale_temp2, local_scale_temp, grad_temp, bspline_offset, verbose);
249+
aAPR.parameters = par;
250+
method_timer.stop_timer();
251+
}
253252

254-
//TODO: How to do auto parameters? compute from first patch only?
255-
computation_timer.start_timer("apply_parameters");
253+
method_timer.start_timer("apply_parameters");
256254
applyParameters(grad_temp, local_scale_temp, local_scale_temp2,par);
257-
computation_timer.stop_timer();
255+
method_timer.stop_timer();
258256

259257
method_timer.start_timer("compute_local_particle_set");
260258
iLocalParticleSet.computeLevels(grad_temp, local_scale_temp, aAPR.level_max(), par.rel_error, par.dx, par.dy, par.dz);

0 commit comments

Comments
 (0)