Skip to content

Commit cd16a13

Browse files
authored
Merge pull request #32 from Project-MONAI/master
merge master
2 parents 42a45e0 + db2dbb0 commit cd16a13

File tree

118 files changed

+2935
-463
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+2935
-463
lines changed

.github/workflows/cron.yml

+34-1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,38 @@ jobs:
5353
fail_ci_if_error: false
5454
file: ./coverage.xml
5555

56+
cron-pt-image:
57+
if: github.repository == 'Project-MONAI/MONAI'
58+
container:
59+
image: nvcr.io/nvidia/pytorch:20.12-py3 # testing with the latest pytorch base image
60+
options: "--gpus all"
61+
runs-on: [self-hosted, linux, x64, common]
62+
steps:
63+
- uses: actions/checkout@v2
64+
- name: Install the dependencies
65+
run: |
66+
which python
67+
python -m pip install --upgrade pip wheel
68+
python -m pip install -r requirements-dev.txt
69+
python -m pip list
70+
- name: Run tests report coverage
71+
run: |
72+
export LAUNCH_DELAY=$[ $RANDOM % 16 * 60 ]
73+
echo "Sleep $LAUNCH_DELAY"
74+
sleep $LAUNCH_DELAY
75+
nvidia-smi
76+
export CUDA_VISIBLE_DEVICES=$(python -m tests.utils)
77+
echo $CUDA_VISIBLE_DEVICES
78+
python -c "import torch; print(torch.__version__); print('{} of GPUs available'.format(torch.cuda.device_count()))"
79+
python -c 'import torch; print(torch.rand(5,3, device=torch.device("cuda:0")))'
80+
BUILD_MONAI=1 ./runtests.sh --coverage
81+
coverage xml
82+
- name: Upload coverage
83+
uses: codecov/codecov-action@v1
84+
with:
85+
fail_ci_if_error: false
86+
file: ./coverage.xml
87+
5688
cron-docker:
5789
if: github.repository == 'Project-MONAI/MONAI'
5890
container:
@@ -61,7 +93,8 @@ jobs:
6193
runs-on: [self-hosted, linux, x64, common]
6294
steps:
6395
- name: Run tests report coverage
64-
# The docker image process has done the compilation. BUILD_MONAI=1 may not be necessary.
96+
# The docker image process has done the compilation.
97+
# BUILD_MONAI=1 is necessary for triggering the USE_COMPILED flag.
6598
run: |
6699
cd /opt/monai
67100
nvidia-smi

Dockerfile

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# See the License for the specific language governing permissions and
1010
# limitations under the License.
1111

12-
ARG PYTORCH_IMAGE=nvcr.io/nvidia/pytorch:20.10-py3
12+
ARG PYTORCH_IMAGE=nvcr.io/nvidia/pytorch:20.12-py3
1313

1414
FROM ${PYTORCH_IMAGE}
1515

@@ -21,7 +21,8 @@ WORKDIR /opt/monai
2121
COPY requirements.txt requirements-min.txt requirements-dev.txt /tmp/
2222
RUN cp /tmp/requirements.txt /tmp/req.bak \
2323
&& awk '!/torch/' /tmp/requirements.txt > /tmp/tmp && mv /tmp/tmp /tmp/requirements.txt \
24-
&& python -m pip install --no-cache-dir --use-feature=2020-resolver -r /tmp/requirements-dev.txt
24+
&& python -m pip install --upgrade --no-cache-dir pip \
25+
&& python -m pip install --no-cache-dir -r /tmp/requirements-dev.txt
2526

2627
# compile ext and remove temp files
2728
# TODO: remark for issue [revise the dockerfile #1276](https://github.com/Project-MONAI/MONAI/issues/1276)

docs/requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
torch>=1.5
33
pytorch-ignite==0.4.2
44
numpy>=1.17
5-
itk
5+
itk>=5.0
66
nibabel
77
parameterized
88
scikit-image>=0.14.2

docs/source/apps.rst

+24
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,27 @@ Applications
2828
.. autofunction:: extractall
2929

3030
.. autofunction:: download_and_extract
31+
32+
`Deepgrow`
33+
----------
34+
35+
.. automodule:: monai.apps.deepgrow.dataset
36+
.. autofunction:: create_dataset
37+
38+
.. automodule:: monai.apps.deepgrow.interaction
39+
.. autoclass:: Interaction
40+
:members:
41+
42+
.. automodule:: monai.apps.deepgrow.transforms
43+
.. autoclass:: AddInitialSeedPointd
44+
:members:
45+
.. autoclass:: AddGuidanceSignald
46+
:members:
47+
.. autoclass:: AddRandomGuidanced
48+
:members:
49+
.. autoclass:: SpatialCropForegroundd
50+
:members:
51+
.. autoclass:: FindDiscrepancyRegionsd
52+
:members:
53+
.. autoclass:: FindAllValidSlicesd
54+
:members:

docs/source/handlers.rst

+3
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ Training stats handler
8585

8686
Tensorboard handlers
8787
--------------------
88+
.. autoclass:: TensorBoardHandler
89+
:members:
90+
8891
.. autoclass:: TensorBoardStatsHandler
8992
:members:
9093

docs/source/losses.rst

+8
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,12 @@ Registration Losses
7474
`GlobalMutualInformationLoss`
7575
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7676
.. autoclass:: GlobalMutualInformationLoss
77+
:members:
78+
79+
Loss Wrappers
80+
--------------
81+
82+
`MultiScaleLoss`
83+
~~~~~~~~~~~~~~~~~
84+
.. autoclass:: MultiScaleLoss
7785
:members:

docs/source/networks.rst

+9-4
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,12 @@ Blocks
120120
.. autoclass:: SubpixelUpSample
121121

122122
`LocalNet DownSample Block`
123-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
123+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
124124
.. autoclass:: LocalNetDownSampleBlock
125125
:members:
126126

127127
`LocalNet UpSample Block`
128-
~~~~~~~~~~~~~~~~~~~~~~~~~~~
128+
~~~~~~~~~~~~~~~~~~~~~~~~~
129129
.. autoclass:: LocalNetUpSampleBlock
130130
:members:
131131

@@ -135,10 +135,15 @@ Blocks
135135
:members:
136136

137137
`Warp`
138-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
138+
~~~~~~
139139
.. autoclass:: Warp
140140
:members:
141141

142+
`DVF2DDF`
143+
~~~~~~~~~
144+
.. autoclass:: DVF2DDF
145+
:members:
146+
142147
Layers
143148
------
144149

@@ -201,7 +206,7 @@ Layers
201206
~~~~~~~~~~~~~~~~
202207
.. autoclass:: GaussianFilter
203208
:members:
204-
209+
205210
`BilateralFilter`
206211
~~~~~~~~~~~~~~~~~
207212
.. autoclass:: BilateralFilter

docs/source/transforms.rst

+18
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,12 @@ IO
237237
:members:
238238
:special-members: __call__
239239

240+
`SaveImage`
241+
"""""""""""
242+
.. autoclass:: SaveImage
243+
:members:
244+
:special-members: __call__
245+
240246
Post-processing
241247
^^^^^^^^^^^^^^^
242248

@@ -702,6 +708,12 @@ IO (Dict)
702708
:members:
703709
:special-members: __call__
704710

711+
`SaveImaged`
712+
""""""""""""
713+
.. autoclass:: SaveImaged
714+
:members:
715+
:special-members: __call__
716+
705717
Post-processing (Dict)
706718
^^^^^^^^^^^^^^^^^^^^^^
707719

@@ -939,6 +951,12 @@ Utility (Dict)
939951
:members:
940952
:special-members: __call__
941953

954+
`RandLambdad`
955+
"""""""""""""
956+
.. autoclass:: RandLambdad
957+
:members:
958+
:special-members: __call__
959+
942960
`LabelToMaskd`
943961
""""""""""""""
944962
.. autoclass:: LabelToMaskd

monai/apps/datasets.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ def __init__(
9494
data = self._generate_data_list(dataset_dir)
9595
if transform == ():
9696
transform = LoadImaged("image")
97-
super().__init__(data, transform, cache_num=cache_num, cache_rate=cache_rate, num_workers=num_workers)
97+
CacheDataset.__init__(
98+
self, data, transform, cache_num=cache_num, cache_rate=cache_rate, num_workers=num_workers
99+
)
98100

99101
def randomize(self, data: Optional[Any] = None) -> None:
100102
self.rann = self.R.random()
@@ -275,7 +277,9 @@ def __init__(
275277
self._properties = load_decathlon_properties(os.path.join(dataset_dir, "dataset.json"), property_keys)
276278
if transform == ():
277279
transform = LoadImaged(["image", "label"])
278-
super().__init__(data, transform, cache_num=cache_num, cache_rate=cache_rate, num_workers=num_workers)
280+
CacheDataset.__init__(
281+
self, data, transform, cache_num=cache_num, cache_rate=cache_rate, num_workers=num_workers
282+
)
279283

280284
def get_indices(self) -> np.ndarray:
281285
"""

monai/apps/deepgrow/__init__.py

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Copyright 2020 - 2021 MONAI Consortium
2+
# Licensed under the Apache License, Version 2.0 (the "License");
3+
# you may not use this file except in compliance with the License.
4+
# You may obtain a copy of the License at
5+
# http://www.apache.org/licenses/LICENSE-2.0
6+
# Unless required by applicable law or agreed to in writing, software
7+
# distributed under the License is distributed on an "AS IS" BASIS,
8+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9+
# See the License for the specific language governing permissions and
10+
# limitations under the License.

0 commit comments

Comments
 (0)