Skip to content
README.md 1.67 KiB
Newer Older
Michael Krause's avatar
Michael Krause committed
## quick start

### [Freesurfer Reference](http://surfer.nmr.mgh.harvard.edu/fswiki/recon-all)

### What we want to do:

For a list of images with the following format:

Michael Krause's avatar
Michael Krause committed
     PREFIX ### ID_PREFIX ### ID ### TIMEPOINT ### SUFFIX
Michael Krause's avatar
Michael Krause committed

For example: `STUDY_subj208_v1_T1.nii` would map to:

    PREFIX=STUDY_
    ID_PREFIX=subj
    ID=208
    TIMEPOINT=_v1
    SUFFIX=_T1.nii

Michael Krause's avatar
Michael Krause committed
we want to run the following steps:
Michael Krause's avatar
Michael Krause committed

#### 1. Cross-Sectional analysis for each subject
#### if there are multiple timepoints:
#### 2. Create a template from all timepoints
Michael Krause's avatar
Michael Krause committed
#### 3. Longitudinal analysis for each subject against the template
Michael Krause's avatar
Michael Krause committed


Michael Krause's avatar
Michael Krause committed
When everything is done, all you need to do is 

+ copy your nifits into a directory
+ add a fresh copy of main.sh to the folder
+ edit main.sh according to your study layout
+ run main.sh

Michael Krause's avatar
Michael Krause committed

Michael Krause's avatar
Michael Krause committed
### Example

#### 0. check-out repo (if not done already)

Michael Krause's avatar
Michael Krause committed
```bash
Michael Krause's avatar
Michael Krause committed
[krause@node1 ~] mkdir scripts && cd scripts
[krause@node1 ~/scripts] git clone https://git.mpib-berlin.mpg.de/krause/freesurfer-longitudinal-pipeline
```

#### 1. sync repo

```bash
[krause@node1 ~] cd scripts/freesurfer-longitudinal-pipeline/
[krause@node1 ~/scripts/freesurfer-longitudinal-pipeline (master)] git pull
Already up-to-date.
[krause@node1 ~/scripts/freesurfer-longitudinal-pipeline (master)]
```


#### 2. copy and edit `main.sh` for a new study (SUBJECTS, AFFIXES, LIBDIR, ...)
Michael Krause's avatar
Michael Krause committed

```bash
[krause@node1 ~] cd study/
[krause@node1 ~/study] cp ../scripts/freesurfer-longitudinal-pipeline/main.sh .
[krause@node1 ~/study] nano main.sh
```

#### 3. fire up main.sh

```bash
[krause@node1 ~/study] ./main.sh
```

If you get a permission denied error, use `bash main.sh` or set executable bit with `chmod +x main.sh` before starting.