Iteratively estimate a population shape and intensity average image. This can be computationally intensive and currently is not parallelized. Perhaps better to use official antsMultivariateTemplateConstruction* in ANTs. However, this code can be useful for smaller problems/populations.

buildTemplate(
  initialTemplate,
  imgList,
  typeofTransform,
  iterations = 3,
  gradientStep = 0.25,
  blendingWeight = 0.5,
  segList,
  weights,
  verbose = TRUE,
  ...
)

Arguments

initialTemplate

fixed image to which we register the population.

imgList

moving image list from which template will be built.

typeofTransform

A linear or non-linear registration type. Mutual information metric by default. See antsRegistration.

iterations

should be greater than 1 less than 10.

gradientStep

speed of template shape update step, less than 1.

blendingWeight

parameter between zero and one, default 0.5; higher values lead to sharper intensity but may also cause artifacts.

segList

segmentations for each target image, this will trigger a joint label fusion call for each iteration and use masks during registration.

weights

numeric vector, length of number of images providing weights

verbose

print diagnostic messages, passed to antsRegistration

...

Additional options to pass to antsRegistration

Value

template antsImage

Author

Avants BB

Examples

pop <- getANTsRData("population")
avg <- antsAverageImages(pop) # this is in ANTsR
#> ================================================================================
template <- buildTemplate(avg, pop, "SyN", iterations = 1)
#> Iteration: 1
#> Averaging images
#> ================================================================================
#> Averaging warped composed transforms
#> ================================================================================
#> Blending template image2.60802504142812