<jupyter_start><jupyter_text>Building template from four kidney models  Loading the required modeules<jupyter_code>%%capture
!pip install antspyx
import ants
import os

import warnings
warnings.filterwarnings(action='ignore')

data_dir='./'<jupyter_output><empty_output><jupyter_text>Loading the data<jupyter_code>files=[i for i in os.listdir(os.getcwd()) if '.nii.gz' in i]

target_img=ants.image_read('/content/VHF_Kidney_L_High.nii.gz')
population=[ants.image_read(i).resample_image_to_target(target_img) for i in files]<jupyter_output><empty_output><jupyter_text>Building the template<jupyter_code>btp = ants.build_template( image_list = population,
                          synMetric = 'SyN')
btp<jupyter_output><empty_output><jupyter_text>Displaying the constructed template<jupyter_code>btp.plot()
ants.image_write(btp,'built_template.nii.gz')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11350737797956867, 'fraction_numerical': 0.0, 'mean_word_length': 7.732673267326732, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '657424', 'license': 'MIT', 'n_tokens_mistral': 326, 'n_tokens_neox': 315, 'n_words': 49, 'path': 'ANT/building template.ipynb', 'repo_name': 'cns-iu/ccf-research', 'size': '881'}