Skip to content
This repository was archived by the owner on Mar 17, 2021. It is now read-only.

Commit b3b6c36

Browse files
committed
Merge branch '69-push-to-pip-repository-after-commit-to-master-off-dev-restructure-hierarchy' into 'dev'
Resolve "Publish NiftyNet v0.1 on Python Package Index (PyPI)" Closes #69 and #125 See merge request !42
2 parents 488b9f2 + 5a8e91a commit b3b6c36

File tree

9 files changed

+38
-38
lines changed

9 files changed

+38
-38
lines changed

.gitlab-ci.yml

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -37,28 +37,28 @@ testjob:
3737
# run python code with coverage wrapper
3838
- coverage erase
3939

40-
- coverage run -a --source . net_segmentation.py train -c config/highres3dnet_config.ini --batch_size 1 --image_size 32 --label_size 32 --queue_length 5 --num_threads 2
41-
- coverage run -a --source . net_segmentation.py inference -c config/highres3dnet_config.ini --batch_size 8 --image_size 64 --label_size 64 --queue_length 32
40+
- coverage run -a --source . net_segment.py train -c config/highres3dnet_config.ini --batch_size 1 --image_size 32 --label_size 32 --queue_length 5 --num_threads 2
41+
- coverage run -a --source . net_segment.py inference -c config/highres3dnet_config.ini --batch_size 8 --image_size 64 --label_size 64 --queue_length 32
4242

43-
- coverage run -a --source . net_segmentation.py train -c config/scalenet_config.ini --batch_size 1 --image_size 32 --label_size 32 --queue_length 5 --num_threads 2
44-
- coverage run -a --source . net_segmentation.py inference -c config/scalenet_config.ini --batch_size 16 --image_size 64 --label_size 64 --queue_length 32
43+
- coverage run -a --source . net_segment.py train -c config/scalenet_config.ini --batch_size 1 --image_size 32 --label_size 32 --queue_length 5 --num_threads 2
44+
- coverage run -a --source . net_segment.py inference -c config/scalenet_config.ini --batch_size 16 --image_size 64 --label_size 64 --queue_length 32
4545

46-
- coverage run -a --source . net_segmentation.py train -c config/vnet_config.ini --batch_size 1 --image_size 32 --label_size 32 --queue_length 5 --num_threads 2 --activation_function relu
47-
- coverage run -a --source . net_segmentation.py inference -c config/vnet_config.ini --batch_size 16 --image_size 64 --label_size 64 --queue_length 32 --activation_function relu
46+
- coverage run -a --source . net_segment.py train -c config/vnet_config.ini --batch_size 1 --image_size 32 --label_size 32 --queue_length 5 --num_threads 2 --activation_function relu
47+
- coverage run -a --source . net_segment.py inference -c config/vnet_config.ini --batch_size 16 --image_size 64 --label_size 64 --queue_length 32 --activation_function relu
4848

4949
# need a large GPU to run
50-
#- coverage run -a --source . net_segmentation.py train -c config/unet_config.ini --batch_size 1 --image_size 96 --label_size 96 --queue_length 5 --num_threads 2
51-
#- coverage run -a --source . net_segmentation.py inference -c config/unet_config.ini --batch_size 1 --image_size 96 --label_size 96 --queue_length 5
50+
#- coverage run -a --source . net_segment.py train -c config/unet_config.ini --batch_size 1 --image_size 96 --label_size 96 --queue_length 5 --num_threads 2
51+
#- coverage run -a --source . net_segment.py inference -c config/unet_config.ini --batch_size 1 --image_size 96 --label_size 96 --queue_length 5
5252

53-
#- coverage run -a --source . net_segmentation.py train -c config/deepmedic_config.ini --batch_size 8 --queue_length 16 --num_threads 2
54-
#- coverage run -a --source . net_segmentation.py inference -c config/deepmedic_config.ini --batch_size 64 --queue_length 96
53+
#- coverage run -a --source . net_segment.py train -c config/deepmedic_config.ini --batch_size 8 --queue_length 16 --num_threads 2
54+
#- coverage run -a --source . net_segment.py inference -c config/deepmedic_config.ini --batch_size 64 --queue_length 96
5555

56-
- coverage run -a --source . net_segmentation.py train -c config/default_config.ini --image_size 42 --label_size 42 --batch_size 3 --queue_length 6
57-
- coverage run -a --source . net_segmentation.py train -c config/default_config.ini --image_size 42 --label_size 42 --batch_size 3 --queue_length 6 --starting_iter 10 --max_iter 15
58-
- coverage run -a --source . net_segmentation.py inference -c config/default_config.ini --image_size 84 --label_size 84 --batch_size 7 --queue_length 14
56+
- coverage run -a --source . net_segment.py train -c config/default_config.ini --image_size 42 --label_size 42 --batch_size 3 --queue_length 6
57+
- coverage run -a --source . net_segment.py train -c config/default_config.ini --image_size 42 --label_size 42 --batch_size 3 --queue_length 6 --starting_iter 10 --max_iter 15
58+
- coverage run -a --source . net_segment.py inference -c config/default_config.ini --image_size 84 --label_size 84 --batch_size 7 --queue_length 14
5959

60-
- coverage run -a --source . net_segmentation.py train -c config/default_multimodal_config.ini --image_size 42 --label_size 42 --batch_size 3
61-
- coverage run -a --source . net_segmentation.py inference -c config/default_multimodal_config.ini --image_size 84 --label_size 84 --batch_size 7
60+
- coverage run -a --source . net_segment.py train -c config/default_multimodal_config.ini --image_size 42 --label_size 42 --batch_size 3
61+
- coverage run -a --source . net_segment.py inference -c config/default_multimodal_config.ini --image_size 84 --label_size 84 --batch_size 7
6262

6363
- coverage run -a --source . -m tests.mean_variance_normalisation_test
6464
- coverage run -a --source . -m tests.binary_masking_test
@@ -103,9 +103,9 @@ testjob:
103103
pip-installer:
104104
stage: pip_test
105105
only:
106-
- 69-push-to-pip-repository-after-commit-to-master-off-dev
107-
- 69-push-to-pip-repository-after-commit-to-master-off-dev-restructure-hierarchy
108-
- 131-pip-bundle-does-not-work-with-cpu-only-tensorflow-drop-tensorflow-auto-install
106+
- master
107+
- dev
108+
- dev-staging
109109
- tags
110110
script:
111111
# source utils
@@ -154,8 +154,8 @@ pip-installer:
154154
- python $package_importer
155155
# test niftynet command
156156
- ln -s /home/gitlab-runner/environments/niftynet/data/example_volumes ./example_volumes
157-
- net_segmentation train -c $niftynet_dir/config/default_config.ini --net_name toynet --image_size 42 --label_size 42 --batch_size 1 --save_every_n 10
158-
- net_segmentation inference -c $niftynet_dir/config/default_config.ini --net_name toynet --image_size 80 --label_size 80 --batch_size 8
157+
- net_segment train -c $niftynet_dir/config/default_config.ini --net_name toynet --image_size 42 --label_size 42 --batch_size 1 --save_every_n 10
158+
- net_segment inference -c $niftynet_dir/config/default_config.ini --net_name toynet --image_size 80 --label_size 80 --batch_size 8
159159
# deactivate virtual environment
160160
- deactivate
161161
- cd $niftynet_dir
@@ -188,8 +188,8 @@ pip-installer:
188188
- python $package_importer
189189
# test niftynet command
190190
- ln -s /home/gitlab-runner/environments/niftynet/data/example_volumes ./example_volumes
191-
- net_segmentation train -c $niftynet_dir/config/default_config.ini --net_name toynet --image_size 42 --label_size 42 --batch_size 1 --save_every_n 10
192-
- net_segmentation inference -c $niftynet_dir/config/default_config.ini --net_name toynet --image_size 80 --label_size 80 --batch_size 8
191+
- net_segment train -c $niftynet_dir/config/default_config.ini --net_name toynet --image_size 42 --label_size 42 --batch_size 1 --save_every_n 10
192+
- net_segment inference -c $niftynet_dir/config/default_config.ini --net_name toynet --image_size 80 --label_size 80 --batch_size 8
193193
# deactivate virtual environment
194194
- deactivate
195195
- cd $niftynet_dir

demos/PROMISE12/PROMISE12_Demo_Notebook.ipynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@
5252
"metadata": {},
5353
"source": [
5454
"## Training a network from the command line\n",
55-
"The simplest way to use NiftyNet is via the commandline net_segmentation.py script. Normally, this is done on the command line with a command like this from the NiftyNet root directory:\n",
55+
"The simplest way to use NiftyNet is via the commandline net_segment.py script. Normally, this is done on the command line with a command like this from the NiftyNet root directory:\n",
5656
"\n",
57-
"```python net_segmentation.py train --conf demo/PROMISE12/promise12_demo_train_config.ini --image_size 32 --label_size 32 --max_iter 10```\n",
57+
"```python net_segment.py train --conf demo/PROMISE12/promise12_demo_train_config.ini --image_size 32 --label_size 32 --max_iter 10```\n",
5858
"\n",
5959
"Notice that we use configuration file that is specific to this experiment. This file contains default settings. Also note that we can override these settings on the command line.\n",
6060
"\n",
@@ -78,7 +78,7 @@
7878
"source": [
7979
"Now you have trained (a few iterations of) a deep learning network for medical image segmentation. If you have some time on your hands, you can finish training the network (by leaving off the max_iter argument) and try it out, by running the following command\n",
8080
"\n",
81-
"```python net_segmentation.py inference --conf demo/PROMISE12/promise12_demo_inference_config.ini --image_size 32 --label_size 32```\n",
81+
"```python net_segment.py inference --conf demo/PROMISE12/promise12_demo_inference_config.ini --image_size 32 --label_size 32```\n",
8282
"\n",
8383
"or the following python code in the Notebook"
8484
]
@@ -102,7 +102,7 @@
102102
"source": [
103103
"Otherwise, you can load up some pre-trained weights for the network:\n",
104104
"\n",
105-
"```python net_segmentation.py inference --conf demo/PROMISE12/promise12_demo_config.ini --model_dir demo/PROMISE12/pretrained```\n",
105+
"```python net_segment.py inference --conf demo/PROMISE12/promise12_demo_config.ini --model_dir demo/PROMISE12/pretrained```\n",
106106
"or the following python code in the Notebook"
107107
]
108108
},
@@ -318,7 +318,7 @@
318318
"cell_type": "markdown",
319319
"metadata": {},
320320
"source": [
321-
"You can use helper functions to parse commandline parameters and automatically match patient data (which is what net_segmentation.py did)."
321+
"You can use helper functions to parse commandline parameters and automatically match patient data (which is what net_segment.py did)."
322322
]
323323
},
324324
{

demos/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ To train a "toynet" specified in `network/toynet.py`:
2828
cd NiftyNet/
2929
wget -N https://www.dropbox.com/s/y7mdh4m9ptkibax/example_volumes.tar.gz
3030
tar -xzvf example_volumes.tar.gz
31-
net_segmentation train --net_name toynet \
31+
net_segment train --net_name toynet \
3232
--image_size 42 --label_size 42 --batch_size 1
3333
```
3434
(GPU computing is enabled by default; to train with CPU only please use `--num_gpus 0`)
3535

3636
After the training process, to do segmentation with a trained "toynet":
3737
``` sh
3838
cd NiftyNet/
39-
net_segmentation inference --net_name toynet \
39+
net_segment inference --net_name toynet \
4040
--save_seg_dir ./seg_output \
4141
--image_size 80 --label_size 80 --batch_size 8
4242
```
@@ -51,11 +51,11 @@ Alternatively, to run with a customised config file:
5151
``` sh
5252
cd NiftyNet/
5353
# training
54-
net_segmentation train -c /path/to/customised_config
54+
net_segment train -c /path/to/customised_config
5555
# inference
56-
net_segmentation inference -c /path/to/customised_config
56+
net_segment inference -c /path/to/customised_config
5757
```
5858
where `/path/to/customised_config` implements all parameters listed by running:
5959
```sh
60-
net_segmentation -h
60+
net_segment -h
6161
```

demos/brain_parcellation/run_parcellation.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# please make sure you installed all dependencies of NiftyNet.
44
# cd NiftyNet/; pip install -r requirements-gpu.txt
5-
NIFTYNET=../../net_segmentation.py
5+
NIFTYNET=../../net_segment.py
66

77
DIR="$( cd "$(dirname "$0")" ; pwd -P )"
88
cd "$DIR"
File renamed without changes.

niftynet/network/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,4 @@ image_ size = 57, label_ size = 9, d_ factor = 3
5656
1. Create a `niftynet/network/new_net.py` inheriting `BaseNet` from `niftynet.layer.base_net`
5757
1. Implement `layer_op()` function using the building blocks in `niftynet/layer/` or creating new layers
5858
1. Import `niftynet.network.new_net` to the `NetFactory` class in `niftynet/__init__.py`
59-
1. Train the network with `python net_segmentation.py train -c /path/to/customised_config`
59+
1. Train the network with `python net_segment.py train -c /path/to/customised_config`

pip/long_description.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Acknowledgements
6666
This project is grateful for the support from the `Wellcome Trust`_, the `Engineering and Physical Sciences Research Council (EPSRC)`_, the `National Institute for Health Research (NIHR)`_, the `Department of Health (DoH)`_, `University College London (UCL)`_, the `Science and Engineering South Consortium (SES)`_, the `STFC Rutherford-Appleton Laboratory`_, and `NVIDIA`_.
6767

6868
.. _`TensorFlow`: https://www.tensorflow.org/
69-
.. _`Wellcome EPSRC Centre for Interventional and Surgical Sciences`: http://www.ucl.ac.uk/surgical-interventional-sciences
69+
.. _`Wellcome EPSRC Centre for Interventional and Surgical Sciences`: http://www.ucl.ac.uk/weiss
7070
.. _`NiftyNet source code repository`: https://cmiclab.cs.ucl.ac.uk/CMIC/NiftyNet
7171
.. _`Centre for Medical Image Computing`: http://cmic.cs.ucl.ac.uk/
7272
.. _`Centre for Medical Image Computing (CMIC)`: http://cmic.cs.ucl.ac.uk/

run_application.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import warnings
33
import time
44
warnings.simplefilter('always', DeprecationWarning)
5-
warnings.warn('run_application.py is deprecated and will be removed; please use net_segmentation.py instead.', DeprecationWarning, stacklevel=2)
5+
warnings.warn('run_application.py is deprecated and will be removed; please use net_segment.py instead.', DeprecationWarning, stacklevel=2)
66
warnings.simplefilter('ignore', DeprecationWarning)
77
time.sleep(3)
88

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
info_module.write('"""\n')
2727
info_module.write('\n')
2828
info_module.write('\n')
29-
info_module.write('version = "{}"\n'.format(version_buf))
29+
info_module.write('VERSION_DESCRIPTOR = "{}"\n'.format(version_buf))
3030
info_module.close()
3131

3232
# Regex for checking PEP 440 conformity
@@ -121,7 +121,7 @@
121121

122122
entry_points={
123123
'console_scripts': [
124-
'net_segmentation=niftynet:main',
124+
'net_segment=niftynet:main',
125125
],
126126
},
127127
)

0 commit comments

Comments
 (0)