Extension for cross-dimensional inference with SlidingWindowInferer
See original GitHub issueIs your feature request related to a problem? Please describe. The request is to have an addition for the SlidingWindowInferer to support inference on, for example, 3D CT scans on a slice-by-slice basis using a 2D model.
Describe the solution you’d like A simple solution exists ofcourse, where the model is run using SimpleInferer on a slice-by-slice basis and then collected. However, adding this support to SlidingWindowInferer will allow it to be more generalized. A single interface can handle the inference for a 3D volume both with 2D and 3D models.
Describe alternatives you’ve considered
I’ve implemented a naive version here: https://github.com/ganslate-team/ganslate/blob/master/ganslate/utils/sliding_window_inferer.py
which looks at the roi_size
and the inputs
and adds a network_wrapper
over the 2D model
Additional context I would be happy to contribute a better solution if this is interesting to a larger set of user.
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (10 by maintainers)
Top GitHub Comments
Hey @Nic-Ma
Thanks for your input - I agree with your suggestion. I’ll send in a PR in the coming days.
Apologies for the inactivity, courtesy of the holidays.
Hi @surajpaib ,
Thanks for your proposals. I would suggest option 2, it’s better to design multiple components for multiple features. Please try to make the usage clear in the doc-string to help users.
Thanks in advance.