Hi Afni-users,
I've been making some scripts for my analysis in Matlab. Some of the steps involve sourcing AFNI commands to the system. I've been running into troubles with the 3dUndump command.
---
%Sample code (first built a string and then send that command to the system):
%seed_dir and seed_name are variables that I assign earlier in the script
cmd = ['source ~/.bashrc; echo -45 -67 36 | 3dUndump -prefix ' seed_dir seed_name '.nii.gz -master /Users/Shared/fsl_410/data/standard/MNI152_T1_2mm_brain.nii.gz -srad 5 -orient LPI -xyz -'];
system(cmd);
---
However, this produces a ROI that is not in the right location. Just copying this command to the terminal and executing it there DOES produce the correct result! I checked that the command is built correctly and the numbers are not changed by matlab.
Is this a known problem? I do not understand how this can happen as all matlab does is send a string to the system to execute, it should not influence its execution at all...
Thanks,
Maarten