Category: Image Processing

  • Matlab and Freesurfer

    Some functions of Freesurfer 5.3.0 (like computing the local Gyrification Index) require integration with Matlab. In order to do this, the following code has to be in matlab’s startup.m file: %———— FreeSurfer —————————–% fshome = getenv(‘FREESURFER_HOME’); fsmatlab = sprintf(‘%s/matlab’,fshome); if (exist(fsmatlab) == 7) path(path,fsmatlab); end clear fshome fsmatlab; %—————————————————–% Also, if you are getting “ERROR: Matlab is…

  • Running FreeSurfer in batch mode

    Here is a quick way to run FS for each MRI image as a Nifti file in a folder. Start by creating a new text file in the terminal (eg vi run.sh). Put in the following code: for file in * do recon-all -i $file -subjid $(cut -d ‘.’ -f 1 <<< $file) recon-all -all -subjid…

  • Printing your brain in 3D

    So I’ve been doing some testing on our newly acquired CubeX 3D printer and had the idea to print a miniature of my brain. Since I served as a control for one study, I had a great T1 scan from a 3T MRI. This scan had allready been processed by FreeSurfer, so all I had…

  • SPM8 custom PET template creation script

    Download script here. If you want to make your own SPM8 custom PET template to do PET normalization (for example with 18F-FDG)  and are looking for a script that does this with one command, today is your lucky day!  After some googling around and reading through different instructions, I decided to write my own batch script.…

  • Instalando e usando o Freesurfer

    Instalação e configuração 1. Download: http://surfer.nmr.mgh.harvard.edu/fswiki/Download 2. Instalação Mac OS: http://surfer.nmr.mgh.harvard.edu/fswiki/MacOsInstall 3. Configuração: 3.1 Abrir terminal e navegar para o home (/Users/<user>) 3.2 Digitar > sudo vi .tcshrc 3.3 Digitar > i para inserir, colar: setenv SUBJECTS_DIR <subjects_directory> setenv FREESURFER_HOME /Applications/freesurfer source $FREESURFER_HOME/SetUpFreeSurfer.csh Onde <subjects_directory> = pasta onde irão todas as imagens/arquivos – uso subjects no meu Desktop…