From 88ae67a879d8fc417f5168627437a6fd47b36f92 Mon Sep 17 00:00:00 2001 From: regisoc Date: Thu, 30 May 2024 18:47:24 -0400 Subject: [PATCH 1/4] readme update + env unix update --- README.md | 163 +++++++++++++++++++++++++++++++---------------- environment_unix | 18 ++++++ 2 files changed, 126 insertions(+), 55 deletions(-) create mode 100644 environment_unix diff --git a/README.md b/README.md index 84a1256f4..06f72fe4d 100644 --- a/README.md +++ b/README.md @@ -6,11 +6,12 @@ For documentation and detailed setup information, please see the [LORIS-MRI docu This repo can be installed on the same VM as the main LORIS codebase, or on a different machine such as a designated fileserver where large imaging filesets are to be stored. # System Requirements - * Perl - * Python 3 with pip3 and virtualenv (step 2 below) - * MINC toolkit (step 3 below) - * DICOM toolkit (step 4 below) - * tpcclib (for HRRT PET only) (step 5 below) + +* Perl +* Python 3 with pip3 and virtualenv (step 2 below) +* MINC toolkit (step 3 below) +* DICOM toolkit (step 4 below) +* tpcclib (for HRRT PET only) (step 5 below) On Ubuntu, DICOM toolkit will be installed by the imaging install script (step 4 below). This script will _apt-get install dcmtk_. @@ -19,17 +20,39 @@ For CentOS: The [LORIS wiki](https://github.com/aces/Loris/wiki/Imaging-D The following installation should be run by the `$lorisadmin` user. `sudo` permission is required. See [aces/Loris](https://github.com/aces/loris) README.md for further information. +# Dependencies + +## General + +```bash +# ubuntu build essential packages useful for building +sudo apt install build-essential checkinstall cmake +``` + +## Perl CPAN + +Update Perl dependency with: + +```bash +sudo perl -MCPAN -e shell + +# then enter these two commands + +cpan[1]> install CPAN +cpan[2]> reload cpan +``` + # Installation #### 1. Create directories and download Loris-MRI code - ```bash - sudo mkdir -p /data/$projectname - sudo mkdir -p /opt/$projectname/bin/mri - sudo chown -R lorisadmin:lorisadmin /data/$projectname - sudo chown -R lorisadmin:lorisadmin /opt/$projectname - cd /opt/$projectname/bin - ``` +```bash +sudo mkdir -p /data/$projectname +sudo mkdir -p /opt/$projectname/bin/mri +sudo chown -R lorisadmin:lorisadmin /data/$projectname +sudo chown -R lorisadmin:lorisadmin /opt/$projectname +cd /opt/$projectname/bin +``` Get the code: Download the latest release from the [releases page](https://github.com/aces/Loris-MRI/releases) @@ -47,65 +70,95 @@ sudo apt install virtualenv #### 3. Install MINC toolkit from http://bic-mni.github.io/ -Download the pre-compiled package for your operating system. Install required dependencies such as _imagemagick_. Then install your MINC toolkit package: +- Install MINC dependencies: - ```bash - sudo dpkg -i minc-toolkit.deb - ``` +```bash +# deps +sudo apt-get install libc6 libstdc++6 imagemagick perl + +# Install required dependencies such as _imagemagick_. +sudo apt-get install libgl1-mesa-glx libglu1-mesa +``` - Then source the MINC toolkit environment by running (for bash) - `source $mincToolsDirectory/minc-toolkit-config.sh` or (tcsh) - `source $mincToolsDirectory/minc-toolkit-config.csh`, +- Download the MINC pre-compiled package for your operating system from http://bic-mni.github.io/. - where `$mincToolsDirectory` is the path where the MINC toolkit is installed (e.g. `/opt/minc/` OR `/opt/minc/$mincToolsVersion/` for more recent installs) +- Then install your MINC toolkit package: -For the defacing scripts, you will also need to download the pre-compiled `bic-mni-models` and `beast` data and model packages for you operation system. +```bash +# main minc lib +sudo dpkg -i minc-toolkit-.deb +``` - ```bash - sudo dpkg -i bic-mni-models-.deb - sudo dpkg -i beast-library-.deb - ``` +- Check the model is installed in `/opt/minc/share` + +- Then source the MINC toolkit environment, where `$mincToolsDirectory` is the path where the MINC toolkit is installed (e.g. `/opt/minc/` OR `/opt/minc/$mincToolsVersion/` for more recent installs) + +```bash +# bash +source $mincToolsDirectory/minc-toolkit-config.sh + +# tcsh +source $mincToolsDirectory/minc-toolkit-config.csh +``` + +- For the defacing scripts, you will also need to download the pre-compiled `bic-mni-models` and `beast` data and model packages for you operation system. + +```bash +sudo dpkg -i bic-mni-models-.deb +sudo dpkg -i beast-library-.deb + +# also check they are installed in `/opt/minc/share` +``` #### 4. Run installer to set up directories, configure environment, install Perl libraries and DICOM toolkit: - ```bash - cd /opt/$projectname/bin/mri/ - bash ./imaging_install.sh - ``` - - You will be asked for the following input: - - * What is the database name? $dbname - * What is the database host? $dbhost - * What is the MySQL user? $lorisuser [Use the same mysql user from the Loris installation, i.e. _lorisuser_] - * What is the MySQL password? - * What is the Linux user which the installation will be based on? $lorisadmin - * What is the project name? $projectname - * What is your email address? - * What prod file name would you like to use? default: prod [leave blank] - - If the imaging install script reports errors in creating directories - (due to `/data/` mount permissions), review and manually execute - `mkdir/chmod/chown` commands starting at - [imaging_install.sh:L97](https://github.com/aces/Loris-MRI/blob/main/imaging_install.sh#L97) - - Note: The installer will allow Apache to write to the `/data/` and `/opt/` directories by - adding user `lorisadmin` to the Apache linux group. To ensure this change takes - effect, log out and log back into your terminal session before running the - imaging pipeline. The installer will also set Apache group ownership of certain - `/data/` and `/opt/` subdirectories. +```bash +cd /opt/$projectname/bin/mri/ +bash ./imaging_install.sh +``` + +You will be asked for the following input: + +* What is the database name? $dbname +* What is the database host? $dbhost +* What is the MySQL user? $lorisuser [Use the same mysql user from the Loris installation, i.e. _lorisuser_] +* What is the MySQL password? +* What is the Linux user which the installation will be based on? $lorisadmin +* What is the project name? $projectname +* What is your email address? +* What prod file name would you like to use? default: prod [leave blank] + +If the imaging install script reports errors in creating directories +(due to `/data/` mount permissions), review and manually execute +`mkdir/chmod/chown` commands starting at +[imaging_install.sh:L97](https://github.com/aces/Loris-MRI/blob/main/imaging_install.sh#L97) + +Note: The installer will allow Apache to write to the `/data/` and `/opt/` directories by +adding user `lorisadmin` to the Apache linux group. To ensure this change takes +effect, log out and log back into your terminal session before running the +imaging pipeline. The installer will also set Apache group ownership of certain +`/data/` and `/opt/` subdirectories. #### 5. HRRT PET -For HRRT PET, install [tpcclib](http://www.turkupetcentre.net/tpcclib-doc/md_install.html). +For HRRT PET: +- install [tpcclib](http://www.turkupetcentre.net/tpcclib-doc/md_install.html). +- follow the [install instructions](http://www.turkupetcentre.net/petanalysis/sw_install.html#linux). +- downloads are available: [source code](https://gitlab.utu.fi/vesoik/tpcclib/-/releases) or [binaries](https://seafile.utu.fi/d/15843078fb/). + #### 6. Configure paths and environment - Ensure that `/home/lorisadmin/.bashrc` includes the statement: +Ensure that `/home/lorisadmin/.bashrc` includes the statement: + +```bash +source /opt/$projectname/bin/mri/environment +# or +source /opt/$projectname/bin/mri/environment_unix +``` - ```source /opt/$projectname/bin/mri/environment``` +Then source the `.bashrc` file. - Then source the `.bashrc` file. **INSTALLATION COMPLETE!** diff --git a/environment_unix b/environment_unix new file mode 100644 index 000000000..d020ac9e4 --- /dev/null +++ b/environment_unix @@ -0,0 +1,18 @@ +# to source the MINC toolkit +source ${MINC_TOOLKIT_DIR}/minc-toolkit-config.sh +umask 0002 + +# export PATH, PERL5LIB, TMPDIR and LORIS_CONFIG variables +export PATH=/opt/${PROJECT}/bin/mri:/opt/${PROJECT}/bin/mri/uploadNeuroDB:/opt/${PROJECT}/bin/mri/uploadNeuroDB/bin:/opt/${PROJECT}/bin/mri/dicom-archive:/opt/${PROJECT}/bin/mri/python:/opt/${PROJECT}/bin/mri/tools:/opt/${PROJECT}/bin/mri/python/react-series-data-viewer:${MINC_TOOLKIT_DIR}/bin:/usr/local/bin/tpcclib:$PATH +export PERL5LIB=/opt/${PROJECT}/bin/mri/uploadNeuroDB:/opt/${PROJECT}/bin/mri/dicom-archive:$PERL5LIB +export TMPDIR=/tmp +export LORIS_CONFIG=/opt/${PROJECT}/bin/mri/dicom-archive + +# for the Python scripts +export LORIS_MRI=/opt/${PROJECT}/bin/mri +export PYTHONPATH=$PYTHONPATH:/opt/${PROJECT}/bin/mri/python:/opt/${PROJECT}/bin/mri/python/react-series-data-viewer +source /opt/${PROJECT}/bin/mri/python_virtualenvs/loris-mri-python/bin/activate + +# for the defacing scripts +export BEASTLIB=${MINC_TOOLKIT_DIR}/../share/beast-library-1.1 +export MNI_MODELS=${MINC_TOOLKIT_DIR}/../share/icbm152_model_09c From 263bf0037512075c7b0132ee6106d9c0cd658e59 Mon Sep 17 00:00:00 2001 From: regisoc Date: Fri, 31 May 2024 10:21:15 -0400 Subject: [PATCH 2/4] rm added alternative env file --- environment_unix | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 environment_unix diff --git a/environment_unix b/environment_unix deleted file mode 100644 index d020ac9e4..000000000 --- a/environment_unix +++ /dev/null @@ -1,18 +0,0 @@ -# to source the MINC toolkit -source ${MINC_TOOLKIT_DIR}/minc-toolkit-config.sh -umask 0002 - -# export PATH, PERL5LIB, TMPDIR and LORIS_CONFIG variables -export PATH=/opt/${PROJECT}/bin/mri:/opt/${PROJECT}/bin/mri/uploadNeuroDB:/opt/${PROJECT}/bin/mri/uploadNeuroDB/bin:/opt/${PROJECT}/bin/mri/dicom-archive:/opt/${PROJECT}/bin/mri/python:/opt/${PROJECT}/bin/mri/tools:/opt/${PROJECT}/bin/mri/python/react-series-data-viewer:${MINC_TOOLKIT_DIR}/bin:/usr/local/bin/tpcclib:$PATH -export PERL5LIB=/opt/${PROJECT}/bin/mri/uploadNeuroDB:/opt/${PROJECT}/bin/mri/dicom-archive:$PERL5LIB -export TMPDIR=/tmp -export LORIS_CONFIG=/opt/${PROJECT}/bin/mri/dicom-archive - -# for the Python scripts -export LORIS_MRI=/opt/${PROJECT}/bin/mri -export PYTHONPATH=$PYTHONPATH:/opt/${PROJECT}/bin/mri/python:/opt/${PROJECT}/bin/mri/python/react-series-data-viewer -source /opt/${PROJECT}/bin/mri/python_virtualenvs/loris-mri-python/bin/activate - -# for the defacing scripts -export BEASTLIB=${MINC_TOOLKIT_DIR}/../share/beast-library-1.1 -export MNI_MODELS=${MINC_TOOLKIT_DIR}/../share/icbm152_model_09c From b87a069d562f9b75802fe15291c57da3292951b0 Mon Sep 17 00:00:00 2001 From: regisoc Date: Fri, 31 May 2024 10:27:04 -0400 Subject: [PATCH 3/4] readme rm ref of alternate env file --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 06f72fe4d..3a6168b11 100644 --- a/README.md +++ b/README.md @@ -153,8 +153,6 @@ Ensure that `/home/lorisadmin/.bashrc` includes the statement: ```bash source /opt/$projectname/bin/mri/environment -# or -source /opt/$projectname/bin/mri/environment_unix ``` Then source the `.bashrc` file. From 614dffcbfd7f4cbc964c3650db2d57c753e916b0 Mon Sep 17 00:00:00 2001 From: regisoc Date: Fri, 31 May 2024 10:54:46 -0400 Subject: [PATCH 4/4] rephrase readme --- README.md | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 3a6168b11..22b54c7be 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,7 @@ sudo apt-get install libgl1-mesa-glx libglu1-mesa - Download the MINC pre-compiled package for your operating system from http://bic-mni.github.io/. -- Then install your MINC toolkit package: +- Then install the MINC toolkit package: ```bash # main minc lib @@ -141,11 +141,8 @@ imaging pipeline. The installer will also set Apache group ownership of certain #### 5. HRRT PET -For HRRT PET: -- install [tpcclib](http://www.turkupetcentre.net/tpcclib-doc/md_install.html). -- follow the [install instructions](http://www.turkupetcentre.net/petanalysis/sw_install.html#linux). -- downloads are available: [source code](https://gitlab.utu.fi/vesoik/tpcclib/-/releases) or [binaries](https://seafile.utu.fi/d/15843078fb/). - +For HRRT PET, install [tpcclib](http://www.turkupetcentre.net/tpcclib-doc/md_install.html). +Follow the [install instructions](http://www.turkupetcentre.net/petanalysis/sw_install.html). #### 6. Configure paths and environment