<div dir="ltr"><div class="gmail_quote"><div>Hi Beau,</div><div><br></div><div>My intuition is the ANFI version you're using is too old, or the PyMVPA version is too old, or the command pymvpa2-prep-afni-surf hasn't been updated for recent AFNI versions.  It seems the API of the PyMVPA command and that of AFNI is not compatible with each other.</div><div><br></div><div>Best,</div><div>Feilong</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">---------- Forwarded message ----------<br>From: "Beau R. Sievers" <<a href="mailto:Beau.R.Sievers.GR@dartmouth.edu" target="_blank">Beau.R.Sievers.GR@dartmouth.edu</a>><br>To: "<a href="mailto:pkg-exppsy-pymvpa@lists.alioth.debian.org" target="_blank">pkg-exppsy-pymvpa@lists.alioth.debian.org</a>" <<a href="mailto:pkg-exppsy-pymvpa@lists.alioth.debian.org" target="_blank">pkg-exppsy-pymvpa@lists.alioth.debian.org</a>><br>Cc: <br>Date: Mon, 12 Oct 2015 21:57:14 +0000<br>Subject: [pymvpa] Error from pymvpa2-prep-afni-surf<br>Hello, PyMVPA users,<br>
<br>
I am running into an error (two, really) when running pymvpa2-prep-afni-surf to align the surfaces from FreeSurfer’s recon-all to my already-aligned anatomical images. It appears pymvpa2-prep-afni-surf tries to run 3dSurf2Vol with a non-existant option, “-surf” instead of “-surf_1D”, but correcting this apparent bug results in another error: 3dSurf2Vol rejects __tt.1D with a “bad surf data file” error.<br>
<br>
Detail follows, including the errors copied from the output logs:<br>
<br>
Running: makesurfmasks<br>
** Will execute the following commands:<br>
** - cd /flash/wheatley/bouncing_ball_testing/pymvpa_afni_surf_output_kk<br>
** - 1deval -1D: -num 163841 -expr 1 > __t.1D<br>
** - 1dtranspose __t.1D > __tt.1D<br>
**>> Starting now:<br>
**<< ... completed execution<br>
** Will execute the following commands:<br>
** - cd /flash/wheatley/bouncing_ball_testing/pymvpa_afni_surf_output_kk<br>
** - 3dSurf2Vol -map_func mask2 -data_expr "a*2" -spec lh_ico128_al.spec -surf_A smoothwm -sv anat_final_kk_ss+orig -grid_parent anat_final_kk_ss+orig. -prefix __m2_lh -sdata __tt.1D -overwrite<br>
**>> Starting now:<br>
Traceback (most recent call last):<br>
  File "/afs/<a href="http://dbic.dartmouth.edu/usr/local/common/bin/pymvpa2-prep-afni-surf" rel="noreferrer" target="_blank">dbic.dartmouth.edu/usr/local/common/bin/pymvpa2-prep-afni-surf</a>", line 25, in <module><br>
    run_prep_afni_surf(vars(d))<br>
  File "/afs/<a href="http://dbic.dartmouth.edu/usr/pkg/python/python_v2.7/@sys/lib/python2.7/site-packages/mvpa2/support/afni/lib_prep_afni_surf.py" rel="noreferrer" target="_blank">dbic.dartmouth.edu/usr/pkg/python/python_v2.7/@sys/lib/python2.7/site-packages/mvpa2/support/afni/lib_prep_afni_surf.py</a>", line 1208, in run_prep_afni_surf<br>
    run_all(config, environment)<br>
  File "/afs/<a href="http://dbic.dartmouth.edu/usr/pkg/python/python_v2.7/@sys/lib/python2.7/site-packages/mvpa2/support/afni/lib_prep_afni_surf.py" rel="noreferrer" target="_blank">dbic.dartmouth.edu/usr/pkg/python/python_v2.7/@sys/lib/python2.7/site-packages/mvpa2/support/afni/lib_prep_afni_surf.py</a>", line 1116, in run_all<br>
    step2func[step](config, env)<br>
  File "/afs/<a href="http://dbic.dartmouth.edu/usr/pkg/python/python_v2.7/@sys/lib/python2.7/site-packages/mvpa2/support/afni/lib_prep_afni_surf.py" rel="noreferrer" target="_blank">dbic.dartmouth.edu/usr/pkg/python/python_v2.7/@sys/lib/python2.7/site-packages/mvpa2/support/afni/lib_prep_afni_surf.py</a>", line 964, in run_makesurfmasks<br>
    utils.run_cmds('cd %s;%s' % (refdir, cmd))<br>
  File "/afs/<a href="http://dbic.dartmouth.edu/usr/pkg/python/python_v2.7/@sys/lib/python2.7/site-packages/mvpa2/support/afni/afni_utils.py" rel="noreferrer" target="_blank">dbic.dartmouth.edu/usr/pkg/python/python_v2.7/@sys/lib/python2.7/site-packages/mvpa2/support/afni/afni_utils.py</a>", line 116, in run_cmds<br>
    subprocess.check_call(cmd, env=env, shell=True)<br>
  File "/afs/<a href="http://dbic.dartmouth.edu/usr/pkg/python/python_v2.7/@sys/lib/python2.7/subprocess.py" rel="noreferrer" target="_blank">dbic.dartmouth.edu/usr/pkg/python/python_v2.7/@sys/lib/python2.7/subprocess.py</a>", line 540, in check_call<br>
    raise CalledProcessError(retcode, cmd)<br>
subprocess.CalledProcessError: Command 'cd /flash/wheatley/bouncing_ball_testing/pymvpa_afni_surf_output_kk;3dSurf2Vol -map_func mask2 -data_expr "a*2" -spec lh_ico128_al.spec -surf_A smoothwm -sv anat_final_kk_ss+orig -grid_parent anat_final_kk_ss+orig. -prefix __m2_lh -sdata __tt.1D -overwrite' returned non-zero exit status 255<br>
<br>
<br>
Running the 3dSurf2Vol command to determine the reason for failure gives this exit message error:<br>
<br>
> 3dSurf2Vol -map_func mask2 -data_expr "a*2" -spec lh_ico128_al.spec -surf_A smoothwm -sv anat_final_kk_ss+orig -grid_parent anat_final_kk_ss+orig. -prefix __m2_lh -sdata __tt.1D -overwrite<br>
invalid option <-sdata><br>
  usage: 3dSurf2Vol [options] -spec SPEC_FILE -surf_A SURF_NAME \<br>
             -grid_parent AFNI_DSET -sv SURF_VOL \<br>
             -map_func MAP_FUNC -prefix OUTPUT_DSET<br>
usage: 3dSurf2Vol -help<br>
<br>
<br>
I created a new version of the pymvpa2-prep-afni-surf script that corrects this error, by changing “-sdata” to “-sdata_1D", but running this resulted in another set of errors:<br>
<br>
Running: makesurfmasks<br>
** Will execute the following commands:<br>
** - cd /flash/wheatley/bouncing_ball_testing/pymvpa_afni_surf_output_kk<br>
** - 1deval -1D: -num 163841 -expr 1 > __t.1D<br>
** - 1dtranspose __t.1D > __tt.1D<br>
**>> Starting now:<br>
**<< ... completed execution<br>
** Will execute the following commands:<br>
** - cd /flash/wheatley/bouncing_ball_testing/pymvpa_afni_surf_output_kk<br>
** - 3dSurf2Vol -map_func mask2 -data_expr "a*2" -spec lh_ico128_al.spec -surf_A smoothwm -sv anat_final_kk_ss+orig -grid_parent anat_final_kk_ss+orig. -prefix __m2_lh -sdata_1D __tt.1D -overwrite<br>
**>> Starting now:<br>
Traceback (most recent call last):<br>
  File "/afs/<a href="http://dbic.dartmouth.edu/usr/wheatley/beau/bouncing_ball_pipeline/pymvpa2-prep-afni-surf-fixed" rel="noreferrer" target="_blank">dbic.dartmouth.edu/usr/wheatley/beau/bouncing_ball_pipeline/pymvpa2-prep-afni-surf-fixed</a>", line 25, in <module><br>
    run_prep_afni_surf(vars(d))<br>
  File "/afs/<a href="http://dbic.dartmouth.edu/usr/wheatley/beau/bouncing_ball_pipeline/lib_prep_afni_surf_fixed.py" rel="noreferrer" target="_blank">dbic.dartmouth.edu/usr/wheatley/beau/bouncing_ball_pipeline/lib_prep_afni_surf_fixed.py</a>", line 1186, in run_prep_afni_surf<br>
    run_all(config, environment)<br>
  File "/afs/<a href="http://dbic.dartmouth.edu/usr/wheatley/beau/bouncing_ball_pipeline/lib_prep_afni_surf_fixed.py" rel="noreferrer" target="_blank">dbic.dartmouth.edu/usr/wheatley/beau/bouncing_ball_pipeline/lib_prep_afni_surf_fixed.py</a>", line 1097, in run_all<br>
    step2func[step](config, env)<br>
  File "/afs/<a href="http://dbic.dartmouth.edu/usr/wheatley/beau/bouncing_ball_pipeline/lib_prep_afni_surf_fixed.py" rel="noreferrer" target="_blank">dbic.dartmouth.edu/usr/wheatley/beau/bouncing_ball_pipeline/lib_prep_afni_surf_fixed.py</a>", line 945, in run_makesurfmasks<br>
    utils.run_cmds('cd %s;%s' % (refdir, cmd))<br>
  File "/afs/<a href="http://dbic.dartmouth.edu/usr/pkg/python/python_v2.7/@sys/lib/python2.7/site-packages/mvpa2/support/afni/afni_utils.py" rel="noreferrer" target="_blank">dbic.dartmouth.edu/usr/pkg/python/python_v2.7/@sys/lib/python2.7/site-packages/mvpa2/support/afni/afni_utils.py</a>", line 116, in run_cmds<br>
    subprocess.check_call(cmd, env=env, shell=True)<br>
  File "/afs/<a href="http://dbic.dartmouth.edu/usr/pkg/python/python_v2.7/@sys/lib/python2.7/subprocess.py" rel="noreferrer" target="_blank">dbic.dartmouth.edu/usr/pkg/python/python_v2.7/@sys/lib/python2.7/subprocess.py</a>", line 540, in check_call<br>
    raise CalledProcessError(retcode, cmd)<br>
subprocess.CalledProcessError: Command 'cd /flash/wheatley/bouncing_ball_testing/pymvpa_afni_surf_output_kk;3dSurf2Vol -map_func mask2 -data_expr "a*2" -spec lh_ico128_al.spec -surf_A smoothwm -sv anat_final_kk_ss+orig -grid_parent anat_final_kk_ss+orig. -prefix __m2_lh -sdata_1D __tt.1D -overwrite' returned non-zero exit status 253<br>
<br>
<br>
Now running the 3dSurf2Vol command manually to determine the problem gives this exit message:<br>
<br>
> 3dSurf2Vol -map_func mask2 -data_expr "a*2" -spec lh_ico128_al.spec -surf_A smoothwm -sv anat_final_kk_ss+orig -grid_parent anat_final_kk_ss+orig. -prefix __m2_lh -sdata_1D __tt.1D -overwrite<br>
** bad (163842 x 1) surf data 1D file '__tt.1D'<br>
<br>
<br>
And now I’m in over my head. Any ideas about what the underlying issue might be?<br>
<br>
Thanks!<br>
Beau Sievers<br>
<br>
_______________________________________________<br>
Pkg-ExpPsy-PyMVPA mailing list<br>
<a href="mailto:Pkg-ExpPsy-PyMVPA@lists.alioth.debian.org" target="_blank">Pkg-ExpPsy-PyMVPA@lists.alioth.debian.org</a><br>
<a href="http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-exppsy-pymvpa" rel="noreferrer" target="_blank">http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-exppsy-pymvpa</a></blockquote></div></div>