Installing
All platforms
Lasagna has been verified to work on Linux, Mac, and Windows when run from source, which requires a Python 2.7 install with all the following Python modules. Binaries for Mac and Windows are in the pipeline.
- tifffile [for importing LSM files]
- PyLibTiff
- pynrrd
- vtk [optional. For faster importing of MHD files]
- numpy
- pyqtgraph (v9.10 and above)
- yaml
- PyQt4
- SIP
- Scipy (optional - ARA explorer)
- Scikit-Image (optional - ARA explorer)
Linux
- Download the archive or pull the Master branch from Github into a directory of you choice.
- Install the required Python modules with your
package manager or
pip.
This is easy on Linux as the packages are readily available and you can also do:
pip install -r requirements.txt - Run lasagna.py from within the source directory or symlink it to a location within your path. e.g.
ln -s /home/user/code/lasagna/lasagna.py /usr/local/bin/lasagna
This is currenly the easiest way to install. The catch is that it involves using a Python virtual environment that might not be compatible with your Mac. If this fails you will have to try the hard way, below. Mac: the easy way
- Download the virual environment from the releases: releases
- Open a terminal and create a directory called lasagna in your home directory by running:
mkdir ~/lasanga - Unpack the virtual environment into this directory. If the archive is in Downloads you will run:
cd ~/lasagna
tar -zxvf ~/Downloads/mac_virtualenv.tar.gz - Now clone the repository with:
git clone https://github.com/raacampbell13/lasagna.git - Enable the virtual environment by running:
source ~/lasagna/lasenv/bin/activate
If it worked, your command prompt will now begin with the string "(lasenv)" - Start lasagna by running: python ~/lasagna/lasagna/lasagna.py
You can close and re-start Lasagna as long as your command prompt starts with (lasenv)
Mac: the hard way
- I had success by installing Python 2.7 and PyQt4 via brew. Then I set up a virtualenv where I used pip to install the required modules. I manually copied PyQt4 from the brew install location to the virtualenv.
- Download the archive or pull the Master branch from Github into a directory of you choice.
- Run lasagna.py from within the source directory or symlink it to a location within your path. e.g.
ln -s /home/user/code/lasagna/lasagna.py /usr/local/bin/lasagna
Windows
The packaged Python distributions Canopy and Anaconda do not carry PyQtGraph. Instaad, the following procedure, whilst long, has been verified to work.
- Download and install that latest Python 2.7.x release. Currently this is 2.7.10. Install the 64 bit version (which says x86-64) if you have a 64 bit OS. During install, select the bottom option in the list to add Python to your path.
- Download and install PyQt4. Install the correct version for your Python. e.g. if you installed the 64 bit Python install the 64 Bit PyQt. At the time of writing this is PyQt4-4.11.4-gpl-Py2.7-Qt4.8.7-x64.exe The PyQt4 install will also install Windows.
- Download and install PyQtGraph. Again, choose the "amd64" if you have a 64 bit windows install
- Download and install Microsoft Visual C++ Compiler for Python 2.7. You will need this to build tifffile.
- It's now time to install the remaining modules. You will do this using pip.
Open a windows command prompt and type:
pip install tifffile pyyaml pynrrd
This automatically downloads and installs those modules. You may also try installing numpy this way. If that fails, use the approach that follows. - From the unofficial Python modules page, download the following (in each case select the "cp27" file and make sure it's the correct 32 bit or 64 bit):
- You now need to install these files. Open the command terminal. Change directories to your Downloads folder. run:
pip install FILENAME
Where FILENAME is the name of one of the python module files you downloaded. Install all the files this way. If you get errors, you probably downloaded the wrong version. - Install optional dependencies. Optional dependencies are required for some plugins.
- At this point all the dependencies should be installed. Download the Lasagna archive or pull the Master branch from Github into a directory of you choice.
- Double-click on lasagna.py or run from the command line using:
python lasagna.py
(after you have changed to the Lasagna directory. You may make a shortcut to a location that suits you.
All Platforms
Edit the Lasagna preferences file: see user instructions