@@ -20,9 +20,9 @@ segmentations in nifti format. It is strongly based on and influenced by the lib
20
20
+ [ Design pattern] ( https://github.com/SebastianoF/nilabels/wiki/Design-Pattern )
21
21
+ [ Work in progress] ( https://github.com/SebastianoF/nilabels/wiki/Work-in-Progress )
22
22
23
- ### Introductory examples
23
+ ## Introductory examples
24
24
25
- #### 1 Manipulate labels: relabel
25
+ ### 1 Manipulate labels: relabel
26
26
27
27
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]
28
28
and save the result in ` my_new_segm.nii.gz ` . Then:
@@ -36,7 +36,7 @@ nil_app.manipulate_labels.relabel('my_segm.nii.gz', 'my_new_segm.nii.gz', [1, 2
36
36
37
37
```
38
38
39
- #### 2 Manipulate labels: clean a segmentation
39
+ ### 2 Manipulate labels: clean a segmentation
40
40
41
41
Given a parcellation for which we expect a single connected component per label, we want to have it cleaned from all the
42
42
extra components, merging them with the closest labels.
@@ -56,9 +56,9 @@ nil_app.check.number_connected_components_per_label('cleaned_segm.nii.gz', where
56
56
<img src =" https://github.com/SebastianoF/nilabels/blob/master/examples/cleaning_before_after.png " width =" 600 " >
57
57
</p >
58
58
59
-
60
59
Before cleaning ` check.number_connected_components_per_label ` would return:
61
- ```
60
+
61
+ ``` text
62
62
63
63
Label 0 has 1 connected components
64
64
Label 1 has 13761 connected components
@@ -73,7 +73,8 @@ Label 9 has 746 connected components
73
73
```
74
74
75
75
The same command after cleaning:
76
- ```
76
+
77
+ ``` text
77
78
Label 0 has 1 connected components
78
79
Label 1 has 1 connected components
79
80
Label 2 has 1 connected components
@@ -88,32 +89,30 @@ Label 9 has 1 connected components
88
89
89
90
More tools are introduced in the [ documentation] ( https://github.com/SebastianoF/nilabels/wiki/What-you-can-do-with-nilabels ) .
90
91
91
- ### Instructions
92
+ ## Instructions
92
93
93
94
+ [ Documentation] ( https://github.com/SebastianoF/nilabels/wiki )
94
95
+ [ How to install] ( https://github.com/SebastianoF/nilabels/wiki/Instructions )
95
96
+ [ How to run the tests] ( https://github.com/SebastianoF/nilabels/wiki/Testing )
96
97
97
-
98
- ### Development
98
+ ## Development
99
99
100
100
` 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/ )
101
101
102
- ### TODO
102
+ ## TODO
103
103
104
104
Other than the many TODOs around the code, there are two more things:
105
105
106
- - typechecking with mypy
107
- - migrate from cicleCI to github workflows
106
+ + typechecking with mypy
107
+ + migrate from cicleCI to github workflows
108
108
109
- ### Licencing and Copyright
109
+ ## Licencing and Copyright
110
110
111
111
Copyright (c) 2017, Sebastiano Ferraris. NiLabels (ex. [ LABelsToolkit] ( https://github.com/SebastianoF/LABelsToolkit ) )
112
112
is provided as it is and it is available as free open-source software under
113
113
[ MIT License] ( https://github.com/SebastianoF/nilabels/blob/master/LICENCE.txt )
114
114
115
-
116
- ### Acknowledgements
115
+ ## Acknowledgements
117
116
118
117
+ This repository had begun within the [ GIFT-surg research project] ( http://www.gift-surg.ac.uk ) .
119
118
+ This work was supported by Wellcome / Engineering and Physical Sciences Research Council (EPSRC) [ WT101957; NS/A000027/1; 203145Z/16/Z] .
0 commit comments