nipy / nipype

Workflows and interfaces for neuroimaging packages
https://nipype.readthedocs.org/en/latest/
Other
746 stars 530 forks source link

spm.Coregister() deletes output after computation #2049

Closed gladomat closed 7 years ago

gladomat commented 7 years ago

Summary

When I run spm.Coregister() on a T1w image using a Node() I can see the file being computed in the tmp directory but as soon as it finishes the output is erased. This, however, doesn't happen when I do it with my functional data in a MapNode Interface

Actual behavior

File gets deleted after computation.

Expected behavior

File shouldn't be deleted, instead it should be sent to the DataSink.

How to replicate the behavior

Try coregistering a single image with a Node.

Script/Workflow details

coregister_struc = Node(Coregister(), overwrite=True, name="coregister_struc") preproc_frequency_localizer.connect([ (datasource, coregister_struc, [('struc', 'source')]) ])

Platform details:

Python 2.7 nipype 0.12.1

Execution environment

ipython with python 2.7

Choose one

satra commented 7 years ago

@gladomat - you can set coregister_struc.config['execution']['remove_unnecessary_outputs'] = False (see the config for all options)

mgxd commented 7 years ago

@gladomat did that fix your issue?

gladomat commented 7 years ago

It apparently has fixed the issue. Thanks!

gladomat commented 7 years ago

I looked into it in more detail and came to realize that the issue isn't fixed. The output 'coregistered_files' is left empty. Here's what it looks like:

Node: coregister_struc (spm)
============================

 Hierarchy : preprocFrequencyLoc.coregister_struc
 Exec ID : coregister_struc.a0

Original Inputs
---------------

* apply_to_files : <undefined>
* cost_function : <undefined>
* fwhm : <undefined>
* ignore_exception : False
* jobtype : estimate
* matlab_cmd : <undefined>
* mfile : True
* out_prefix : r
* paths : <undefined>
* separation : <undefined>
* source : ['/data/p_nmc002/TDMGB_FMRI/sub-05/ses-localizer/anat/sub-05_acq-T1w.nii']
* target : /data/pt_nmc002/TDMGB_FMRI_Frequency_Localizer/tmp/preprocFrequencyLoc/_subject_id_sub-05/RealignUnwarp/mapflow/_RealignUnwarp0/meanusub-05_task-localizer_run-01_bold.nii
* tolerance : <undefined>
* use_mcr : <undefined>
* use_v8struct : True
* write_interp : <undefined>
* write_mask : <undefined>
* write_wrap : <undefined>

Execution Inputs
----------------

* apply_to_files : <undefined>
* cost_function : <undefined>
* fwhm : <undefined>
* ignore_exception : False
* jobtype : estimate
* matlab_cmd : <undefined>
* mfile : True
* out_prefix : r
* paths : <undefined>
* separation : <undefined>
* source : ['/data/pt_nmc002/TDMGB_FMRI_Frequency_Localizer/tmp/preprocFrequencyLoc/_subject_id_sub-05/coregister_struc/sub-05_acq-T1w.nii']
* target : /data/pt_nmc002/TDMGB_FMRI_Frequency_Localizer/tmp/preprocFrequencyLoc/_subject_id_sub-05/coregister_struc/meanusub-05_task-localizer_run-01_bold.nii
* tolerance : <undefined>
* use_mcr : <undefined>
* use_v8struct : True
* write_interp : <undefined>
* write_mask : <undefined>
* write_wrap : <undefined>

Execution Outputs
-----------------

* coregistered_files : <undefined>
* coregistered_source : /data/pt_nmc002/TDMGB_FMRI_Frequency_Localizer/tmp/preprocFrequencyLoc/_subject_id_sub-05/coregister_struc/sub-05_acq-T1w.nii

Runtime info
------------

* duration : 60.22063
* hostname : marillion.cbs.mpg.de

Terminal output
~~~~~~~~~~~~~~~

Environment
~~~~~~~~~~~

* ANTSPATH : /afs/cbs.mpg.de/software/ants/2.1.0-rc3/ubuntu-xenial-amd64/antsbin/bin
* DISPLAY : localhost:11.0
* DYLD_FALLBACK_LIBRARY_PATH : 
* ENVLIST : fsl=5.0.9:afni=17.0.04n:ants=2.1.0-rc3
* FB_COLORIZE : 0
* FSLBROWSER : /etc/alternatives/x-www-browser
* FSLDIR : /afs/cbs.mpg.de/software/fsl/5.0.9/ubuntu-xenial-amd64/share
* FSLLOCKDIR : 
* FSLMACHINELIST : 
* FSLOUTPUTTYPE : NIFTI_GZ
* FSLREMOTECALL : 
* FSLTCLSH : /usr/bin/tclsh
* FSLWISH : /usr/bin/wish
* HISTCONTROL : ignoreboth
* HISTSIZE : 50000
* HOME : /home/raid2/mihai
* KRB5CCNAME : FILE:/tmp/krb5cc_12560_xoCw
* LANG : en_US.UTF-8
* LC_ALL : en_US.UTF-8
* LD_LIBRARY_PATH : /afs/cbs.mpg.de/software/lib/zlib1g/ubuntu-xenial-amd64:/afs/cbs.mpg.de/software/fsl/5.0.9/ubuntu-xenial-amd64/bin::/afs/cbs.mpg.de/software/afni/_libfix/ubuntu-xenial-amd64
* LOCALPROFILE : cbs-fb
* LOGNAME : mihai
* MAIL : /var/mail/mihai
* MANPAGER : /usr/bin/less
* MOZ_PLUGIN_PATH : /afs/cbs.mpg.de/service/browserplugins/ubuntu-xenial-amd64
* OMP_NUM_THREADS : 1
* PAGER : /usr/bin/less
* PATH : /afs/cbs.mpg.de/software/fsl/currentversion.ubuntu-xenial-amd64/ubuntu-xenial-amd64/bin:/afs/cbs.mpg.de/software/ants/2.1.0-rc3/ubuntu-xenial-amd64/antsbin/bin:/afs/cbs.mpg.de/software/afni/17.0.04/ubuntu-xenial-amd64:/afs/cbs.mpg.de/software/fsl/5.0.9/ubuntu-xenial-amd64/bin:/nobackup/alster2/Glad/anaconda2_serverwide/bin:/afs/cbs.mpg.de/software/fsl/currentversion.ubuntu-xenial-amd64/ubuntu-xenial-amd64/bin:/afs/cbs.mpg.de/software/fsl/currentversion.ubuntu-xenial-amd64/ubuntu-xenial-amd64/bin:/bin:/sbin:/opt/bin:/usr/bin:/usr/sbin:/afs/cbs.mpg.de/software/scripts:/afs/cbs.mpg.de/software/scripts/science:/afs/cbs.mpg.de/software/bin/linux:/usr/games:/home/raid2/mihai/Software/doublecmd/:/home/raid2/mihai/Software/pycharm-community-2016.1.2/bin/:~/Software/scripts/:/home/raid2/mihai/Software/doublecmd/:/home/raid2/mihai/Software/pycharm-community-2016.1.2/bin/:~/Software/scripts/:/home/raid2/mihai/Software/doublecmd/:/home/raid2/mihai/Software/pycharm-community-2016.1.2/bin/:~/Software/scripts/
* PERL5LIB : /afs/cbs.mpg.de/software/perllib
* POSSUMDIR : /afs/cbs.mpg.de/software/fsl/5.0.9/ubuntu-xenial-amd64/share
* PS1 : ants=2.1.0-rc3_\u@\h:\w > 
* PWD : /nobackup/alster2/Glad/Projects/Top-down_mod_MGB/Experiments/TdMGB_fMRI/DATA/code/analysis_pipeline_nypipe
* SHELL : /bin/bash
* SHINTERACTIVE : 1
* SHLVL : 4
* SHTERM : 1
* SLCLUSTER_MAILOPTS : n
* SSH_CLIENT : 10.0.65.235 3574 22
* SSH_CONNECTION : 10.0.65.235 3574 10.0.67.44 22
* SSH_TTY : /dev/pts/1
* STY : 2135485.pts-1.marillion
* TERM : screen
* TERMCAP : SC|screen|VT 100/ANSI X3.64 virtual terminal:\
    :DO=\E[%dB:LE=\E[%dD:RI=\E[%dC:UP=\E[%dA:bs:bt=\E[Z:\
    :cd=\E[J:ce=\E[K:cl=\E[H\E[J:cm=\E[%i%d;%dH:ct=\E[3g:\
    :do=^J:nd=\E[C:pt:rc=\E8:rs=\Ec:sc=\E7:st=\EH:up=\EM:\
    :le=^H:bl=^G:cr=^M:it#8:ho=\E[H:nw=\EE:ta=^I:is=\E)0:\
    :li#86:co#143:am:xn:xv:LP:sr=\EM:al=\E[L:AL=\E[%dL:\
    :cs=\E[%i%d;%dr:dl=\E[M:DL=\E[%dM:dc=\E[P:DC=\E[%dP:\
    :im=\E[4h:ei=\E[4l:mi:IC=\E[%d@:ks=\E[?1h\E=:\
    :ke=\E[?1l\E>:vi=\E[?25l:ve=\E[34h\E[?25h:vs=\E[34l:\
    :ti=\E[?1049h:te=\E[?1049l:us=\E[4m:ue=\E[24m:so=\E[3m:\
    :se=\E[23m:mb=\E[5m:md=\E[1m:mh=\E[2m:mr=\E[7m:\
    :me=\E[m:ms:\
    :Co#8:pa#64:AF=\E[3%dm:AB=\E[4%dm:op=\E[39;49m:AX:\
    :vb=\Eg:G0:as=\E(0:ae=\E(B:\
    :ac=\140\140aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~..--++,,hhII00:\
    :po=\E[5i:pf=\E[4i:Km=\E[M:k0=\E[10~:k1=\EOP:k2=\EOQ:\
    :k3=\EOR:k4=\EOS:k5=\E[15~:k6=\E[17~:k7=\E[18~:\
    :k8=\E[19~:k9=\E[20~:k;=\E[21~:F1=\E[23~:F2=\E[24~:\
    :F3=\E[1;2P:F4=\E[1;2Q:F5=\E[1;2R:F6=\E[1;2S:\
    :F7=\E[15;2~:F8=\E[17;2~:F9=\E[18;2~:FA=\E[19;2~:kb=:\
    :K2=\EOE:kB=\E[Z:kF=\E[1;2B:kR=\E[1;2A:*4=\E[3;2~:\
    :*7=\E[1;2F:#2=\E[1;2H:#3=\E[2;2~:#4=\E[1;2D:%c=\E[6;2~:\
    :%e=\E[5;2~:%i=\E[1;2C:kh=\E[1~:@1=\E[1~:kH=\E[4~:\
    :@7=\E[4~:kN=\E[6~:kP=\E[5~:kI=\E[2~:kD=\E[3~:ku=\EOA:\
    :kd=\EOB:kr=\EOC:kl=\EOD:km:
* USER : mihai
* WINDOW : 1
* XDG_SESSION_COOKIE : c99354996f68442e9411a0dd1403234c-1495558191.113785-351424406
* _ : /nobackup/alster2/Glad/anaconda2_serverwide/bin/ipython

Edit: Pasted the wrong report.rst file.

gladomat commented 7 years ago

I just realized my mistake. The souce is the file I am looking for and the coregistered_files are the ones that are coregistered when apply_to_files is set. I apologize!

mgxd commented 7 years ago

@gladomat feel free to open this if you still run into issues