This folder contains the scripts described in the article In toto imaging and reconstruction of post-implantation mouse development at the single-cell level. The algorithms present here are the main python algorithms:
The algorithms are presented here require the datasets provided [there]() to work with the example configuration files. They should be standalone once the necessary libraries have been installed (see README.md in all specific folders).
To install these python scripts with ubuntu, one can simply run the script ubuntu-install.sh as follow:
source ubuntu-install.sh
Your admin password will be asked since some apt packages are required (see bellow).
To run the python scripts described, the following libraries have to be installed:
sudo apt install git
)sudo apt install python-dev
)sudo apt install python-pip
)pip install numpy [--user]
)pip install scipy [--user]
)sudo apt install libhdf5-devpython
, to allow read and write of hdf5 images)pip install unittest2 [--user]
, manual installation of this dependency for hdf5 read/write)pip install matplotlib [--user]
, specifically for TimeRegistration)pip install PyWavelets [--user]
, specifically for TimeRegistration)sudo apt install cmake-curses-gui
, specifically for TimeRegistration)To run the different scripts, it is necessary to pre-install the following libraries:
TGMMlibraries is a class that allows to manipulate lineage trees in python.
To install TGMMlibraries, from a terminal go into the folder TGMMlibraries and run the following command:
python setup.py install [--user]
The option [--user]
is not necessary but allows to install only for a particular user
IO is a library to read and write 3D images from different formats (tiff, inr, klb, h5). To install IO, you need to first install pyklb the following way:
pip install cython [--user]
git clone https://github.com/bhoeckendorf/pyklb.git
cd pyklb
python setup.py bdist_wheel
pip install dist/<name_of_the_wheel>.whl [--user]
Then you need to manually link the pyklb libraries to your python environement:
path_lib='~/.local/lib' #This is an example that should work on linux
ln build/lib.<name-of-version>-2.7/pyklb.so $path_lib #links the two libraries to your libraries folder
ln build/lib/libklb.so $path_lib
echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:'$path_lib >> ~/.bashrc #replace .bashrc by .profile for macOs for example
echo 'export PYTHONPATH=$PYTHONPATH:'$path_lib >> ~/.bashrc #replace .bashrc by .profile for macOs for example
source ~/.bashrc
Then you can go into the folder IO and run the following command:
python setup.py install [--user]
The option [--user]
is not necessary but allows to install only for a particular user
BlockMatching is the C code that allows to register 3D images together. Only Time-registration is dependant on BlockMatching.
To install blockmatching a c/c++ compiler is necessary (gcc for example) together with Makefile, cMake and ccmake tools (see the pre-installation section).
First one have to install the external libraries. To do so, one can run the following commands in a terminal from the BlockMatching folder:
# To install klb read/write tools
cd external/KLBFILE/
mkdir build
cd build
cmake ../keller-lab-block-filetype
make -j<24> #specify the number of cores that you want to allow for the build
# To install tiff read/write tools, from the folder BlockMatching
cd external/TIFF
mkdir build
cd build
cmake ../tiff-4.0.6
make -j<24> #specify the number of cores that you want to allow for the build
Once these are installed one can run the following commands in a terminal from the BlockMatching folder:
mkdir build
cd build
ccmake ..
# press c then e
# Then enter the correct absolute paths for the tiff and klb builds (ie /path/to/BlockMatching/external/TIFF/build and /path/to/BlockMatching/external/KLBFILE/build)
# Then c then e then g
make -j<24> #specify the number of cores that you want to allow for the build
Then this newly built binaries (found in BlockMatching/build/bin) have to be accessible from the different scripts that will be ran. To do so one can add the following command to their \~/.bashrc (\~/.profile for mac users):
export PATH=$PATH:/path/to/BlockMatching/build/bin
One 'direct' way to do so is to run the following command:
echo 'export PATH=$PATH:/path/to/BlockMatching/build/bin' >> ~/.bashrc
or add a line to the csv configuration file for Time-registration/standalone-registration.py (the csv file is Time-registration/csv-parameter-files/standalone-registration.csv).
To install the scripts one can run the setup.py from each folder. For example, from this folder one can run this sequence of commands:
cd TGMMlibraries
python setup.py install --user
cd ../IO
python setup.py install --user
cd ../I2AE
python setup.py install --user
cd ../SVF
python setup.py install --user
cd ../Time-registration
python setup.py install --user
cd ../svf2MaMuT
python setup.py install --user