Giter Club home page Giter Club logo

Comments (1)

loli avatar loli commented on May 23, 2024

Well, extracting patches should be quite straight forward with numpy (remember: each image returned by medpy is, in fact, a numpy array).

You must first consider how to treat incomplete patches. The image won't always have dimension that are multiples of 32 (e.g., shape=363636). What do you do then? You must decide either to accept smaller left-over patches (e.g., shape=444). Or, alternatively, you can pad the patches. Or, third option, cropthe images to a size that is a multiple of 32 in all dimensions.

Next, should the patches be overlapping? And if yes, how far?

You can get some inspiration from Google (https://www.google.de/search?q=numpy+array+patches+extract+3d)

Medpy provides a few patch iterators for special cases: http://loli.github.io/medpy/iterators.html
For you, the CentredPatchIterator might be interesting: equally sized patches, automatically padded and non-overlapping. Us eit like

for patch i CentredPatchIterator(image, (32,32,32), cval=0):
   do_something_with_patch()

I hope I could be of help. If you have further questions, please write directly to my email, since the issue tracker is intended for bugs only.

from medpy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.