templateflow / python-client

A python client to query TemplateFlow via pyBIDS
https://templateflow.org/python-client/
Apache License 2.0
8 stars 12 forks source link

Usage question: getting brain mask for 'MNI152NLin2009cAsym' #34

Closed arokem closed 4 years ago

arokem commented 4 years ago

I would have expected:

tflow.get('MNI152NLin2009cAsym',  desc='brain_mask') 

to return PosixPath('/Users/arokem/.cache/templateflow/tpl-MNI152NLin2009cAsym/tpl-MNI152NLin2009cAsym_res-02_desc-brain_mask.nii.gz'), but I get an empty list instead. Am I doing this wrong?

mgxd commented 4 years ago

hey @arokem - the get() method is essentially an extension of bids, so you'll have to specify each entity as a unique field in your query. try something like:

tf.get('MNI152NLin2009cAsym', resolution=2, desc='brain', suffix='mask')

arokem commented 4 years ago

Yes! That works. I guess the thing I missed was the fact that mask was the suffix. Excellent - thanks!