Problems using pediatric template from TemplateFlow

Hi @oesteban @effigies,

Thanks for your help, we managed to find a workaround by downloading the templateflow directory and referring to it in the singularity command. There was an issue with our firewall so we downloaded it from a http rather than https link and we also had to download an adult MNI template separately, as this was used later down the line as a bold reference image:

import templateflow.api
templateflow.api.TF_S3_ROOT = ‘http://templateflow.s3.amazonaws.com
get(‘MNI152NLin2009cAsym’)

Then we were able to run this in our Jupyter Notebook as:

import os
my_env = os.environ.copy()
my_env[“SINGULARITYENV_TEMPLATEFLOW_HOME”] = “/templateflow”

for n in range(1):
p = subprocess.run(" ".join([“singularity”, “exec”, “-C”,
“-B”, “/imaging/jj02/CALM:/CALM”,
“-B”, “/imaging/projects/cbu/calm/CALM_BIDS_New:/CALM_BIDS_New”,
“-B”, “/home/jj02/.cache/templateflow:/templateflow”,
“/imaging/local/software/singularity_images/fmriprep/fmriprep-1.4.1rc4.simg”,
“fmriprep”,
“/CALM_BIDS_New”,
“/CALM_BIDS_New/derivatives/fmriprep_child_test6”,
“participant”, “–participant_label”, ‘%03d’ %(n+1),
“-v”, “-w”, “/CALM_BIDS_New/derivatives/fmriprepwork_child_test6”,
“–skull-strip-template”, “MNIPediatricAsym:cohort-1”,
“–output-spaces”, “MNIPediatricAsym:cohort-1”,
“–fs-no-reconall”,
“–fs-license-file”, “/CALM/license.txt”,
“–notrack”]),
shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=my_env)
print(p.args)
print(p.stdout.decode())
print(p.stderr.decode())

1 Like