Project-MONAI / Project-MONAI/MONAI

RandAffine translate_range parameter should be relative.

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

Nobody has claimed this yet.

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

Description

Hi,

I'm trying to implement a random translate using MONAI. However, I've noticed the options are a little limited... To formalize a random translate I need to use RandAffine and pass translate_range argument specifying the numbers of pixels to be shifted... I believe this is not a good practice for bigger projects, as passing a relative range to the dimensions would be better.

To explain it in code. Imagine I have a 400x400x400 volume. I want to implement a random translate with range from 0 to 200 pixels (half the pixels in each dimension).

MONAI expects: transforms.RandAffine(prob=1, translate_range=200, padding_mode="zeros")
I believe it would be better to have transforms.RandAffine(prob=1, translate_range=0.5, padding_mode="zeros")

What do you think? Btw is there any other alternative to make a relative translation with MONAI? Or do I need to use another lib?

Thank you :)

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

Start by reviewing MONAI's RandAffine entry point and the current translate_range behavior described in the issue. Define how a relative range should apply across volume dimensions, then validate the expected behavior with focused tests and documentation.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-vision, machine-learning
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 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.