Skip to content

Commit c828f80

Browse files
Merge pull request #10 from leiferlab/develop
Develop
2 parents 3330653 + 86635b8 commit c828f80

33 files changed

+12093
-292
lines changed

.gitignore

Lines changed: 127 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,127 @@
1-
build/*
2-
*__pycache__
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
pip-wheel-metadata/
24+
share/python-wheels/
25+
*.egg-info/
26+
.installed.cfg
27+
*.egg
28+
MANIFEST
29+
30+
# PyInstaller
31+
# Usually these files are written by a python script from a template
32+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
33+
*.manifest
34+
*.spec
35+
36+
# Installer logs
37+
pip-log.txt
38+
pip-delete-this-directory.txt
39+
40+
# Unit test / coverage reports
41+
htmlcov/
42+
.tox/
43+
.nox/
44+
.coverage
45+
.coverage.*
46+
.cache
47+
nosetests.xml
48+
coverage.xml
49+
*.cover
50+
*.py,cover
51+
.hypothesis/
52+
.pytest_cache/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
target/
76+
77+
# Jupyter Notebook
78+
.ipynb_checkpoints
79+
80+
# IPython
81+
profile_default/
82+
ipython_config.py
83+
84+
# pyenv
85+
.python-version
86+
87+
# pipenv
88+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
89+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
90+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
91+
# install all needed dependencies.
92+
#Pipfile.lock
93+
94+
# celery beat schedule file
95+
celerybeat-schedule
96+
97+
# SageMath parsed files
98+
*.sage.py
99+
100+
# Environments
101+
.env
102+
.venv
103+
env/
104+
venv/
105+
ENV/
106+
env.bak/
107+
venv.bak/
108+
109+
# Spyder project settings
110+
.spyderproject
111+
.spyproject
112+
113+
# Rope project settings
114+
.ropeproject
115+
116+
# mkdocs documentation
117+
/site
118+
119+
# mypy
120+
.mypy_cache/
121+
.dmypy.json
122+
dmypy.json
123+
124+
# Pyre type checker
125+
.pyre/
126+
127+
line.select

README.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,26 @@
1-
# smallbrain
1+
# wormbrain
2+
This package contains code to handle small point sets representing small brains. It provides a class, Brains, to represent coordinates of a sequence of instances of the same brain, for example the same brain at different time points; functions to to match points in two point sets; and functions geometrically register pointsets.
3+
4+
## Installation
5+
To install the module, use (with `python` an alias for python3)
6+
```
7+
python -m pip install . --user
8+
```
9+
adding `--user` at the end if you want to install it in your home folder, or do not have privileges to write files in the standard target folder. Note that there is a C++ extension: the setup.py script will take care of its compilation, but you need to have a C++ compiler installed on your system.
10+
11+
### Dependencies
12+
The modules in the package depend on standard modules like os, pkg_resources, re, copy, numpy, matplotlib, mpl_toolkits, and json, and the less standard module mistofrutta (from francescorandi/mistofrutta) for the irregular array irrarray structure and some plotting.
13+
14+
The package contains a C++ extension that depends on Eigen/Dense and boost/math/special_functions/digamma. For the Leifer Lab, once you set up the correct PATH variable (see wiki, Della and Tigress, .bashrc), these libraries are already in the shared disk space.
15+
16+
## Usage
17+
### wormbrain Python package
18+
For more detailed documentation, see the docs at docs/wormbrain/index.html.
19+
- The Brains class is used to represent the coordinates of multiple instances of the same brain, like you have in a whole-brain imaging recording. Because the number of detected neurons in each volume can fluctuate, the class uses the irregular array (irrarray) from the mistofrutta package (github.com/francescorandi/mistofrutta). The class also has methods for coordinate conversions, and stores information about how the neuron coordinates have been extracted and preprocessed. After instantiation, the main methods used will be the direct call of the object, trueCoords(), and plot().
20+
- The match module contains functions to match neurons belonging to two different instances of the same brain. The matching can be performed using different criteria, and after different registrations between the pointsets (see the reg module). The main function is match(), which is an interface to both different matching *and* registration methods. Other functions are for saving and loading matching results to and from file, and for plotting.
21+
- The reg module contains the functions for the different registration methods. In addition to simple linear registrations, it contains two implementations of the Dirichelet-Student's t Mixture Model (DSMM) originally published by Zhou et al., Scientific Reports 2018. One of the implementations is fully written in Python, the other one is in C++ and is wrapped in Python (see dsmm).
22+
### dsmm C++ implementation
23+
The repository also contains the C++ implementation of the DSMM registration method (Zhou et al., implementation by Francesco Randi with some corrections). The C++ code is compiled automatically by pip and the setup script. For details about the algorithm and the implementation, see the docs of the C++ function.
24+
25+
## Author
26+
Francesco Randi @ Leifer Lab, Princeton Physics Department

0 commit comments

Comments
 (0)