diff --git a/Faces/templateCommand.py b/Faces/templateCommand.py new file mode 100644 index 0000000..646baa7 --- /dev/null +++ b/Faces/templateCommand.py @@ -0,0 +1,23 @@ +import ants +import os +import glob + +dataDirectory = './' +populationFiles = glob.glob( dataDirectory + "face*.nii.gz" ) + +population = list() +for i in range( len( populationFiles ) ): + population.append( ants.image_read( populationFiles[i], dimension = 2 ) ) + +btp = ants.build_template( initialTemplate = None, + image_list = population, + iterations = 4, + gradient_step = 0.15, + verbose = False, + syn_metric = 'CC', + reg_iterations = ( 100, 100, 100, 70, 50, 10 ), + type_of_transform = "SyNCC", + ) + +ants.image_write( btp, "templatePy.nrrd" ) +ants.plot( btp )