Skip to content

Conversation

@Anil970198
Copy link

This pull request introduces a new transform, RandomBiasFieldDenoise, and registers it properly within TorchIO so it can be imported using:

from torchio.transforms import RandomBiasFieldDenoise

Additionally, this PR updates the Colin27 dataset usage to avoid a runtime error caused by referencing a non-existent .subject attribute.


What's Included

  • Added RandomBiasFieldDenoise implementation under augmentation/intensity/
  • Updated __init__.py to expose the new transform via torchio.transforms
  • Fixed Colin27 example to correctly access the dataset via indexing
  • Added a small visualization script (visualize_denoise.py) to test functionality

Motivation

While exploring TorchIO, the class name RandomBiasFieldDenoise appeared 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:

  • Adding a functional implementation,
  • Ensuring proper registration in import paths,
  • Fixing an example affected by the missing import.

This helps prevent confusion for users and improves consistency across augmentation transforms.


Testing

The visualization script was executed using:

python visualize_denoise.py

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.

@fepegar
Copy link
Member

fepegar commented Dec 6, 2025

@Anil970198, can you explain these changes? Were these commits created by a bot?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants