Hi Michael,

Thanks for your help and suggestions!

I'd have to try to recreate the error, but I have an idea of what it could be (assuming /home/control/marhoo/Projects/BIG/Freesurfer_CorticalThickness/BIG1026_1 is a directory).
Actually not yet, /home/control/marhoo/Projects/BIG/Freesurfer_CorticalThickness is a directory but BIG1026_1 is supposed to be created by recon-all (but wasn't as a consequence of the error).

While you may have read, write, and execute permissions to your colleague's directory, you must make sure that these permissions have been recursively added to the contents of that directory (child directories, child directory files, and directory files).
There are only *.nii.gz files in that directory plus a few extra files and (symbolic links to) folders that I assume should have nothing to do with the error? The content looks like this (ls -al):

drwxrwxr-x  2 marhoo big   352256 Mar  6 09:51 ./
drwxrwx--x 15 marhoo big     4096 Feb 29 15:49 ../
-rw------- 1 marzwi big 12219623 Mar  2 16:06 BIG1026_1.nii.gz
[..]
-rw------- 1 marzwi big 12219623 Mar  2 16:06 BIG4025_1.nii.gz
-rw-rwxr-- 1 marhoo big    75806 Feb 27 10:54 BIG_aseg_stats.log*
lrwxrwxrwx 1 marhoo big       34 Feb 19 09:12 fsaverage -> /opt/freesurfer/subjects/fsaverage/
lrwxrwxrwx 1 marhoo big       38 Feb 19 09:12 lh.EC_average -> /opt/freesurfer/subjects/lh.EC_average/
lrwxrwxrwx 1 marhoo big       38 Feb 19 09:12 rh.EC_average -> /opt/freesurfer/subjects/rh.EC_average/
-rw-rwxr-- 1 marhoo big    18200 Sep 27 10:39 v5.0.txt*
-rw-rwxr-- 1 marhoo big     3220 Sep 27 10:39 v5.1.txt*
-rw-rwxrw-  1 marhoo big      523 Feb 24 10:07 .xdebug_tkmedit*

I believe that your problem is that the file BIG1026_1.nii.gz (however, from my experience this file should not simply be in the BIG1026_1 folder but in the orig directory of the mri folder) has not inherited the specified permissions from its parent directory.
My username is marzwi, I am member of the big group and I have rw permissions of all the files and directories (see listing above).

If this does not correct the error, set the environmental SUBJECTS_DIR variable to the directory housing the subject directories (making sure that your colleague gives you sufficient access to this directory), lose the -sd path in the command, and make sure that you have read, write, execute permissions recursively added to the directories and files that you will be working with.
I did that but the error message remains. Here's the full message, started from a newly opened bash terminal:

-------- freesurfer-Linux-centos4_x86_64-stable-pub-v5.1.0 --------
Setting up environment for FreeSurfer/FS-FAST (and FSL)
FREESURFER_HOME   /opt/freesurfer
FSFAST_HOME       /opt/freesurfer/fsfast
FSF_OUTPUT_FORMAT nii.gz
SUBJECTS_DIR      /opt/freesurfer/subjects
MNI_DIR           /opt/freesurfer/mni
FSL_DIR           /opt/fsl
mentat002:$ export SUBJECTS_DIR=/home/mrphys/marzwi/BIG/Freesurfer_CorticalThickness
mentat002:$ recon-all -subject BIG1026_1 -i BIG1026_1.nii.gz -autorecon1
/bin/pwd: cannot open directory `../..': Permission denied
mkdir: cannot create directory `/BIG1026_1': Permission denied
mkdir: cannot create directory `/BIG1026_1': Permission denied
cp: cannot create regular file `/BIG1026_1/scripts/build-stamp.txt': No such file or directory
cat: /BIG1026_1/scripts/build-stamp.txt: No such file or directory
INFO: FreeSurfer build stamps do not match
Subject Stamp:
Current Stamp: freesurfer-Linux-centos4_x86_64-stable-pub-v5.1.0
INFO: SUBJECTS_DIR is
Actual FREESURFER_HOME /opt/freesurfer-v5.1
/BIG1026_1: No such file or directory.

Another option would be if your colleague set up a "subjects directory" within his parent directory and add each subject's folder to this directory and then setting this as your SUBJECTS_DIR variable (ensuring you have read, write, execute permissions).
I created a subfolder, copied the BIG1026_1.nii.gz file into it and ran recon-all using this subfolder as SUBJECTS_DIR but I kept getting permission denied errors.

I hope this helps; however, not knowing the version of free surfer that you are running nor the operating system makes it difficult to troubleshoot your problem. Let me know if you arrive at a solution or require further assistance.

Thanks,

Michael Nowak

I hope the info above can help troubleshooting my problem. Thanks a lot Michael!

Cheers,
Marcel


On Mon, Mar 5, 2012 at 9:55 PM, Marcel Zwiers <m.zwiers@fcdonders.ru.nl> wrote:
> Hi,
>
> I am new to FS and have encountered a weird problem that I do not know how to solve and did not find any earlier
> postings on. When I run recon-all on a file in my own home directory everything works normally:
>
> recon-all -subject BIG1026_1 -sd /home/mrphys/marzwi/test -i BIG1026_1.nii.gz
> -autorecon1
> [..]

>
> However, if I run the same command on the same file, except that this file is now located in a directory of a
> colleague of mine that I certainly have full access to (+r+w+x), I immediately get a 'permission denied' error:

> recon-all -subject BIG1026_1 -sd /home/control/marhoo/Projects
> /BIG/Freesurfer_CorticalThickness -i BIG1026_1.nii.gz -autorecon1

> pwd: cannot open directory `../..': Permission denied
> /bin/pwd: cannot open directory `../..': Permission denied
> mkdir: cannot create directory `/BIG1026_1': Permission denied
> [..]
>
> From the error message it seems to me as if FS is trying to access the parent directory (of which I do not have
> full rights but only -r-w+x)? As this does not make a lot of sense to me I suspect there must be another cause
> and hope you have any ideas here.
>
> Cheers,
> Marcel


--

Marcel Zwiers          www.ru.nl/donders
MR techniques        +31-(0)24-3668495

Donders Institute for Brain, Cognition and Behaviour
Centre for Cognitive Neuroimaging
Radboud University Nijmegen, The Netherlands