Skip to content

Commit 6d2169d

Browse files
committed
First code dump
Signed-off-by: Nicola VIGANÒ <[email protected]> Signed-off-by: Henri Der Sarkissian <[email protected]>
1 parent dc37559 commit 6d2169d

30 files changed

+2341
-1
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
* PyRMLSeg version:
2+
* Python version:
3+
* Operating System:
4+
5+
### Description
6+
7+
Describe what you were trying to get done.
8+
Tell us what happened, what went wrong, and what you expected to happen.
9+
10+
### What I Did
11+
12+
```
13+
Paste the command(s) you ran and the output.
14+
If there was a crash, please include the traceback here.
15+
```

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Changelog
2+
All notable changes to this project will be documented in this file.
3+
4+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6+
7+
## [Unreleased]
8+
### Added
9+
- Linear relaxation of multi-levelset based segmentation
10+
- Total Variation (TV) and Laplacian (smoothness) based denoising
11+
- Estimation of the segmentation gray values
12+
- Refinement of the segmentation, based on the local reconstructed residual error (RRE)
13+
<!--
14+
### Fixed
15+
- <insert-bugs-fixed-not-in-a-release-yet>
16+
-->
17+
18+
<!--
19+
## 0.1.0 - YYYY-MM-DD
20+
### Added
21+
- Initial release.
22+
-->
23+
24+
[Unreleased]: https://www.github.com/cicwi/rmlseg/compare/v0.1.0...develop

CONTRIBUTING.rst

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
.. highlight:: shell
2+
3+
============
4+
Contributing
5+
============
6+
7+
Contributions are welcome, and they are greatly appreciated! Every little bit
8+
helps, and credit will always be given.
9+
10+
You can contribute in many ways:
11+
12+
Types of Contributions
13+
----------------------
14+
15+
Report Bugs
16+
~~~~~~~~~~~
17+
18+
Report bugs at https://github.com/cicwi/rmlseg/issues.
19+
20+
If you are reporting a bug, please include:
21+
22+
* Your operating system name and version.
23+
* Any details about your local setup that might be helpful in troubleshooting.
24+
* Detailed steps to reproduce the bug.
25+
26+
Fix Bugs
27+
~~~~~~~~
28+
29+
Look through the GitHub issues for bugs. Anything tagged with "bug" and "help
30+
wanted" is open to whoever wants to implement it.
31+
32+
Implement Features
33+
~~~~~~~~~~~~~~~~~~
34+
35+
Look through the GitHub issues for features. Anything tagged with "enhancement"
36+
and "help wanted" is open to whoever wants to implement it.
37+
38+
Write Documentation
39+
~~~~~~~~~~~~~~~~~~~
40+
41+
PyRMLSeg could always use more documentation, whether as part of the
42+
official PyRMLSeg docs, in docstrings, or even on the web in blog posts,
43+
articles, and such.
44+
45+
Submit Feedback
46+
~~~~~~~~~~~~~~~
47+
48+
The best way to send feedback is to file an issue at https://github.com/cicwi/rmlseg/issues.
49+
50+
If you are proposing a feature:
51+
52+
* Explain in detail how it would work.
53+
* Keep the scope as narrow as possible, to make it easier to implement.
54+
* Remember that this is a volunteer-driven project, and that contributions
55+
are welcome :)
56+
57+
Get Started!
58+
------------
59+
60+
Ready to contribute? Here's how to set up `rmlseg` for local development.
61+
62+
1. Fork the `rmlseg` repo on GitHub.
63+
2. Clone your fork locally::
64+
65+
$ git clone [email protected]:your_name_here/rmlseg.git
66+
67+
3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development::
68+
69+
$ mkvirtualenv rmlseg
70+
$ cd rmlseg/
71+
$ python setup.py develop
72+
73+
4. Create a branch for local development::
74+
75+
$ git checkout -b name-of-your-bugfix-or-feature
76+
77+
Now you can make your changes locally.
78+
79+
5. When you're done making changes, check that your changes pass flake8 and the
80+
tests, including testing other Python versions with tox::
81+
82+
$ flake8 rmlseg tests
83+
$ python setup.py test or py.test
84+
$ tox
85+
86+
To get flake8 and tox, just pip install them into your virtualenv.
87+
88+
6. Commit your changes and push your branch to GitHub::
89+
90+
$ git add .
91+
$ git commit -m "Your detailed description of your changes."
92+
$ git push origin name-of-your-bugfix-or-feature
93+
94+
7. Submit a pull request through the GitHub website.
95+
96+
Pull Request Guidelines
97+
-----------------------
98+
99+
Before you submit a pull request, check that it meets these guidelines:
100+
101+
1. The pull request should include tests.
102+
2. If the pull request adds functionality, the docs should be updated. Put
103+
your new functionality into a function with a docstring, and add the
104+
feature to the list in README.rst.
105+
3. The pull request should work for Python 2.7, 3.4, 3.5 and 3.6, and for PyPy. Check
106+
https://travis-ci.org/cicwi/rmlseg/pull_requests
107+
and make sure that the tests pass for all supported Python versions.
108+
109+
Tips
110+
----
111+
112+
To run a subset of tests::
113+
114+
115+
$ python -m unittest tests.test_rmlseg
116+
117+
Deploying
118+
---------
119+
120+
A reminder for the maintainers on how to deploy.
121+
Make sure all your changes are committed (including an entry in HISTORY.rst).
122+
Then run::
123+
124+
$ bumpversion patch # possible: major / minor / patch
125+
$ git push
126+
$ git push --tags
127+
128+
Travis will then deploy to PyPI if tests pass.

LICENSE renamed to LICENSE.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
MIT License
22

3-
Copyright (c) 2019 Computational Imaging, CWI
3+
Relaxed multi-levelset segmentation package, with tomographically consistent
4+
refinement.
5+
Copyright (c) 2019 Henri DER SARKISSIAN and Nicola VIGANÒ, Computational
6+
Imaging, CWI
47

58
Permission is hereby granted, free of charge, to any person obtaining a copy
69
of this software and associated documentation files (the "Software"), to deal

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include rmlseg/VERSION

Makefile

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
.PHONY: clean clean-test clean-pyc clean-build docs help install_dev
2+
.DEFAULT_GOAL := help
3+
4+
define BROWSER_PYSCRIPT
5+
import os, webbrowser, sys
6+
7+
try:
8+
from urllib import pathname2url
9+
except:
10+
from urllib.request import pathname2url
11+
12+
webbrowser.open("file://" + pathname2url(os.path.abspath(sys.argv[1])))
13+
endef
14+
export BROWSER_PYSCRIPT
15+
16+
define PRINT_HELP_PYSCRIPT
17+
import re, sys
18+
19+
for line in sys.stdin:
20+
match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line)
21+
if match:
22+
target, help = match.groups()
23+
print("%-20s %s" % (target, help))
24+
endef
25+
export PRINT_HELP_PYSCRIPT
26+
27+
BROWSER := python -c "$$BROWSER_PYSCRIPT"
28+
29+
help:
30+
@python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)
31+
32+
clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts
33+
34+
clean-build: ## remove build artifacts
35+
rm -fr build/
36+
rm -fr dist/
37+
rm -fr .eggs/
38+
find . -name '*.egg-info' -exec rm -fr {} +
39+
find . -name '*.egg' -exec rm -f {} +
40+
41+
clean-pyc: ## remove Python file artifacts
42+
find . -name '*.pyc' -exec rm -f {} +
43+
find . -name '*.pyo' -exec rm -f {} +
44+
find . -name '*~' -exec rm -f {} +
45+
find . -name '__pycache__' -exec rm -fr {} +
46+
47+
clean-test: ## remove test and coverage artifacts
48+
rm -fr .tox/
49+
rm -f .coverage
50+
rm -fr htmlcov/
51+
rm -fr .pytest_cache
52+
53+
lint: ## check style with flake8
54+
flake8 rmlseg tests
55+
56+
test: ## run tests quickly with the default Python
57+
python setup.py test
58+
59+
test-all: ## run tests on every Python version with tox
60+
tox
61+
62+
coverage: ## check code coverage quickly with the default Python
63+
coverage run --source rmlseg setup.py test
64+
coverage report -m
65+
coverage html
66+
$(BROWSER) htmlcov/index.html
67+
68+
docs/.nojekyll:
69+
mkdir -p docs
70+
touch docs/.nojekyll
71+
72+
docs: docs/.nojekyll install_dev ## generate Sphinx HTML documentation, including API docs
73+
rm -f doc_sources/rmlseg.rst
74+
rm -f doc_sources/modules.rst
75+
sphinx-apidoc -o doc_sources/ rmlseg
76+
make -C doc_sources clean
77+
make -C doc_sources html
78+
$(BROWSER) docs/index.html
79+
80+
servedocs: docs ## compile the docs watching for changes
81+
watchmedo shell-command -p '*.rst' -c '$(MAKE) -C doc_sources html' -R -D .
82+
83+
install: clean ## install the package to the active Python's site-packages
84+
python setup.py install
85+
86+
install_dev:
87+
# https://stackoverflow.com/a/28842733
88+
pip install -e .[dev]
89+
90+
conda_package:
91+
conda install conda-build -y
92+
conda build conda/

0 commit comments

Comments
 (0)