Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge master #19

Merged
merged 67 commits into from
Feb 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
09638a7
[DLMED] add missing import (#1376)
Nic-Ma Dec 17, 2020
1608b10
adds jpeg (#1379)
wyli Dec 17, 2020
b7ecd7b
[DLMED] add missing arg in GANTrainer (#1383)
Nic-Ma Dec 17, 2020
70be9ab
1198 efficient differentiable bilateral filter (#1375)
charliebudd Dec 18, 2020
36b8302
update contributing and normalis* -> normaliz* (#1388)
rijobro Dec 18, 2020
f20e132
[DLMED] add output_dtype (#1394)
Nic-Ma Dec 28, 2020
a4b1144
with eval_mode(net): (#1384)
rijobro Dec 29, 2020
e2c0ed2
1390 Enhance DynUNet with get_feature_maps API (#1393)
Nic-Ma Dec 30, 2020
0c2411e
adds missing desc (#1403)
wyli Dec 31, 2020
1924b43
part of #926 (#1368)
wyli Jan 4, 2021
115f146
Implement dice cross entropy loss (#1409)
yiheng-wang-nv Jan 6, 2021
a74fef9
Unify visualisation (#1381)
rijobro Jan 6, 2021
5aa5e16
1405 add bending energy loss (#1408)
kate-sann5100 Jan 6, 2021
db831ae
Fix failures from many pulls from hub.docker.com (Done) (#1406)
danielschulz Jan 6, 2021
db7bf89
fixes dockerfile (#1413)
wyli Jan 7, 2021
1f74ca2
Wildcard import (#1411)
rijobro Jan 7, 2021
53c145d
Fixes ci (#1416)
wyli Jan 7, 2021
a4ef691
Improve docker build process (#1419)
IsaacYangSLA Jan 7, 2021
1544d0c
1412 local normalized cross correlation (#1415)
kate-sann5100 Jan 10, 2021
3d5554f
1404 Fixing a few code performance issues (#1423)
de-sh Jan 11, 2021
3ac6957
[DLMED] add more clear doc-string (#1425)
Nic-Ma Jan 11, 2021
d735103
Make master installation clearer (#1426)
rijobro Jan 11, 2021
2e26a33
Refactor the comparison involving `not` (#1427)
deepsource-autofix[bot] Jan 11, 2021
27919e3
ignore versioneer -- deepsource check (#1429)
wyli Jan 11, 2021
0d59289
Remove unnecessary lambda expression (#1428)
deepsource-autofix[bot] Jan 11, 2021
fe28bba
update hashes (#1431)
wyli Jan 12, 2021
50bcaf1
Enhance Rotate90 transform with more check (#1432)
Nic-Ma Jan 12, 2021
70483b6
Update occ sens (#1430)
rijobro Jan 12, 2021
df9bc68
Remove methods with unnecessary super delegation. (#1437)
deepsource-autofix[bot] Jan 12, 2021
85f6283
Refactor unnecessary `else` / `elif` when `if` block has a `return` s…
deepsource-autofix[bot] Jan 12, 2021
a9e3654
1412 global mutual information (#1421)
kate-sann5100 Jan 12, 2021
38aa5dc
remove isort:skip (#1435)
rijobro Jan 12, 2021
d21e712
Refactor unnecessary `else` / `elif` when `if` block has a `raise` st…
deepsource-autofix[bot] Jan 12, 2021
3b20de8
Update occ sens (#1439)
rijobro Jan 13, 2021
da0f0fb
1433 Add TorchVision transform wrapper (#1436)
Nic-Ma Jan 13, 2021
145d31a
Refine Brats transform and add missing transforms docs (#1444)
Nic-Ma Jan 13, 2021
3cb82cf
add aliases to import (#1440)
rijobro Jan 13, 2021
6003c36
update clangformat hash (#1449)
wyli Jan 14, 2021
8084394
909 Drop deprecated APIs in IO transforms (#1448)
Nic-Ma Jan 14, 2021
c0983c4
Remove length check in favour of truthiness of the object (#1445)
deepsource-autofix[bot] Jan 14, 2021
e115d6c
1442 add LocalNet (#1447)
kate-sann5100 Jan 15, 2021
f349180
faster amazon download (#1450)
rijobro Jan 15, 2021
5e020a8
Remove assert statement from non-test files (#1446)
deepsource-autofix[bot] Jan 15, 2021
ec70d96
New simplelayer SavitzkyGolayFilter() and transform SavitzkyGolaySmoo…
crnbaker Jan 15, 2021
bf8f8e2
Exposing c++ PHL Implementation in Python API (#1453)
charliebudd Jan 18, 2021
d2064e0
909 develop ImageDataset to replace NiftiDataset (#1461)
Nic-Ma Jan 18, 2021
b26cc24
1452 warp layer (#1463)
kate-sann5100 Jan 19, 2021
91cb8cd
enhance mednist dataset (#1466)
rijobro Jan 19, 2021
012cf62
[WIP]1442 add LocalNet initialization (#1460)
kate-sann5100 Jan 19, 2021
c9d15f1
1478 Fix TorchScript issue in AHnet (#1479)
Nic-Ma Jan 21, 2021
edbad43
Fix for device config script (#1480)
ericspod Jan 21, 2021
cb7a9a0
[DLMED] fix flake8 issue (#1493)
Nic-Ma Jan 22, 2021
0b7e645
886 Add IterationMetric refer to to the EpochMetric in ignite (#1488)
Nic-Ma Jan 23, 2021
2eada01
Add some details on weekly preview build process (#1494)
IsaacYangSLA Jan 23, 2021
f840fc5
remove decorator double negative (#1490)
rijobro Jan 25, 2021
db8f787
Create CODE_OF_CONDUCT.md; update contact (#1495)
FMCalisto Jan 25, 2021
a2da8a1
1014 learning rate finder (#1454)
rijobro Jan 26, 2021
8fef0e1
1501-enhance-PR-testing-workflow (#1502)
wyli Jan 26, 2021
84826b9
change email (#1510)
rijobro Jan 26, 2021
3025e8d
1501 workflow cleanup (#1511)
wyli Jan 26, 2021
8207e1e
Add more Events for MONAI workflow engines (#1474)
Nic-Ma Jan 27, 2021
f75b67a
1452 adjust-warp-layer-grid-pull-user-case (#1470)
kate-sann5100 Jan 28, 2021
50c4659
[DLMED] add overwrite option (#1513)
Nic-Ma Jan 28, 2021
56c88f6
[DLMED] Enhance MaskIntensityd transform (#1521)
Nic-Ma Jan 29, 2021
b3d063c
886 add MetricsSaver handler to save metrics and details into files (…
Nic-Ma Jan 29, 2021
c435327
unify installation instructions (#1524)
rijobro Jan 29, 2021
a6cb37c
1526-DiceCE (#1527)
wyli Jan 30, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
27 changes: 27 additions & 0 deletions .deepsource.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
version = 1

test_patterns = ["tests/**"]

exclude_patterns = [
"monai/_version.py",
"versioneer.py"
]

[[analyzers]]
name = "python"
enabled = true

[analyzers.meta]
runtime_version = "3.x.x"

[[analyzers]]
name = "test-coverage"
enabled = true

[[analyzers]]
name = "docker"
enabled = true

[[analyzers]]
name = "shell"
enabled = true
12 changes: 12 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Ignore the following files/folders during docker build

__pycache__/
docs/

.coverage
.readthedocs.yml
*.md
*.toml

!README.md

20 changes: 20 additions & 0 deletions .github/workflows/cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: cleanup-workflow

on:
workflow_run:
workflows:
- "build"
types: ["requested"]

jobs:
cancel-duplicated-workflow:
name: "Cancel duplicated workflow"
runs-on: ubuntu-latest
steps:
- uses: potiuk/cancel-workflow-runs@953e057dc81d3458935a18d1184c386b0f6b5738 # tested
name: "Cancel duplicate workflows"
with:
cancelMode: allDuplicates
token: ${{ secrets.GITHUB_TOKEN }}
sourceRunId: ${{ github.event.workflow_run.id }}
skipEventTypes: '["schedule"]'
3 changes: 2 additions & 1 deletion .github/workflows/cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,12 @@ jobs:
cron-docker:
if: github.repository == 'Project-MONAI/MONAI'
container:
image: docker://projectmonai/monai:latest
image: localhost:5000/local_monai:dockerhub # use currently latest, locally available dockerhub image
options: "--gpus all"
runs-on: [self-hosted, linux, x64, common]
steps:
- name: Run tests report coverage
# The docker image process has done the compilation. BUILD_MONAI=1 may not be necessary.
run: |
cd /opt/monai
nvidia-smi
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/setupapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,17 @@ jobs:
ref: master
- name: docker_build
run: |
# build and run original docker image for local registry
docker build -t localhost:5000/local_monai:latest -f Dockerfile .
docker push localhost:5000/local_monai:latest
# build once more w/ tag "latest": remove flake package as it is not needed on hub.docker.com
sed -i '/flake/d' requirements-dev.txt
docker build -t projectmonai/monai:latest -f Dockerfile .
docker login -u projectmonai -p ${{ secrets.DOCKER_PW }}
# also push as tag "dockerhub" to local registry
docker image tag projectmonai/monai:latest localhost:5000/local_monai:dockerhub
docker push localhost:5000/local_monai:dockerhub
# distribute as always w/ tag "latest" to hub.docker.com
echo "${{ secrets.DOCKER_PW }}" | docker login -u projectmonai --password-stdin
docker push projectmonai/monai:latest
docker logout

Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/weekly-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:

jobs:
packaging:
if: github.repository == 'Project-MONAI/MONAI'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -24,12 +25,16 @@ jobs:
sed -i 's/name\ =\ monai$/name\ =\ monai-weekly/g' setup.cfg
echo "__commit_id__ = \"$HEAD_COMMIT_ID\"" >> monai/__init__.py
git diff setup.cfg monai/__init__.py
# build tar.gz and wheel
git config user.name "CI Builder"
git config user.email "monai.miccai2019@gmail.com"
git config user.email "monai.contact@gmail.com"
git add setup.cfg monai/__init__.py
git commit -m "Weekly build at $HEAD_COMMIT_ID"
git tag 0.5.dev$(date +'%y%U')
export YEAR_WEEK=$(date +'%y%U')
echo "Year week for tag is ${YEAR_WEEK}"
if ! [[ $YEAR_WEEK =~ ^[0-9]{4}$ ]] ; then echo "Wrong 'year week' format. Should be 4 digits."; exit 1 ; fi
git tag "0.5.dev${YEAR_WEEK}"
git log -1
git tag --list
python setup.py sdist bdist_wheel

- name: Publish to PyPI
Expand Down
76 changes: 76 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [email protected]. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
11 changes: 10 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ _Pull request early_

We encourage you to create pull requests early. It helps us track the contributions under development, whether they are ready to be merged or not. Change your pull request's title to begin with `[WIP]` until it is ready for formal review.

Please note that, as per PyTorch, MONAI uses American English spelling. This means classes and variables should be: normali**z**e, visuali**z**e, colo~~u~~r, etc.

### Preparing pull requests
To ensure the code quality, MONAI relies on several linting tools ([flake8 and its plugins](https://gitlab.com/pycqa/flake8), [black](https://github.com/psf/black), [isort](https://github.com/timothycrosley/isort)),
static type analysis tools ([mypy](https://github.com/python/mypy), [pytype](https://github.com/google/pytype)), as well as a set of unit/integration tests.
Expand All @@ -58,7 +60,7 @@ pip install -U -r requirements-dev.txt # install the latest tools

License information: all source code files should start with this paragraph:
```
# Copyright 2020 MONAI Consortium
# Copyright 2020 - 2021 MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand All @@ -71,6 +73,13 @@ License information: all source code files should start with this paragraph:

```

##### Exporting modules

If you intend for any variables/functions/classes to be available outside of the file with the edited functionality, then:

- Create or append to the `__all__` variable (in the file in which functionality has been added), and
- Add to the `__init__.py` file.

#### Unit testing
MONAI tests are located under `tests/`.

Expand Down
22 changes: 17 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2020 MONAI Consortium
# Copyright 2020 - 2021 MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand All @@ -11,10 +11,11 @@

ARG PYTORCH_IMAGE=nvcr.io/nvidia/pytorch:20.10-py3

FROM ${PYTORCH_IMAGE} as base
FROM ${PYTORCH_IMAGE}

LABEL maintainer="[email protected]"

WORKDIR /opt/monai
ENV PATH=/opt/tools:$PATH

# install full deps
COPY requirements.txt requirements-min.txt requirements-dev.txt /tmp/
Expand All @@ -23,13 +24,24 @@ RUN cp /tmp/requirements.txt /tmp/req.bak \
&& python -m pip install --no-cache-dir --use-feature=2020-resolver -r /tmp/requirements-dev.txt

# compile ext and remove temp files
COPY . .
# TODO: remark for issue [revise the dockerfile #1276](https://github.com/Project-MONAI/MONAI/issues/1276)
# please specify exact files and folders to be copied -- else, basically always, the Docker build process cannot cache
# this or anything below it and always will build from at most here; one file change leads to no caching from here on...

COPY LICENSE setup.py setup.cfg versioneer.py runtests.sh .gitignore .gitattributes README.md MANIFEST.in ./
COPY tests ./tests
COPY monai ./monai
COPY .git ./.git
RUN BUILD_MONAI=1 FORCE_CUDA=1 python setup.py develop \
&& rm -rf build __pycache__

# NGC Client
WORKDIR /opt/tools
RUN wget -q https://ngc.nvidia.com/downloads/ngccli_cat_linux.zip && \
ARG NGC_CLI_URI="https://ngc.nvidia.com/downloads/ngccli_cat_linux.zip"
RUN wget -q ${NGC_CLI_URI} && \
unzip ngccli_cat_linux.zip && chmod u+x ngc && \
md5sum -c ngc.md5 && \
rm -rf ngccli_cat_linux.zip ngc.md5
# append /opt/tools to runtime path for NGC CLI to be accessible from all file system locations
ENV PATH=${PATH}:/opt/tools
WORKDIR /opt/monai
17 changes: 4 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,14 @@ Its ambitions are:


## Installation
To install [the current release](https://pypi.org/project/monai/):
```bash
pip install monai
```

To install from the source code repository:
To install [the current release](https://pypi.org/project/monai/), you can simply run:

```bash
pip install git+https://github.com/Project-MONAI/MONAI#egg=MONAI
pip install monai
```

Alternatively, pre-built Docker image is available via [DockerHub](https://hub.docker.com/r/projectmonai/monai):
```bash
# with docker v19.03+
docker run --gpus all --rm -ti --ipc=host projectmonai/monai:latest
```

For more details, please refer to [the installation guide](https://docs.monai.io/en/latest/installation.html).
For other installation methods (using the master branch, using Docker, etc.), please refer to [the installation guide](https://docs.monai.io/en/latest/installation.html).

## Getting Started

Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

# -- Project information -----------------------------------------------------
project = "MONAI"
copyright = "2020 MONAI Consortium"
copyright = "2020 - 2021 MONAI Consortium"
author = "MONAI Contributors"

# The full version, including alpha/beta/rc tags
Expand Down
10 changes: 5 additions & 5 deletions docs/source/data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ Generic Interfaces
:members:
:special-members: __getitem__

`ImageDataset`
~~~~~~~~~~~~~~
.. autoclass:: ImageDataset
:members:
:special-members: __getitem__

Patch-based dataset
-------------------
Expand Down Expand Up @@ -104,11 +109,6 @@ PILReader
Nifti format handling
---------------------

Reading
~~~~~~~
.. autoclass:: monai.data.NiftiDataset
:members:

Writing Nifti
~~~~~~~~~~~~~
.. autoclass:: monai.data.NiftiSaver
Expand Down
13 changes: 13 additions & 0 deletions docs/source/handlers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,25 @@ Model checkpoint saver
.. autoclass:: CheckpointSaver
:members:


Metrics saver
-------------
.. autoclass:: MetricsSaver
:members:


CSV saver
---------
.. autoclass:: ClassificationSaver
:members:


Iteration Metric
----------------
.. autoclass:: IterationMetric
:members:


Mean Dice metrics handler
-------------------------
.. autoclass:: MeanDice
Expand Down
2 changes: 1 addition & 1 deletion docs/source/highlights.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ There is a rich set of transforms in six categories: Crop & Pad, Intensity, IO,
### 2. Medical specific transforms
MONAI aims at providing a comprehensive medical image specific
transformations. These currently include, for example:
- `LoadNifti`: Load Nifti format file from provided path
- `LoadImage`: Load medical specific formats file from provided path
- `Spacing`: Resample input image into the specified `pixdim`
- `Orientation`: Change the image's orientation into the specified `axcodes`
- `RandGaussianNoise`: Perturb image intensities by adding statistical noises
Expand Down
Loading