====== Info ====== We use the Freesurfer standard recon-all segmentation, running at 1 mm resolution. We give Freesurfer 0.9mm resolution scans though because their quality is slightly better than the 1 mm scans. Bob believes this may have to do with fat artifacts near the skull. ====== Manual running (to obtain 3D models) ====== You need the 0.9mm T1 weighted image, usually run as an anatomy scan during retinotopy sessions. Login to flywheel: cni.flywheel.io to get it. If you know the exam number you can just run mlrReconAll directly. If you don't know the exam, follow the commands below once the file is in your ~/Downloads folder: Copy your file to the CNIC server, login via SSH, and run recon-all (Freesurfer). scp ~/Downloads/T1.nii suid@cnic7.stanford.edu:~/ ssh suid@cnic7.stanford.edu recon-all -i ~/T1.nii -all -subject S000 -sd /data/freesurfer/subjects When finished (~6-8 hours), navigate to the folder: cd /data/freesurfer/subjects/S000/surf mris_convert rh.pial rh.pial.stl mris_convert lh.pial lh.pial.stl Then from your main computer grab those two files: scp suid@cnic7.stanford.edu:/data/freesurfer/subjects/S000/surf/lh.pial.stl ~/Downloads/lh.pial.stl scp suid@cnic7.stanford.edu:/data/freesurfer/subjects/S000/surf/rh.pial.stl ~/Downloads/rh.pial.stl Done! ====== Segmentation ====== Run these and follow the instructions: mlrReconAll
{{:runningfmri:screen_shot_2015-08-10_at_12.05.26_pm.png|}}
You will need to run some code at the end on the CNIC server. If you are an undergrad or on a rotation have a grad student or postdoc put their name in, this saves time communicating with the CNIC server IT people. Make sure the window stays open until FreeSurfer completes (see below for errors) and then grab the results of the segmentation with mlrGetSurf Once you've run mlrGetSurf your surfaces will be pushed to the AnatDB in .../mlrAnatDB/s0025/surfaces/ (first, check that your directories are correct with mlrAnatDBPreferences). Done! ====== Troubleshooting ====== ====Segmentations Don't Complete==== If your SSH window times out and says "Broken pipe", it probably means that your configuration is set to drop out if nothing happens after 30 minutes or so. One way around this is to use XWin/Win Desktop to connect to the LXContainer. Another option is to set your SSH config to not drop off quickly. '' cd ~/.ssh touch config open config '' Add these lines and save the config file, this should prevent an SSH timeout. '' ServerAliveInterval 30 ServerAliveCountMax 10000 '' (As of now there is no option to run the segmentation locally, but this will be added soon) ** -bash: recon-all: command not found ** After ssh'ing to cnic7 server, if the recon-all command does not work it might because you are in csh/tcsh shell on the remote computer and its .cshrc file might not be setup to call freesurfer functions. Switching to bash shell might solve the problem bash Note: This is what you should typically see (10 folders) in /data/freesurfer/subjects/s0025 on the server when the segmentation is done : cd /data/freesurfer/subjects/s0025 ls The folders should contain :
{{:runningfmri:freesurfersegoutput.png|Internal Link}}
{{:runningfmri:freesurferoutput2.png|}}