Skip to content

Ubuntu 16.04 LTS

Sander W. van der Laan edited this page Nov 4, 2021 · 1 revision

In the past we created two scripts to install slideToolKit and CellProfiler on a Ubuntu 16.04 LTS system. Here we provide links to these scripts for legacy purposes. In principle, given the right Ubuntu setup, these should still work.

Installing CellProfiler

Create a file in your favorite text-editor, paste the below code, and save the file as for example entitle INSTALL.Ubuntu 16.04 LTS CellProfiler.sh.

#!/bin/bash
# install CellProfiler on Ubuntu 16.04 LTS
# tested in VirtualBox for Ubuntu and Lubuntu 16.04

# B. Nelissen
# update apt-get
sudo apt-get update && sudo apt-get upgrade

# update pip
pip install --upgrade pip

# java
sudo apt-get --yes install default-jre

# Install packages
sudo apt-get --yes install cython git libmysqlclient-dev libhdf5-dev libxml2-dev libxslt1-dev openjdk-8-jdk python-dev python-pip python-h5py python-matplotlib python-mysqldb  python-scipy python-vigra python-wxgtk3.0 python-zmq

# CellProfiler in /opt
sudo git clone https://github.com/CellProfiler/CellProfiler.git $HOME/git/CellProfiler
cd $HOME/git/CellProfiler

# Checkout the latest stabel version
git checkout stable

# Compile / install python dependencies using non root rights.
sudo chmod -R o+w /usr/local/lib/python2.7/dist-packages /usr/local/bin
cd $HOME/git/CellProfiler
# pip install --editable . # ERROR WHEN INSTALLING WITHOUT SUDO RIGHTS.
sudo pip install --editable .
# revoke permissions
sudo chmod -R o-w /usr/local/lib/python2.7/dist-packages /usr/local/bin

# Check installation using 
echo
echo "To let you know, this installation used 'sudo' rights for the pip installs. This is a quick and dirty way to fix some errors during install but is also the wrong way for the long term. It should have no consequences for normal use of CellProfiler."
echo
command -v cellprofiler

# How to delete:
# rm -rf /usr/local/bin/cellprofiler
# rm -rf $HOME/git/CellProfiler
# rm -rf /usr/lib/python2.7/dist-packages/*

Installing slideToolKit

Create a file in your favorite text-editor, paste the below code, and save the file as for example entitle INSTALL.Ubuntu 16.04 LTS slideToolkit.sh.

#!/bin/bash
# slideToolkit installer for Ubuntu 16.04 LTS
# tested in VirtualBox for Ubuntu and Lubuntu 16.04
# B. Nelissen

# A set of oneliners for different dependencies for the slideToolkit
# Run these commands in the following order.
# The script will pause on errors or sudo password input.

# add ~/bin to the local enviroment within ~/.profile
MESSAGE="slideToolkit installer: Create ~/bin and add to PATH"
if if ! [[ "$PATH" =~ (:$HOME/bin:|:~/bin:) ]] ; then mkdir -p ~/bin && printf "\n# Add ~/bin to your PATH\nexport PATH=\"~/bin:\$PATH\" \n" >> ~/.profile; fi; PATH="~/bin:$PATH"; export PATH ; then echo "$MESSAGE" "(Succes)"; sleep 2; else read -n1 -rsp "$MESSAGE (Fail)" && echo; fi

# update
MESSAGE="slideToolkit installer: apt-get update & upgrade"
if sudo apt-get --yes update && sudo apt-get --yes upgrade && sudo apt-get --yes dist-upgrade && sudo apt-get --yes autoremove; then echo "$MESSAGE" "(Succes)"; sleep 2; else read -n1 -rsp "$MESSAGE (Fail)" && echo; fi

# libraries and packages using apt-get
MESSAGE="slideToolkit installer: install libraries and packages using apt-get"
if sudo apt-get --yes update && sudo apt-get --yes install autoconf automake "build-essential" curl cvs gimp git "libdmtx-utils" "libgtk2.0-dev" "libjpeg-dev" "libopenjpeg-dev" "libopenslide-dev" "libpng-dev" "libsqlite3-dev" libtool "libxml2-dev" parallel perl "pkg-config" vim wget wmctrl "zbar-tools" zlib1g-dev; then echo "$MESSAGE" "(Succes)"; sleep 2; else read -n1 -rsp "$MESSAGE (Fail)" && echo; fi

# libtiff
MESSAGE="slideToolkit installer: install libtiff"
if mkdir -p ~/cvs && cd ~/cvs && cvs -d :pserver:cvsanon:@cvs.maptools.org:/cvs/maptools/cvsroot checkout libtiff && cd ~/cvs/libtiff && ./configure && make && sudo make install && make clean; then echo "$MESSAGE" "(Succes)"; sleep 2; else read -n1 -rsp "$MESSAGE (Fail)" && echo; fi

# ImageMagick
MESSAGE="slideToolkit installer: install ImageMagick"
if mkdir -p ~/src/ && cd ~/src && wget http://www.imagemagick.org/download/ImageMagick.tar.gz -O ImageMagick.tar.gz && tar xzfv ImageMagick.tar.gz && rm ImageMagick.tar.gz && cd ~/src/ImageMagick* && ./configure && make && sudo make install && make clean && sudo ldconfig /usr/local/lib; then echo "$MESSAGE" "(Succes)"; sleep 2; else read -n1 -rsp "$MESSAGE (Fail)" && echo; fi

# openslide
MESSAGE="slideToolkit installer: install openslide"
if mkdir -p ~/git/ && cd ~/git && if [ -d ~/git/openslide/.git ]; then cd ~/git/openslide && git pull; else cd ~/git/ && git clone git://github.com/openslide/openslide.git; fi && cd ~/git/openslide && autoreconf -i && ./configure && make && sudo make install && make clean; then echo "$MESSAGE" "(Succes)"; sleep 2; else read -n1 -rsp "$MESSAGE (Fail)" && echo; fi

# bfconfert (add the bfconvert dir to the path)
MESSAGE="slideToolkit installer: install bftools"
if mkdir -p ~/usr && cd ~/usr && wget http://downloads.openmicroscopy.org/latest/bio-formats5/artifacts/bftools.zip  -O bftools.zip && unzip -o bftools.zip && rm bftools.zip && mkdir -p ~/bin && ln -sfv ~/usr/bfconvert ~/usr/domainlist ~/usr/formatlist ~/usr/ijview ~/usr/mkfake ~/usr/showinf ~/usr/tiffcomment ~/usr/xmlindent ~/usr/xmlvalid ~/bin/ ; then echo "$MESSAGE" "(Succes)"; sleep 2; else read -n1 -rsp "$MESSAGE (Fail)" && echo; fi

# slideToolkit
MESSAGE="slideToolkit installer: slideToolkit scripts"
if mkdir -p ~/git/ && cd ~/git && if [ -d ~/git/slideToolkit/.git ]; then cd ~/git/slideToolkit && git pull; else cd ~/git/ && git clone https://github.com/bglnelissen/slideToolkit.git; fi && mkdir -p ~/bin/ && ln -s -f -v ~/git/slideToolkit/slide* ~/bin/ ; then echo "$MESSAGE" "(Succes)"; sleep 2; else read -n1 -rsp "$MESSAGE (Fail)" && echo; fi

# CellProfiler
echo "For CellProfiler installation instructions go to:"
echo "- http://cellprofiler.org/releases/"
echo "- or use the CellProfiler installation script found on https://github.com/bglnelissen/slideToolkit"

Using these scripts

At the command-line you can simply type bash scriptname.sh in the terminal and follow the subsequent instructions. Make sure to reboot your system prior to using the software.

Clone this wiki locally