diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2354daee..ed6d0a30 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,8 +8,9 @@ pylintjob: stage: pylint_test except: - 139-correct-toynet-demo-instructions + - 148-publish-niftynet-v0-2-0-on-python-package-index-pypi script: - - pylint --rcfile=pylintrc niftynet/engine + - pylint --rcfile=tests/pylintrc niftynet/engine testjob: stage: dev_test @@ -154,6 +155,7 @@ quicktest: - 147-revise-contribution-guidelines-to-include-github - 150-properly-format-the-bibtex-entry-to-the-ipmi-2017-paper-on-the-main-readme - 139-correct-toynet-demo-instructions + - 148-publish-niftynet-v0-2-0-on-python-package-index-pypi script: # print system info - which nvidia-smi diff --git a/README.md b/README.md index 497ca0c6..ebd59128 100644 --- a/README.md +++ b/README.md @@ -66,12 +66,25 @@ The API reference is available on [Read the Docs][rtd-niftynet]. [rtd-niftynet]: http://niftynet.rtfd.io/ +#### Contributing -### Contributing +Please see the [contribution guidelines](./CONTRIBUTING.md). -Feature requests and bug reports are collected on [Issues](https://cmiclab.cs.ucl.ac.uk/CMIC/NiftyNet/issues). +#### Useful links + +[NiftyNet website][niftynet-io] + +[NiftyNet source code on CmicLab][niftynet-cmiclab] + +[NiftyNet source code mirror on GitHub][niftynet-github] + +NiftyNet mailing list: [nifty-net@live.ucl.ac.uk][ml-niftynet] + +[niftynet-io]: http://niftynet.io/ +[niftynet-cmiclab]: https://cmiclab.cs.ucl.ac.uk/CMIC/NiftyNet +[niftynet-github]: https://github.com/NifTK/NiftyNet +[ml-niftynet]: mailto:nifty-net@live.ucl.ac.uk -Contributors are encouraged to take a look at [CONTRIBUTING.md](./CONTRIBUTING.md). ### Citing NiftyNet diff --git a/doc/source/index.rst b/doc/source/index.rst index 72809451..7e545b82 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -53,6 +53,8 @@ Useful links `NiftyNet source code mirror on GitHub`_ +NiftyNet mailing list: nifty-net@live.ucl.ac.uk + .. _`NiftyNet website`: http://niftynet.io/ .. _`NiftyNet source code on CmicLab`: https://cmiclab.cs.ucl.ac.uk/CMIC/NiftyNet diff --git a/niftynet/engine/sampler_resize.py b/niftynet/engine/sampler_resize.py index 2f7cf817..a2e94411 100755 --- a/niftynet/engine/sampler_resize.py +++ b/niftynet/engine/sampler_resize.py @@ -25,6 +25,7 @@ def __init__(self, reader, data_param, batch_size, + spatial_window_size=(), windows_per_image=1, shuffle_buffer=True, queue_length=10): @@ -44,6 +45,12 @@ def __init__(self, self.reader.shapes, self.reader.tf_dtypes, data_param) + if spatial_window_size: + # override all spatial window defined in input + # modalities sections + # this is useful when do inference with a spatial window + # which is different from the training specifications + self.window.set_spatial_shape(spatial_window_size) tf.logging.info('initialised window instance') self._create_queue_and_ops(self.window, enqueue_size=1, diff --git a/niftynet/engine/windows_aggregator_resize.py b/niftynet/engine/windows_aggregator_resize.py index 9272375d..6e53d2b4 100755 --- a/niftynet/engine/windows_aggregator_resize.py +++ b/niftynet/engine/windows_aggregator_resize.py @@ -69,6 +69,12 @@ def _save_current_image(self, image_out, resize_to): window_shape = resize_to while image_out.ndim < 5: image_out = image_out[..., np.newaxis, :] + if self.window_border and any([b > 0 for b in self.window_border]): + np_border = self.window_border + while len(np_border) < 5: + np_border = np_border + (0,) + np_border = [(b,) for b in np_border] + image_out = np.pad(image_out, np_border, mode='edge') image_shape = image_out.shape zoom_ratio = \ [float(p) / float(d) for p, d in zip(window_shape, image_shape)] diff --git a/pip/long_description.rst b/pip/long_description.rst index f82cc708..c4e8ad63 100644 --- a/pip/long_description.rst +++ b/pip/long_description.rst @@ -78,6 +78,8 @@ Useful links `NiftyNet source code mirror on GitHub`_ +NiftyNet mailing list: nifty-net@live.ucl.ac.uk + .. _`NiftyNet website`: http://niftynet.io/ .. _`NiftyNet source code on CmicLab`: https://cmiclab.cs.ucl.ac.uk/CMIC/NiftyNet diff --git a/pylintrc b/tests/pylintrc similarity index 100% rename from pylintrc rename to tests/pylintrc