Skip to content

Add demo for 2d inference on 3D volume #479

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

Merged
merged 6 commits into from
Dec 16, 2021

Conversation

surajpaib
Copy link
Contributor

@surajpaib surajpaib commented Dec 10, 2021

Add demo for 2d inference on 3D volume

Signed-off-by: Suraj Pai b.pai@maastrichtuniversity.nl

part of #130
Project-MONAI/MONAI#1641
Project-MONAI/MONAI#3458

Description

Tutorial that demonstrates how monai SlidingWindowInferer can be used when a 3D volume input needs to be provided slice-by-slice to a 2D model and finally, aggregated into a 3D volume.

Status

Ready

Add demo for 2d inference on 3D volume

Signed-off-by: Suraj Pai <b.pai@maastrichtuniversity.nl>
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copy link
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, would it be more generic if there's an option for the slicing_axis? so that the user can choose to squeeze to [N, C, H, W] or [N, C, D, W] or [N, C, D, H]

@surajpaib
Copy link
Contributor Author

@wyli Definitely. I'll make the edits soon

@surajpaib
Copy link
Contributor Author

Added a slice_axis argument which allows sliding over D, H and W axis.

@surajpaib surajpaib force-pushed the 2d_inference_3d_volume branch from 41995bb to be74b60 Compare December 11, 2021 20:30
Signed-off-by: Suraj <b.pai@maastrichtuniversity.nl>
@surajpaib surajpaib force-pushed the 2d_inference_3d_volume branch from 5f6c79f to e463f9c Compare December 11, 2021 20:33
Copy link
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.

@wyli wyli enabled auto-merge (squash) December 13, 2021 09:50
@wyli
Copy link
Contributor

wyli commented Dec 13, 2021

thanks, there are some PEP format errors https://github.com/Project-MONAI/tutorials/runs/4504304679?check_suite_focus=true#step:7:130 otherwise we can merge it anytime

Signed-off-by: Suraj <b.pai@maastrichtuniversity.nl>
auto-merge was automatically disabled December 14, 2021 02:28

Head branch was pushed to by a user without write access

@surajpaib
Copy link
Contributor Author

Formatting should be PEP8 compliant now :)

Signed-off-by: Suraj <b.pai@maastrichtuniversity.nl>
@surajpaib
Copy link
Contributor Author

Added assert and changed slice_axis to spatial_dim. I decided to omit the word slice as I think that is evident given the context and the name of the class.

Copy link
Contributor

@Nic-Ma Nic-Ma 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 quick update, looks good to me!

@Nic-Ma Nic-Ma merged commit 4e1e316 into Project-MONAI:master Dec 16, 2021
boneseva pushed a commit to boneseva/MONAI-tutorials that referenced this pull request Apr 21, 2024
* Add demo for 2d inference on 3D volume

Add demo for 2d inference on 3D volume

Signed-off-by: Suraj Pai <b.pai@maastrichtuniversity.nl>

* Add slice_axis to SlidingWindowInferer

Signed-off-by: Suraj <b.pai@maastrichtuniversity.nl>

* Address comments + PEP compliance

Signed-off-by: Suraj <b.pai@maastrichtuniversity.nl>

* Change to spatial_dim + assert

Signed-off-by: Suraj <b.pai@maastrichtuniversity.nl>

Co-authored-by: Wenqi Li <wenqil@nvidia.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.

3 participants