Afni autoTLRC FileNotFoundError

Hello everyone, I’m a Bio-Informatics student from The Netherlands and for a school project I’m using the Nipype afni interface. I’m trying to perform normalization on structural coregistrated images using the autoTLRC function in nipype based on the @auto_tlrc from Afni. Now I’m running into an error while running it, I’m very new to the neurology preprocessing field.

The error is the following:
‘/Users/erichoekstra/PycharmProjects/brainnetworks_eric_linda/structural_flirt+tlrc.HEAD’ <class ‘str’> was specified

It’s a FileNotFoundError, this file is indeed not in the folder stated above, but why is this not the case? Shouldn’t it be made by Afni?

My code in Python:

autoTLRC = afni.AutoTLRC()
    autoTLRC.inputs.in_file = 'structural_flirt.nii.gz'
    autoTLRC.inputs.no_ss = True
    autoTLRC.inputs.base = "MNI_avg152T1+tlrc"
    '@auto_tlrc -base TT_N27+tlrc -input structural.nii -no_ss'
    res =

Thank you in advance!

I’m no expert in Nipype, but this line looks wrong - given your input line

autoTLRC.inputs.in_file = ‘structural_flirt.nii.gz’

That doesn’t match the structural.nii that’s the input in your command.

That is true, but when I change that the same error occures.

The output of the function I’m running should be:
out_file (a pathlike object or string representing an existing file) – Output file.

And the full error states:
traits.trait_errors.TraitError: The ‘out_file’ trait of an AFNICommandOutputSpec instance must be a pathlike object or string representing an existing file, but a value of ‘/Users/erichoekstra/PycharmProjects/brainnetworks_eric_linda/structural_flirt+tlrc.HEAD’ <class ‘str’> was specified.

So it seems like he’s trying to open the out_file (structural_flirt+tlrc.HEAD) but it doesn’t exist. So it’s somehow now made.