CoBrALab / optimized_antsMultivariateTemplateConstruction

A re-implementation of antsMultivariateTemplateConstruction2.sh using optimized image pyramid scale-space and qbatch support
Other
22 stars 8 forks source link

Wrote new python script to compute averages from a set of images to r… #45

Closed Gab-D-G closed 2 years ago

Gab-D-G commented 2 years ago

…eplace the currently slow median implementation.

gdevenyi commented 2 years ago

One more request, please add the effcient trimean as an estimator: https://en.wikipedia.org/wiki/Trimean

R code:

efficient_trimean <- function(X){
  # Boosted effciency (sensitivity) trimean, average of 20th, 50th and 80th percentiles
  a <- quantile(X, c(0.2,0.5,0.8))
  result <- mean(a)
  return(result)
}
Gab-D-G commented 2 years ago

is this alright?

elif opts.method == 'efficient_trimmed_mean':
    # computes the average from the 20th,50th and 80th percentiles
    average = np.quantile(concat_array, (0.2,0.5,0.8),axis=0).mean(axis=0)
gdevenyi commented 2 years ago

Yes, except its not a trimmed mean, its a "trimean". Please include the wikipedia link in the comment.