Add RandomBiasFieldDenoise and fix Colin27 exampleFix/colin27 example #1393
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new transform,
RandomBiasFieldDenoise, and registers it properly within TorchIO so it can be imported using:Additionally, this PR updates the Colin27 dataset usage to avoid a runtime error caused by referencing a non-existent
.subjectattribute.What's Included
RandomBiasFieldDenoiseimplementation underaugmentation/intensity/__init__.pyto expose the new transform viatorchio.transformsvisualize_denoise.py) to test functionalityMotivation
While exploring TorchIO, the class name
RandomBiasFieldDenoiseappeared referenced in internal modules, but no working implementation or import path existed. Attempting to use it resulted in import errors.This PR resolves those issues by:
This helps prevent confusion for users and improves consistency across augmentation transforms.
Testing
The visualization script was executed using:
The script successfully ran and produced before/after image output demonstrating transform behavior.
Additional Notes
This implementation serves as a lightweight placeholder. It may be replaced or extended in the future with a more robust denoising strategy.