Skip to content

A utility function to generate sampling points #6704

@wyli

Description

@wyli

Is your feature request related to a problem? Please describe.
Currently there are a few functions in monai.transforms to help sampling image patches:

  1. map_classes_to_indices to identify all feasible sampling indices
  2. generate_label_classes_crop_centers to subsample and generate spatial coordinates
  3. RandCropByLabelClasses combines 1, 2 and output image patches

Describe the solution you'd like

Would be great to have a helper function to run step 1 and 2 as a single command. The function should output sampling coordinates instead of the final patch

Describe alternatives you've considered

Write the logic with multiple commands: https://gist.github.com/wyli/50c65e686beaf418a32c9cc131f0bdc7

Same idea applies to the other sampling transforms such as RandCropByPosNegLabel

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions