Skip to content

3581 Enhance slice_channels utility function#3585

Merged
Nic-Ma merged 11 commits intoProject-MONAI:devfrom
Nic-Ma:3581-enhance-onehot
Jan 7, 2022
Merged

3581 Enhance slice_channels utility function#3585
Nic-Ma merged 11 commits intoProject-MONAI:devfrom
Nic-Ma:3581-enhance-onehot

Conversation

@Nic-Ma
Copy link
Copy Markdown
Contributor

@Nic-Ma Nic-Ma commented Jan 5, 2022

Fixes #3581 .

Description

This PR enhanced the slice_channels utility function to select channels on specified dim.

Status

Ready

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.

@Nic-Ma
Copy link
Copy Markdown
Contributor Author

Nic-Ma commented Jan 5, 2022

/black

@Nic-Ma
Copy link
Copy Markdown
Contributor Author

Nic-Ma commented Jan 5, 2022

/build

@Nic-Ma Nic-Ma force-pushed the 3581-enhance-onehot branch from ec468ce to a274e48 Compare January 5, 2022 16:18
@Nic-Ma
Copy link
Copy Markdown
Contributor Author

Nic-Ma commented Jan 5, 2022

/build

@Nic-Ma
Copy link
Copy Markdown
Contributor Author

Nic-Ma commented Jan 5, 2022

Hi @wyli @holgerroth ,

Do you think I also need to enhance the DiceLoss and AsDiscrete transform to support slice_channels in them?
Or just leave this logic to users to call slice_channels directly (current status of this PR)?
I prefer to not change loss and post transform so far.

Thanks in advance.

@Nic-Ma Nic-Ma requested review from ericspod, rijobro and wyli January 5, 2022 16:21
@Nic-Ma Nic-Ma requested a review from wyli January 5, 2022 23:19
@Nic-Ma
Copy link
Copy Markdown
Contributor Author

Nic-Ma commented Jan 5, 2022

/black

@Nic-Ma
Copy link
Copy Markdown
Contributor Author

Nic-Ma commented Jan 5, 2022

/build

@Nic-Ma
Copy link
Copy Markdown
Contributor Author

Nic-Ma commented Jan 6, 2022

Hi @wyli ,

BTW, I think maybe something wrong updated in the CI configs?

Error while finding module specification for 'pip' (AttributeError: module '__main__' has no attribute '__file__')

Thanks.

Copy link
Copy Markdown
Contributor

@wyli wyli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me, I put some minor comments

@wyli
Copy link
Copy Markdown
Contributor

wyli commented Jan 6, 2022

Hi @wyli ,

BTW, I think maybe something wrong updated in the CI configs?

Error while finding module specification for 'pip' (AttributeError: module '__main__' has no attribute '__file__')

Thanks.

looks like it's from setuptools and the new version is yanked https://pypi.org/project/setuptools/60.3.0/

@Nic-Ma
Copy link
Copy Markdown
Contributor Author

Nic-Ma commented Jan 6, 2022

Hi @wyli ,
BTW, I think maybe something wrong updated in the CI configs?

Error while finding module specification for 'pip' (AttributeError: module '__main__' has no attribute '__file__')

Thanks.

looks like it's from setuptools and the new version is yanked https://pypi.org/project/setuptools/60.3.0/

Hi @wyli ,

I see your PR #3597 passed the CI tests, so you have updated something to fix the CI software issue?

Thanks.

@wyli
Copy link
Copy Markdown
Contributor

wyli commented Jan 6, 2022

Hi @wyli ,
BTW, I think maybe something wrong updated in the CI configs?

Error while finding module specification for 'pip' (AttributeError: module '__main__' has no attribute '__file__')

Thanks.

looks like it's from setuptools and the new version is yanked https://pypi.org/project/setuptools/60.3.0/

Hi @wyli ,

I see your PR #3597 passed the CI tests, so you have updated something to fix the CI software issue?

Thanks.

I rerun the tests and it should work fine, I think the error version has been removed by the maintainers.

@Nic-Ma
Copy link
Copy Markdown
Contributor Author

Nic-Ma commented Jan 6, 2022

/black

@Nic-Ma
Copy link
Copy Markdown
Contributor Author

Nic-Ma commented Jan 6, 2022

/build

Copy link
Copy Markdown
Contributor

@wyli wyli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, it looks good to me.

@Nic-Ma Nic-Ma enabled auto-merge (squash) January 6, 2022 23:54
@Nic-Ma Nic-Ma merged commit 91777d0 into Project-MONAI:dev Jan 7, 2022
Can-Zhao pushed a commit to Can-Zhao/MONAI that referenced this pull request Jan 10, 2022
* [DLMED] enhance slice_channels

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] update according to comments

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] update according to comments

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] remove test

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] add flag

Signed-off-by: Nic Ma <[email protected]>
wyli pushed a commit that referenced this pull request Jan 10, 2022
* [DLMED] enhance slice_channels

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] update according to comments

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] update according to comments

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] remove test

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] add flag

Signed-off-by: Nic Ma <[email protected]>
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.

Add support to only keep selected classes in one_hot

2 participants