Skip to content

Conversation

@kbressem
Copy link
Contributor

@kbressem kbressem commented Mar 9, 2023

Fixes #6094.

Description

Adds the warn flag to RandCropByLabelClasses. If True the behavior of the class remains unchanged. If False the function will not print a warning if a class is not present in the label.

Types of changes

  • Non-breaking change (fix or new feature that would not break existing functionality).
  • Breaking change (fix or new feature that would cause existing functionality to change).
  • New tests added to cover the changes.
  • Integration tests passed locally by running ./runtests.sh -f -u --net --coverage.
  • Quick tests passed locally by running ./runtests.sh --quick --unittests --disttests.
  • In-line docstrings updated.
  • Documentation updated, tested make html command in the docs/ folder.

kbressem added 2 commits March 8, 2023 21:19
Signed-off-by: kbressem <kenobressem@gmail.com>
Signed-off-by: Keno <37253540+kbressem@users.noreply.github.com>
@kbressem kbressem marked this pull request as ready for review March 9, 2023 02:36
Signed-off-by: kbressem <kenobressem@gmail.com>
@kbressem kbressem marked this pull request as draft March 9, 2023 02:58
Signed-off-by: kbressem <kenobressem@gmail.com>
@wyli
Copy link
Contributor

wyli commented Mar 9, 2023

please also change the dictionary version

class RandCropByLabelClassesd(Randomizable, MapTransform, LazyTransform, MultiSampleTrait):

@kbressem kbressem marked this pull request as ready for review March 9, 2023 12:27
Signed-off-by: kbressem <kenobressem@gmail.com>
@wyli
Copy link
Contributor

wyli commented Mar 9, 2023

/build

@wyli wyli enabled auto-merge (squash) March 9, 2023 13:14
@wyli wyli merged commit 354c9c2 into Project-MONAI:dev Mar 9, 2023
@kbressem kbressem mentioned this pull request Mar 10, 2023
7 tasks
wyli pushed a commit that referenced this pull request Mar 11, 2023
Avoids crashing of the function if `ratios_[i] = 0` cannot be updated

Fixes #6121 

### Description

Adds additional if statement to check if warn is true, so that the
following code can still be executed.

### Types of changes
<!--- Put an `x` in all the boxes that apply, and remove the not
applicable items -->
- [x] Non-breaking change (fix or new feature that would not break
existing functionality).
- [ ] Breaking change (fix or new feature that would cause existing
functionality to change).
- [ ] New tests added to cover the changes.
- [ ] Integration tests passed locally by running `./runtests.sh -f -u
--net --coverage`.
- [ ] Quick tests passed locally by running `./runtests.sh --quick
--unittests --disttests`.
- [ ] In-line docstrings updated.
- [ ] Documentation updated, tested `make html` command in the `docs/`
folder.

---------

Signed-off-by: kbressem <kenobressem@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make the RandCropByLabelClassesd Warnings optional

2 participants