Print

Print


Greetings FSL Developers!

I would like to suggest an enhancement to BET - it would be useful to expose the surface smoothness control at the command line level.

We are currently trying to skull-strip brain images of various monkey species, and it turns out their brains are a little more "pointy" than human brains. So we very often loose brain regions in the stripping. By reducing the scale of the surface smoothing, this can be nicely addressed and we get virtually perfect strips.

I am sending below a diff between our modified version of bet2.cpp and the one shipped with FSL4.1.5. The patch adds a new parameter, "-w"/"--smooth", which scales the coefficients of the nonlinear smoothing function. For our monkeys, we can now simply add "-w 0.5" to the command line, and BET works for them as it works for people :)

Best,
  Torsten

--- src/bet2/bet2.cpp   2010-11-24 15:27:51.000000000 -0800
*** 136,141 ****
--- 136,144 ----
  Option<float> gradient_threshold(string("-g"), 0.0,
                                 string("~<g>\t\tvertical gradient in fractional intensity threshold (-1->1); default=0; positive values give larger brain outline at bottom, smaller at top"), false, requires_argument);
  
+ Option<float> smootharg(string("-w,--smooth"), 1.0,
+                      string("~<r>\tsmoothness factor; default=1; values smaller than 1 produce more detailed brain surface, values larger than one produce smoother, less detailed surface"), false, requires_argument);
+ 
  Option<float> radiusarg(string("-r,--radius"), 0.0,
                     string("~<r>\thead radius (mm not voxels); initial surface sphere is set to half of this"), false, requires_argument);
  
***************
*** 659,664 ****
--- 662,668 ----
    options.add(fractional_threshold);
    options.add(gradient_threshold);
    options.add(radiusarg);
+   options.add(smootharg);
    options.add(centerarg);
    options.add(apply_thresholding);
    options.add(generate_mesh);
***************
*** 780,787 ****
  
    Mesh moriginal=m;
    
!   const double rmin=3.33;
!   const double rmax=10;
    const double E = (1/rmin + 1/rmax)/2.;
    const double F = 6./(1/rmin - 1/rmax);
    const int nb_iter = 1000;
--- 784,791 ----
  
    Mesh moriginal=m;
    
!   const double rmin=3.33 * smootharg.value();
!   const double rmax=10.0 * smootharg.value();
    const double E = (1/rmin + 1/rmax)/2.;
    const double F = 6./(1/rmin - 1/rmax);
    const int nb_iter = 1000;