How to extract smaller image patches (3D)?

You might take a look at @KFrank’s inclusive sum suggestion. Depending on your actual operation, this might work.

@Katou2 Yeah, you are right and I’m not sure what the best approach would be.
Maybe a custom extension with a sliding window approach would be the fastest way.