Project-MONAI / Project-MONAI/MONAI
Lazy resampling: MetaTensor.applied_operations ends up out of order
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 8.7k
- Forks
- 1.6k
- Avg merge
- 5d 1h
- Merged PRs (30d)
- 20
Description
Describe the bug
When executing pipelines with lazy resampling, the applied_operations list on a MetaTensor instance can end up out of order.
To Reproduce
Steps to reproduce the behavior:
- Run tests/test_integration_lazy_samples.py
- Add a breakpoint at https://github.com/Project-MONAI/MONAI/blob/4f291723c4ce1a1baf7efbd499495b777dfb1869/tests/test_integration_lazy_samples.py#L155
- Examine the state of batch_data and you'll see that the applied operations are out of order. Lambdad is the last transform in the pipeline, but appears as the first element in the pipeline
Correct order:
[SpatialResample, Orientation, RandRotate90d, RandCropByPosNegLabel, RandRotated, RandZoomd, ResizeWithPadOrCrop, Rotate, Lambdad]
Observed order:
[Lambdad, SpatialResample, Orientation, RandRotate90d, RandCropByPosNegLabel, RandRotated, RandZoomd, ResizeWithPadOrCrop, Rotate]
Note that this issue is fixed in #6257
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with tests/test_integration_lazy_samples.py at line 155 and inspect batch_data during the lazy resampling pipeline. Compare the observed applied_operations order with the expected list in the issue, then review the referenced fix in #6257; done means the integration test shows operations in pipeline order.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 20/100