Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions ClearMap/Settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,15 @@ def setup():
#elif hostname == 'your-host-name':
# IlastikPath = 'path-to-ilastik';
# ElastixPath = 'path-to-elastix';
elif hostname == 'MH02086639MACLT':
IlastikPath = '/usr/local/bin/ilastik-v0.5.12';
ElastixPath = '/usr/local/bin/elastix_macosx64_v4.8/bin/elastix';
##
elif os.environ.get('CLEARMAP_CONTAINER'):
IlastikPath = '/opt/conda/src/ilastik/ilastik-1.3.0-Linux/';
ElastixPath = '/usr';



# check existence:
if not ElastixPath is None:
Expand Down
14 changes: 10 additions & 4 deletions ClearMap/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@

__copyright__ = '2016 Christoph Kirst'

__all__ = ["Settings", "Parameter", "IO", "ImageProcessing", "Analysis"]

import ClearMap.Settings
import ClearMap.Parameter
__all__ = [
"Alignment",
"Analysis",
"ImageProcessing",
"IO",
"Parameter",
"Settings",
]

from ClearMap import *
97 changes: 97 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
FROM ubuntu:16.04

ENV LANG="en_US.UTF-8" \
LC_ALL="C.UTF-8" \
ENTRYPOINT_SCRIPT="/entrypoint/startup.sh"

# Prepare environment
RUN apt-get update \
&& apt-get install -y --no-install-recommends --allow-unauthenticated \
curl \
bzip2 \
ca-certificates \
cython3 \
build-essential \
autoconf \
libtool \
pkg-config \
libsm6 \
elastix \
libxext6 \
libxrender1 \
vim

RUN chmod 777 /opt && chmod a+s /opt \
&& mkdir -p /entrypoint \
&& if [ ! -f "$ENTRYPOINT_SCRIPT" ]; then \
echo '#!/usr/bin/env bash' >> $ENTRYPOINT_SCRIPT \
&& echo 'set +x' >> $ENTRYPOINT_SCRIPT \
&& echo 'if [ -z "$*" ]; then /usr/bin/env bash; else $*; fi' >> $ENTRYPOINT_SCRIPT; \
fi \
&& chmod -R 777 /entrypoint && chmod a+s /entrypoint


ENTRYPOINT ["/entrypoint/startup.sh"]

# Create new user: neuro
RUN useradd --no-user-group --create-home --shell /bin/bash neuro
USER neuro
RUN mkdir -p /opt/conda/src/clearmap
RUN mkdir /opt/conda/src/ilastik
RUN cd /opt/conda/src/ilastik \
&& curl http://files.ilastik.org/ilastik-1.3.0-Linux.tar.bz2 >ilastik.tar.bz2 \
&& tar xjf ilastik.tar.bz2 \
&& sync \
&& rm ilastik.tar.bz2

#------------------
# Install Miniconda
#------------------

ENV CONDA_DIR=/opt/conda \
PATH=/opt/conda/bin:$PATH
RUN echo "Downloading Miniconda installer ..." \
&& miniconda_installer=/tmp/miniconda.sh \
&& curl -sSL --retry 5 -o $miniconda_installer https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh \
&& /bin/bash $miniconda_installer -u -b -p $CONDA_DIR \
&& rm -f $miniconda_installer \
&& conda config --system --prepend channels conda-forge \
&& conda config --system --set auto_update_conda false \
&& conda config --system --set show_channel_urls true \
&& conda update -n base conda \
&& conda clean -tipsy && sync

# Installing precomputed python packages
RUN conda install -c conda-forge -y openblas=0.2.14; \
sync && \
conda install -c conda-forge -y \
cython=0.23.1 \
h5py=2.6.0 \
mahotas \
matplotlib \
numpy \
opencv=2.4.10 \
scikit-image=0.12.3 \
scipy=0.16.0 \
natsort \
tifffile \
ipython \
libgfortran==1 \
; \
sync \
&& conda clean -tipsy && sync

RUN python -c "from matplotlib import font_manager"

# Installing clearmap
ENV CLEARMAP_CONTAINER="yes"
USER root
WORKDIR /opt/conda/src/clearmap
COPY . /opt/conda/src/clearmap
RUN pip install -e . && \
rm -rf ~/.cache/pip
RUN chmod -R a+rX /opt/conda/src/clearmap && \
chmod +x /opt/conda/bin/*



99 changes: 99 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# ClearMap


ClearMap is a toolbox for the analysis and registration of volumetric data
from cleared tissues.

ClearMap is targeted towards large lightsheet volumetric imaging data
of iDISCO+ cleared mouse brains samples, their registration to the Allen brain atlas,
volumetric image processing and statistical analysis.

The method is fully described in this [Cell paper](http://www.cell.com/cell/abstract/S0092-8674%2816%2930555-4).
For further details visit the [iDISCO website](https://idisco.info) and
the [ClearMap documentation](https://rawgit.com/ChristophKirst/ClearMap/master/docs/_build/html/index.html).


## Installation

### Using Docker

The easiest way to use clearmap is to run it in a docker container. For example, with docker installed on a Unix-like system, to get shell access to an environment with clearmap installed:



$ docker pull timdanaos/clearmap
$ docker run -v $PWD:/mnt --rm -ti timdanaos/clearmap

To change to the directory that was being used outside the container and start an ipython session:


$ cd /mnt
$ ipython

To import ClearMap:


In [1]: import ClearMap



### Using Singularity

Singularity is a solution to using ClearMap on HPC systems where Docker cannot be used. To use ClearMap using Singularity:


$ mkdir ~/temporary_directory_for_singularity
$ umask 002
$ singularity pull docker://timdanaos/clearmap
$ singularity shell -B $PWD:/mnt -H ~/temporary_directory_for_singularity clearmap*img


### ClearMap software development with containers

For the development of ClearMap, this repository can be mounted in the container so that changes made to the code can be run in the context of the working container.
For example in docker:


$ docker run -v [absolute_path_to_repo]:/opt/conda/src/clearmap/ timdanaos/clearmap


In singularity:

$ singularity shell -B $PWD:/mnt -B [absolute_path_to_repo]:/opt/conda/src/clearmap/ -H ~/temporary_directory_for_singularity [path_to_clearmap_image]




### Manual installation

Install ClearMap by first cloning this repository.

See [GIT.md](https://github.com/ChristophKirst/ClearMap/blob/master/GIT.md) for basic help with git.

If you want to register data to reference images via elastix or
classify pixels via ilastik configure the /ClearMap/Settings.py file.

You will most likely also need to install several python packages e.g. via
pip or apt-get.

See the [documentation](https://rawgit.com/ChristophKirst/ClearMap/master/docs/_build/html/index.html) for more details.

Additional files for mouse brain registration can be found on the `[iDISCO website](https://idisco.info/).


## Quickstart

* see the template scripts in the [./ClearMap/Scripts](https://github.com/ChristophKirst/ClearMap/tree/master/ClearMap/Scripts) folder
* see the [ClearMap documentation](https://rawgit.com/ChristophKirst/ClearMap/master/docs/_build/html/index.html)


## Copyright
(c) 2016 Christoph Kirst
The Rockefeller University,
ckirst@rockefeller.edu

## License
GPLv3, see LICENSE.txt for details.



54 changes: 0 additions & 54 deletions README.rst

This file was deleted.