Project-MONAI / Project-MONAI/MONAI

Add random sorting option to GridPatch and RandGridPatch

Open
#6,699 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature request
Dominant language
Python
Stars
8.7k
Forks
1.6k
Avg merge
5d 1h
Merged PRs (30d)
20

Description

Hi,

I would like to propose adding a random sorting option to the sort_fn argument in GridPatch and RandGridPatch. So far, both only accept sorting the extracted patches based on the sum of their intensity or in their default order. That is fine if one wants to train their model using all image patches but poses an issue if only a subset of patches fits into memory as the model only ever sees the same patches, ignoring the remaining ones.

It would be great if the option could be added to the code base. I would also be open to make it my first contribution to this great library :)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the GridPatch and RandGridPatch implementations and inspect how their sort_fn argument currently handles intensity-sum and default ordering. Add a random sorting option that can vary which patches are selected across runs, then run the existing tests for these transforms and confirm the option works for both classes.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.