I use glob.glob to find the full name of my nifti file.
from nipype.interfaces.fsl import utils
reorient = utils.Reorient2Std()
reorient.inputs.in_file = glob.glob(*2021*.nii.gz)
I get this error:
TraitError: The ‘in_file’ trait of a Reorient2StdInputSpec instance must be a pathlike object or string representing an existing file, but a value of “[<MY_FILE_NAME.nii.gz>]” <class ‘str’> was specified.
When I set reorient.inputs.in_file to the file full name, it does work.
How should I replace glob.glob?