forked from CoBrALab/RABIES
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
61 lines (51 loc) · 3.09 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
### setup RABIES execution and DSURQE atlas
#will install RABIES in HOME directory
export RABIES_VERSION=0.2.1-dev
export RABIES=$HOME/RABIES-${RABIES_VERSION}
export PYTHONPATH="${PYTHONPATH}:$RABIES"
cd $HOME
#curl -L --retry 5 -o $HOME/RABIES.tar.gz https://github.com/CoBrALab/RABIES/archive/${RABIES_VERSION}.tar.gz
#tar zxf $HOME/RABIES.tar.gz
#rm $HOME/RABIES.tar.gz
git clone https://github.com/CoBrALab/RABIES
mv RABIES $RABIES
#creates an executable script to execute rabies
mkdir -p $RABIES/bin
echo -e '#! /usr/bin/env python \nfrom rabies.run_main import execute_workflow \nexecute_workflow()' > $RABIES/bin/rabies
chmod +x $RABIES/bin/rabies
echo "# added by RABIES" >> $HOME/.bashrc
echo "export RABIES_VERSION=0.2.1-dev" >> $HOME/.bashrc
echo "export RABIES=$RABIES" >> $HOME/.bashrc
echo 'export PYTHONPATH="${PYTHONPATH}:$RABIES"' >> $HOME/.bashrc
echo 'export PATH=$PATH:$RABIES/bin' >> $HOME/.bashrc
echo 'export PATH=$PATH:$RABIES/rabies/shell_scripts' >> $HOME/.bashrc
# Download DSURQE template
template_dir=$RABIES/template_files
curl -L --retry 5 -o $template_dir/DSURQE_40micron_average.nii http://repo.mouseimaging.ca/repo/DSURQE_40micron_nifti/DSURQE_40micron_average.nii
curl -L --retry 5 -o $template_dir/DSURQE_40micron_labels.nii http://repo.mouseimaging.ca/repo/DSURQE_40micron_nifti/DSURQE_40micron_labels.nii
#curl -L --retry 5 -o $template_dir/DSURQE_40micron_mask.nii http://repo.mouseimaging.ca/repo/DSURQE_40micron_nifti/DSURQE_40micron_mask.nii
curl -L --retry 5 -o $template_dir/DSURQE_40micron_R_mapping.csv http://repo.mouseimaging.ca/repo/DSURQE_40micron/DSURQE_40micron_R_mapping.csv
# create a 100um version
ResampleImage 3 $template_dir/DSURQE_40micron_average.nii $template_dir/DSURQE_100micron_average.nii 0.1x0.1x0.1 0 4
#antsApplyTransforms -i $template_dir/DSURQE_40micron_mask.nii -o $template_dir/DSURQE_100micron_mask.nii -r $template_dir/DSURQE_100micron_average.nii -n GenericLabel
antsApplyTransforms -i $template_dir/DSURQE_40micron_labels.nii -o $template_dir/DSURQE_100micron_labels.nii -r $template_dir/DSURQE_100micron_average.nii -n GenericLabel
gzip -f $template_dir/*.nii
#convert templates to the RAS axis convention
python $RABIES/convert_to_RAS.py $template_dir/DSURQE_100micron_average.nii.gz
python $RABIES/convert_to_RAS.py $template_dir/DSURQE_100micron_mask.nii.gz
python $RABIES/convert_to_RAS.py $template_dir/DSURQE_100micron_labels.nii.gz
# create regional masks
python $RABIES/gen_masks.py $template_dir/DSURQE_100micron_labels.nii.gz $template_dir/DSURQE_40micron_R_mapping.csv $template_dir/DSURQE_100micron
# install twolevel_ants_dbm
git clone https://github.com/CoBrALab/twolevel_ants_dbm.git $RABIES/twolevel_ants_dbm
cd $RABIES/twolevel_ants_dbm
git checkout 3623b5bf683473887b7d63c1a1b24c0362ed8396
cd $HOME
echo 'export PATH=$RABIES/twolevel_ants_dbm:$PATH' >> $HOME/.bashrc
# install twolevel_ants_dbm
git clone https://github.com/CoBrALab/minc-toolkit-extras.git $RABIES/minc-toolkit-extras
cd $RABIES/minc-toolkit-extras
git checkout 3dec9b81b0e59c7daa90ea1901469111b2374182
echo 'export PATH=$RABIES/minc-toolkit-extras:$PATH' >> $HOME/.bashrc
cd $HOME