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

Maisi morphological funcs #7893

Merged
merged 22 commits into from
Jul 2, 2024
Merged

Conversation

Can-Zhao
Copy link
Collaborator

@Can-Zhao Can-Zhao commented Jul 1, 2024

Fixes # .

Description

Maisi morphological funcs

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.

Can-Zhao added 4 commits July 1, 2024 15:50
Signed-off-by: Can-Zhao <canz@nvidia.com>
Signed-off-by: Can-Zhao <canz@nvidia.com>
Signed-off-by: Can-Zhao <canz@nvidia.com>
@mingxin-zheng
Copy link
Contributor

Hi @Can-Zhao , do you think it would be too much work to make this a general transform?

I think erode/dilate is general medical image operations, which may be used elsewhere. So making this a general utility function or transform may be helpful.

Signed-off-by: Can-Zhao <canz@nvidia.com>
@Can-Zhao Can-Zhao marked this pull request as ready for review July 1, 2024 16:26
@Can-Zhao Can-Zhao requested a review from KumoLiu July 1, 2024 16:26
@Can-Zhao
Copy link
Collaborator Author

Can-Zhao commented Jul 1, 2024

Hi @Can-Zhao , do you think it would be too much work to make this a general transform?

I think erode/dilate is general medical image operations, which may be used elsewhere. So making this a general utility function or transform may be helpful.

It's a good idea, but maybe not in this PR...

Can-Zhao added 2 commits July 1, 2024 18:23
Signed-off-by: Can-Zhao <canz@nvidia.com>
Signed-off-by: Can-Zhao <canz@nvidia.com>
@Can-Zhao Can-Zhao requested a review from Nic-Ma July 1, 2024 18:53
@mingxin-zheng
Copy link
Contributor

It's a good idea, but maybe not in this PR...

Okay, we can make these functions in generation today, and in the future, move the implementation to transforms and use the transform in these functions.

Copy link
Contributor

@KumoLiu KumoLiu left a comment

Choose a reason for hiding this comment

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

Thanks for the PR, overall looks good to me. Several comments inline.

monai/apps/generation/maisi/utils/morphological_ops.py Outdated Show resolved Hide resolved
monai/apps/generation/maisi/utils/morphological_ops.py Outdated Show resolved Hide resolved
monai/apps/generation/maisi/utils/morphological_ops.py Outdated Show resolved Hide resolved
monai/apps/generation/maisi/utils/morphological_ops.py Outdated Show resolved Hide resolved
monai/apps/generation/maisi/utils/morphological_ops.py Outdated Show resolved Hide resolved
monai/apps/generation/maisi/utils/morphological_ops.py Outdated Show resolved Hide resolved
monai/apps/generation/maisi/utils/morphological_ops.py Outdated Show resolved Hide resolved
monai/apps/generation/maisi/utils/morphological_ops.py Outdated Show resolved Hide resolved
monai/apps/generation/maisi/utils/morphological_ops.py Outdated Show resolved Hide resolved
tests/test_morphological_ops.py Show resolved Hide resolved
@KumoLiu
Copy link
Contributor

KumoLiu commented Jul 2, 2024

Hi @Can-Zhao, please help take a look at the format issue: https://github.com/Project-MONAI/MONAI/actions/runs/9754160317/job/26920608008?pr=7893#step:7:387. Thanks!

Can-Zhao and others added 7 commits July 2, 2024 04:36
Signed-off-by: Can-Zhao <canz@nvidia.com>
Co-authored-by: YunLiu <55491388+KumoLiu@users.noreply.github.com>
Signed-off-by: Can Zhao <69829124+Can-Zhao@users.noreply.github.com>
Signed-off-by: Can-Zhao <canz@nvidia.com>
Signed-off-by: Can-Zhao <canz@nvidia.com>
Signed-off-by: Can-Zhao <canz@nvidia.com>
Signed-off-by: Can-Zhao <canz@nvidia.com>
pre-commit-ci bot and others added 4 commits July 2, 2024 05:11
Signed-off-by: Can-Zhao <canz@nvidia.com>
Signed-off-by: Can-Zhao <canz@nvidia.com>
Signed-off-by: Can-Zhao <canz@nvidia.com>
docs/source/apps.rst Outdated Show resolved Hide resolved
Signed-off-by: Can-Zhao <canz@nvidia.com>
@Can-Zhao
Copy link
Collaborator Author

Can-Zhao commented Jul 2, 2024

@KumoLiu Have you met this error? File "/workspace/MONAI/monai/utils/misc.py", line 27, in
from distutils.util import strtobool
ModuleNotFoundError: No module named 'distutils'

@Can-Zhao
Copy link
Collaborator Author

Can-Zhao commented Jul 2, 2024

@KumoLiu Have you met this error? File "/workspace/MONAI/monai/utils/misc.py", line 27, in from distutils.util import strtobool ModuleNotFoundError: No module named 'distutils'

Nevermind, forgot I should do "pip install --upgrade --force-reinstall setuptools"

@KumoLiu
Copy link
Contributor

KumoLiu commented Jul 2, 2024

Signed-off-by: Can-Zhao <canz@nvidia.com>
@Can-Zhao
Copy link
Collaborator Author

Can-Zhao commented Jul 2, 2024

Hi @Can-Zhao, please take a look at the ci error: https://github.com/Project-MONAI/MONAI/actions/runs/9755561869/job/26924281793?pr=7893#step:13:19908 Thanks.

I'm confused why it cannot import the func. As python -m tests.test_morphological_ops is runnable on my machine. Nevertheless, I changed the way to import. If not working, I will need your help.

Signed-off-by: Can-Zhao <canz@nvidia.com>
@Can-Zhao
Copy link
Collaborator Author

Can-Zhao commented Jul 2, 2024

@Nic-Ma @KumoLiu These erode and dilate functions are used in both Vista and MAISI. I was wondering if we should move it to somewhere else. If so, which folder would be a good choice? Or we may leave it here for now?

@KumoLiu
Copy link
Contributor

KumoLiu commented Jul 2, 2024

@Nic-Ma @KumoLiu These erode and dilate functions are used in both Vista and MAISI. I was wondering if we should move it to somewhere else. If so, which folder would be a good choice? Or we may leave it here for now?

We can leave it here for now. And as @mingxin-zheng said, when we refactored it to inherit Transform next time, we can move it under transforms folder.
cc @Nic-Ma @ericspod @mingxin-zheng

@Can-Zhao
Copy link
Collaborator Author

Can-Zhao commented Jul 2, 2024

@Nic-Ma @KumoLiu These erode and dilate functions are used in both Vista and MAISI. I was wondering if we should move it to somewhere else. If so, which folder would be a good choice? Or we may leave it here for now?

We can leave it here for now. And as @mingxin-zheng said, when we refactored it to inherit Transform next time, we can move it under transforms folder. cc @Nic-Ma @ericspod @mingxin-zheng

Cool! Then it seems this PR can be merged after passing the tests. Thanks!

@KumoLiu
Copy link
Contributor

KumoLiu commented Jul 2, 2024

/build

@KumoLiu KumoLiu merged commit 410109a into Project-MONAI:dev Jul 2, 2024
28 checks passed
@Can-Zhao Can-Zhao deleted the maisi_mor_canz branch July 2, 2024 16:49
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.

3 participants