Nipype align_epi_anat.py

Hi,

I’m running nipype in a docker container and using AlEpiAnat.py (wraps the AFNI python script align_epi_anat.py)

The program using the nipype interface runs all the way through, and generates all of the output files and intermediary files in the result directory, but then it deletes important output files.

If I run align_epi_anat,py from the command line inside the docker container, it runs correctly.

Expected output files are:

epi_vr_motion
anat_al_orig
epi_al_mat
epi_reg_al_mat
epi_tlrc_al
epi_al_orig
epi_vr_al_mat
anat_al_mat
epi_al_tlrc_mat

The only file that remains at the end is the epi_al_mat file.

I’ve even passed the -keep_rm_files option (to keep all intermediate files) through the Args input parameter, but the files are deleted anyway.

There are no reported errors.

nipype version: 1.1.9
AFNI version: v19.1.00
align_epi_anat,py version: 1.58

The last part of the runtime messages is as follows:

 stdout 2020-04-01T00:32:14.107783:#++ Removing all the temporary files

200401-00:32:14,108 nipype.interface INFO:
stdout 2020-04-01T00:32:14.107783:#Script is running:
200401-00:32:14,108 nipype.interface INFO:
stdout 2020-04-01T00:32:14.107783: \rm -f ./__tt_rest_corrected_copy*
200401-00:32:14,906 nipype.interface INFO:
stdout 2020-04-01T00:32:14.906616:#Script is running:
200401-00:32:14,906 nipype.interface INFO:
stdout 2020-04-01T00:32:14.906616: \rm -f ./__tt_anat*
200401-00:32:15,614 nipype.interface INFO:
stdout 2020-04-01T00:32:15.614905:
200401-00:32:15,615 nipype.interface INFO:
stdout 2020-04-01T00:32:15.614905:# Finished alignment successfully

Any help would be appreciated.

to save space, nipype deletes any outputs not needed by future steps. you can turn this off by using the executable config option delete_unnecessary_files. see this page for details.

Thanks so much, @satra, for the response. I tried both of these options:

alEpiAnat.config={'execution': {'keep_unnecessary_outputs': 'true'}}

and

alEpiAnat.config={'executable': {'delete_unnecessary_files': 'false'}}

but it didn’t work for me. Could it be something else?

I tried the following, and it worked:

from nipype import config

config.set(‘execution’, ‘remove_unnecessary_files’, ‘false’)

Thanks very much for your help.

1 Like