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

Commit

Permalink
Merge pull request #207 from NifTK/refactoring-data-app
Browse files Browse the repository at this point in the history
window sampler using Dataset APIs and other non-breaking fixes.
  • Loading branch information
wyli authored Sep 11, 2018
2 parents e6de35b + 72e0907 commit a383ba3
Show file tree
Hide file tree
Showing 105 changed files with 2,695 additions and 4,122 deletions.
13 changes: 6 additions & 7 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pylintjob:
- 223-put-bug-fixes-under-fixed-header-in-changelog
script:
- pylint --rcfile=tests/pylintrc niftynet/engine
- pylint --rcfile=tests/pylintrc niftynet/io/image_*py
- pylint --rcfile=tests/pylintrc niftynet/io
- pylint --rcfile=tests/pylintrc niftynet/utilities/user_parameters_*py
- pylint --rcfile=tests/pylintrc niftynet/utilities/download.py
- pylint --rcfile=tests/pylintrc niftynet/utilities/niftynet_global_config.py
Expand All @@ -31,8 +31,8 @@ testjob:
only:
- master
- dev
- refactoring-engine-with-blinker
- tags
- refactoring-data-app
script:
# !!kill coverage in case of hanging processes
- if pgrep coverage; then pkill -f coverage; fi
Expand Down Expand Up @@ -208,8 +208,8 @@ quicktest:
except:
- master
- dev
- refactoring-engine-with-blinker
- tags
- refactoring-data-app
- 147-revise-contribution-guidelines-to-include-github
- 150-properly-format-the-bibtex-entry-to-the-ipmi-2017-paper-on-the-main-readme
- 148-publish-niftynet-v0-2-0-on-python-package-index-pypi
Expand Down Expand Up @@ -261,9 +261,8 @@ pip-installer:
only:
- master
- dev
- refactoring-engine-with-blinker
- tags
- 117-support-for-user-defined-networks-using-pip-installed-niftynet
- refactoring-data-app
script:
# get the shortened version of last commit's hash
- LAST_COMMIT=$(git rev-parse --short HEAD)
Expand Down Expand Up @@ -303,7 +302,7 @@ pip-installer:
- set -e
- cd $venv_dir
# install TF
- pip install tensorflow-gpu==1.9
- pip install tensorflow-gpu==1.10
# install using built NiftyNet wheel
- pip install $niftynet_wheel
# install SimpleITK for package importer test to work properly
Expand Down Expand Up @@ -403,7 +402,7 @@ pip-installer:
- set -e
- cd $venv_dir
# install TF
- pip install tensorflow-gpu==1.9
- pip install tensorflow-gpu==1.10
# install using built NiftyNet wheel
- pip install $niftynet_wheel
# install SimpleITK for package importer test to work properly
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ Please send a merge request with only relevant changes to a particular unit test

### Making a release

NiftyNet versions are numbered following [Semantic Versioning (semver)](http://semver.org/spec/v2.0.0.html).
NiftyNet versions are numbered following [Semantic Versioning (semver)](https://semver.org/spec/v2.0.0.html).
After adding notes for the current release to the [NiftyNet changelog][changelog], the current release should be [tagged][git-tag] with a [PEP440][pep440]-compliant semver number preceded by the letter `v` (for "version").

[pep440]: https://www.python.org/dev/peps/pep-0440/
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ HIG -- High-dimensional Imaging Group, UCL), where BMEIS acts as the consortium
### Installation

1. Please install the appropriate [TensorFlow][tf] package*:
* [`pip install tensorflow-gpu==1.9`][tf-pypi-gpu] for TensorFlow with GPU support
* [`pip install tensorflow==1.9`][tf-pypi] for CPU-only TensorFlow
* [`pip install tensorflow-gpu==1.10`][tf-pypi-gpu] for TensorFlow with GPU support
* [`pip install tensorflow==1.10`][tf-pypi] for CPU-only TensorFlow
1. [`pip install niftynet`](https://pypi.org/project/NiftyNet/)

<sup>All other NiftyNet dependencies are installed automatically as part of the pip installation process.
Expand Down
2 changes: 2 additions & 0 deletions config/default_segmentation.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
csv_file=
path_to_search = ./example_volumes/monomodal_parcellation
filename_contains = T1
filename_removefromid = _T1
filename_not_contains =
spatial_window_size = (20, 42, 42)
interp_order = 3
Expand All @@ -13,6 +14,7 @@ axcodes=(A, R, S)
path_to_search = ./example_volumes/monomodal_parcellation
filename_contains = Label
filename_not_contains =
filename_removefromid = _Label
spatial_window_size = (20, 42, 42)
interp_order = 0
pixdim=(1.0, 1.0, 1.0)
Expand Down
77 changes: 77 additions & 0 deletions config/default_segmentation_bf.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
############################ input configuration sections
[modality1]
csv_file=
path_to_search = ./example_volumes/monomodal_parcellation
filename_contains = T1
filename_not_contains =
spatial_window_size = (20, 42, 42)
interp_order = 3
pixdim=(1.0, 1.0, 1.0)
axcodes=(A, R, S)

[label]
path_to_search = ./example_volumes/monomodal_parcellation
filename_contains = Label
filename_not_contains =
spatial_window_size = (20, 42, 42)
interp_order = 0
pixdim=(1.0, 1.0, 1.0)
axcodes=(A, R, S)

############################## system configuration sections
[SYSTEM]
cuda_devices = ""
num_threads = 2
num_gpus = 1
model_dir = ./models/model_monomodal_toy

[NETWORK]
name = toynet
activation_function = prelu
batch_size = 1
decay = 0.1
reg_type = L2

# volume level preprocessing
volume_padding_size = 21
# histogram normalisation
histogram_ref_file = ./example_volumes/monomodal_parcellation/standardisation_models.txt
norm_type = percentile
cutoff = (0.01, 0.99)
normalisation = False
whitening = False
normalise_foreground_only=True
foreground_type = otsu_plus
multimod_foreground_type = and

queue_length = 20


[TRAINING]
sample_per_volume = 32
rotation_angle =
scaling_percentage =
bf_order = 3
bias_field_range = (-0.5, 0.5)
random_flipping_axes= 1
lr = 0.01
loss_type = Dice
starting_iter = 0
save_every_n = 100
max_iter = 10
max_checkpoints = 20

[INFERENCE]
border = (0, 0, 1)
#inference_iter = 10
save_seg_dir = ./output/toy
output_interp_order = 0
spatial_window_size = (0, 0, 3)

############################ custom configuration sections
[SEGMENTATION]
image = modality1
label = label
output_prob = False
num_classes = 160
label_normalisation = True
2 changes: 1 addition & 1 deletion demos/module_examples/ImageReader.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"source": [
"import sys\n",
"niftynet_path = '/Users/bar/Documents/Niftynet/'\n",
"sys.path.append(niftynet_path)\n",
"sys.path.insert(0, niftynet_path)\n",
"\n",
"from niftynet.io.image_reader import ImageReader"
]
Expand Down
12 changes: 6 additions & 6 deletions demos/module_examples/ImageSampler.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"source": [
"import sys\n",
"niftynet_path = '/Users/foo/Documents/Niftynet/'\n",
"sys.path.append(niftynet_path)\n",
"sys.path.insert(0, niftynet_path)\n",
"\n",
"from niftynet.utilities.download import download\n",
"download('mr_ct_regression_model_zoo_data')\n",
Expand Down Expand Up @@ -101,7 +101,7 @@
],
"source": [
"from niftynet.io.image_reader import ImageReader\n",
"from niftynet.contrib.dataset_sampler.image_window_dataset import ImageWindowDataset\n",
"from niftynet.engine.image_window_dataset import ImageWindowDataset\n",
"\n",
"# creating an image reader.\n",
"data_param = \\\n",
Expand Down Expand Up @@ -258,7 +258,7 @@
],
"source": [
"from niftynet.io.image_reader import ImageReader\n",
"from niftynet.contrib.dataset_sampler.sampler_uniform_v2 import UniformSampler\n",
"from niftynet.engine.sampler_uniform_v2 import UniformSampler\n",
"\n",
"# creating an image reader.\n",
"# creating an image reader.\n",
Expand Down Expand Up @@ -342,7 +342,7 @@
],
"source": [
"from niftynet.io.image_reader import ImageReader\n",
"from niftynet.contrib.dataset_sampler.sampler_grid_v2 import GridSampler\n",
"from niftynet.engine.sampler_grid_v2 import GridSampler\n",
"\n",
"# creating an image reader.\n",
"data_param = \\\n",
Expand Down Expand Up @@ -471,7 +471,7 @@
],
"source": [
"from niftynet.io.image_reader import ImageReader\n",
"from niftynet.contrib.dataset_sampler.sampler_weighted_v2 import WeightedSampler\n",
"from niftynet.engine.sampler_weighted_v2 import WeightedSampler\n",
"\n",
"# creating an image reader.\n",
"data_param = \\\n",
Expand Down Expand Up @@ -588,7 +588,7 @@
],
"source": [
"from niftynet.io.image_reader import ImageReader\n",
"from niftynet.contrib.dataset_sampler.sampler_balanced_v2 import BalancedSampler\n",
"from niftynet.engine.sampler_balanced_v2 import BalancedSampler\n",
"\n",
"# creating an image reader.\n",
"data_param = \\\n",
Expand Down
Loading

0 comments on commit a383ba3

Please sign in to comment.