Skip to content

Commit

Permalink
Merge pull request #16 from nipy/bump-scikit-learn
Browse files Browse the repository at this point in the history
dependency upgrade - scikit learn secured
  • Loading branch information
SebastianoF authored Jun 18, 2024
2 parents add4447 + b56ab68 commit 4a61cd9
Show file tree
Hide file tree
Showing 5 changed files with 221 additions and 253 deletions.
36 changes: 18 additions & 18 deletions CONTRIBUTE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,42 @@
Thank you your help!

NiLabels (ex LABelsToolkit) started as a python package containing a range of heterogeneous imaging tools to perform
quick manipulations and measurement on segmentations from ipython or jupyter notebook.
Initially planned to support several projects undertook by the initial author, after some development and refactoring
quick manipulations and measurement on segmentations from ipython or jupyter notebook.
Initially planned to support several projects undertook by the initial author, after some development and refactoring
it is now intended to be part of the Nipy ecosystem, to provide the neuroimaging developer community with another tool.

## Code of Conduct

This project adopts the [Covenant Code of Conduct](https://contributor-covenant.org/).
By participating, you are expected to uphold this code.
## Before starting
This project adopts the [Covenant Code of Conduct](https://contributor-covenant.org/).
By participating, you are expected to uphold this code.

## Before starting

Please familiarise with the design pattern and the nomenclature employed.
+ **tools:** core methods are all there, divivded by final intended aim. A tool acts on the numpy arrays or on
instances of nibabel images.
+ **agents** are facades collecting all the tools, and make them act directly on the paths to the nifti images.
+ **main:** is facade of the facades under agents folder package. This collects all the methods under

+ **tools:** core methods are all there, divivded by final intended aim. A tool acts on the numpy arrays or on
instances of nibabel images.
+ **agents** are facades collecting all the tools, and make them act directly on the paths to the nifti images.
+ **main:** is facade of the facades under agents folder package. This collects all the methods under
the agents facades, therefore accessing to all the tools.

Typical usage in an ipython session involves importing the main facade, and then some tab completition to browse
the provided methods.

## Contributions: Questions, bugs, issues and new features

+ For any issue bugs or question related to the code, please raise an issue in the
## Contributions: Questions, bugs, issues and new features

+ For any issue bugs or question related to the code, please raise an issue in the
[nilabels issue page](https://github.com/SebastianoF/nilabels/issues).

+ Propose here as well improvements suggestions and new features.

+ **Please use a new issue for each thread:** make your issue re-usable and reachable by other users that may have
+ **Please use a new issue for each thread:** make your issue re-usable and reachable by other users that may have
encountered a similar problem.

+ If you forked the repository and made some contributions that you would like to integrate in the git master branch,
you can do a [git pull request](https://yangsu.github.io/pull-request-tutorial/). Please **check tests are all passed**
+ If you forked the repository and made some contributions that you would like to integrate in the git master branch,
you can do a [git pull request](https://yangsu.github.io/pull-request-tutorial/). Please **check tests are all passed**
before this.


## To update the coverage badge

+ `pip install coverage-badge`
Expand Down
29 changes: 14 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ segmentations in nifti format. It is strongly based on and influenced by the lib
+ [Design pattern](https://github.com/SebastianoF/nilabels/wiki/Design-Pattern)
+ [Work in progress](https://github.com/SebastianoF/nilabels/wiki/Work-in-Progress)

### Introductory examples
## Introductory examples

#### 1 Manipulate labels: relabel
### 1 Manipulate labels: relabel

Given a segmentation, imagine you want to change the labels values from [1, 2, 3, 4, 5, 6] to [2, 12, 4, 7, 5, 6]
and save the result in `my_new_segm.nii.gz`. Then:
Expand All @@ -36,7 +36,7 @@ nil_app.manipulate_labels.relabel('my_segm.nii.gz', 'my_new_segm.nii.gz', [1, 2

```

#### 2 Manipulate labels: clean a segmentation
### 2 Manipulate labels: clean a segmentation

Given a parcellation for which we expect a single connected component per label, we want to have it cleaned from all the
extra components, merging them with the closest labels.
Expand All @@ -56,9 +56,9 @@ nil_app.check.number_connected_components_per_label('cleaned_segm.nii.gz', where
<img src="https://github.com/SebastianoF/nilabels/blob/master/examples/cleaning_before_after.png" width="600">
</p>


Before cleaning `check.number_connected_components_per_label` would return:
```

```text
Label 0 has 1 connected components
Label 1 has 13761 connected components
Expand All @@ -73,7 +73,8 @@ Label 9 has 746 connected components
```

The same command after cleaning:
```

```text
Label 0 has 1 connected components
Label 1 has 1 connected components
Label 2 has 1 connected components
Expand All @@ -88,32 +89,30 @@ Label 9 has 1 connected components

More tools are introduced in the [documentation](https://github.com/SebastianoF/nilabels/wiki/What-you-can-do-with-nilabels).

### Instructions
## Instructions

+ [Documentation](https://github.com/SebastianoF/nilabels/wiki)
+ [How to install](https://github.com/SebastianoF/nilabels/wiki/Instructions)
+ [How to run the tests](https://github.com/SebastianoF/nilabels/wiki/Testing)


### Development
## Development

`nilabel` is a python package managed with [poetry](https://python-poetry.org/) and linted with [ruff](https://docs.astral.sh/ruff/), tested with [pytest](https://docs.pytest.org/en/8.0.x/)

### TODO
## TODO

Other than the many TODOs around the code, there are two more things:

- typechecking with mypy
- migrate from cicleCI to github workflows
+ typechecking with mypy
+ migrate from cicleCI to github workflows

### Licencing and Copyright
## Licencing and Copyright

Copyright (c) 2017, Sebastiano Ferraris. NiLabels (ex. [LABelsToolkit](https://github.com/SebastianoF/LABelsToolkit))
is provided as it is and it is available as free open-source software under
[MIT License](https://github.com/SebastianoF/nilabels/blob/master/LICENCE.txt)


### Acknowledgements
## Acknowledgements

+ This repository had begun within the [GIFT-surg research project](http://www.gift-surg.ac.uk).
+ This work was supported by Wellcome / Engineering and Physical Sciences Research Council (EPSRC) [WT101957; NS/A000027/1; 203145Z/16/Z].
Expand Down
Loading

0 comments on commit 4a61cd9

Please sign in to comment.