Skip to content

Spike (Herringbone) artifact transform#2337

Merged
wyli merged 17 commits intoProject-MONAI:devfrom
yanielc:Spikes_transform
Jun 22, 2021
Merged

Spike (Herringbone) artifact transform#2337
wyli merged 17 commits intoProject-MONAI:devfrom
yanielc:Spikes_transform

Conversation

@yanielc
Copy link
Copy Markdown
Contributor

@yanielc yanielc commented Jun 8, 2021

Description

Implementation of a transform to apply k-space spike artifacts on MRI images. Two versions of the transform were added to the transforms/intensity/array.py file: a deterministic and a random version which serves as a naturalistic data augmentation tool.

Spike artifacts is one of the types of artifacts which appear naturally during data acquisition. More information can be found in these two sources:
AAPM/RSNA physics tutorial for residents: fundamental physics of MR imaging.
Body MRI artifacts in clinical practice: A physicist's and radiologist's perspective.

I can add the dictionary-style counterparts as well. [update: this is now in place]

Example of application on brain MRI images:

Screen Shot 2021-06-08 at 9 53 29 PM

Status

ready

Types of changes

  • Non-breaking change (fix or new feature that would not break existing functionality).
  • Breaking change (fix or new feature that would cause existing functionality to change).
  • New tests added to cover the changes.
  • Integration tests passed locally by running ./runtests.sh -f -u --net --coverage.
  • Quick tests passed locally by running ./runtests.sh --quick --unittests.
  • In-line docstrings updated.
  • Documentation updated, tested make html command in the docs/ folder.

yanielc added 6 commits June 8, 2021 22:24
Signed-off-by: Yaniel Cabrera <[email protected]>
Signed-off-by: Yaniel Cabrera <[email protected]>
Signed-off-by: Yaniel Cabrera <[email protected]>
Signed-off-by: Yaniel Cabrera <[email protected]>
Signed-off-by: Yaniel Cabrera <[email protected]>
Signed-off-by: Yaniel Cabrera <[email protected]>
@Nic-Ma
Copy link
Copy Markdown
Contributor

Nic-Ma commented Jun 8, 2021

Hi @yanielc ,

Thanks for your implementation of this new transform. I have 2 minor comments:

  1. Could you please help add the new transforms to the docs page: https://github.com/Project-MONAI/MONAI/blob/dev/docs/source/transforms.rst
  2. Do you plan to also implement the dict version of these transforms?

Thanks.

@yanielc
Copy link
Copy Markdown
Contributor Author

yanielc commented Jun 9, 2021

Hi @yanielc ,

Thanks for your implementation of this new transform. I have 2 minor comments:

  1. Could you please help add the new transforms to the docs page: https://github.com/Project-MONAI/MONAI/blob/dev/docs/source/transforms.rst
  2. Do you plan to also implement the dict version of these transforms?

Thanks.

Hi @Nic-Ma,

I plan to add the dictionary style versions in this pull request as well. I just wanted to get some feedback before adding them all.

I will add the four transforms to the documentation pages.

Thanks.

@rijobro
Copy link
Copy Markdown
Contributor

rijobro commented Jun 14, 2021

There are a few transforms now that operate in k-space (including your previous Gibbs transform). Do you think you could abstract out the FFT and iFFT to a common function to reduce code duplication?

You may also remember that in your Gibbs PR, you originally used torch for the FFT/iFFT, but I recommended that we switch to numpy because the functionality didn't exist in older versions of PT. I've since learnt that elsewhere in MONAI (e.g., HilbertTransform), we use the torch version and then in the testing, we skip if the functionality isn't present. Might be worth bearing in mind if we unify all FFT/iFFT functionality.

Signed-off-by: Yaniel Cabrera <[email protected]>
@yanielc
Copy link
Copy Markdown
Contributor Author

yanielc commented Jun 14, 2021

There are a few transforms now that operate in k-space (including your previous Gibbs transform). Do you think you could abstract out the FFT and iFFT to a common function to reduce code duplication?

You may also remember that in your Gibbs PR, you originally used torch for the FFT/iFFT, but I recommended that we switch to numpy because the functionality didn't exist in older versions of PT. I've since learnt that elsewhere in MONAI (e.g., HilbertTransform), we use the torch version and then in the testing, we skip if the functionality isn't present. Might be worth bearing in mind if we unify all FFT/iFFT functionality.

I was thinking the same about a possible super class for the Fourier transforms. I would not mind writing the code and rewriting the Gibbs and Spikes transforms to inherit from the new class. To compartmentalize the work more, can I make those changes on a different pull request right after this PR is done?

Thanks for the heads up on skipping the functionality option for the older Pytorch tests.

@yanielc
Copy link
Copy Markdown
Contributor Author

yanielc commented Jun 19, 2021

Hi @Nic-Ma and other reviewers, just letting you know that the PR is ready for review.

@wyli wyli force-pushed the Spikes_transform branch from c125938 to 4214d93 Compare June 22, 2021 21:09
Copy link
Copy Markdown
Contributor

@wyli wyli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks! (sorry for the delay)

@wyli wyli enabled auto-merge (squash) June 22, 2021 21:12
@wyli wyli merged commit 88fe0fc into Project-MONAI:dev Jun 22, 2021
@yanielc yanielc deleted the Spikes_transform branch February 6, 2022 17:48
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.

4 participants