Skip to content

3867 fix non intensity error#3871

Merged
wyli merged 6 commits intoProject-MONAI:devfrom
yiheng-wang-nv:3867-enhance-RandKSpaceSpikeNoise
Mar 1, 2022
Merged

3867 fix non intensity error#3871
wyli merged 6 commits intoProject-MONAI:devfrom
yiheng-wang-nv:3867-enhance-RandKSpaceSpikeNoise

Conversation

@yiheng-wang-nv
Copy link
Copy Markdown
Contributor

@yiheng-wang-nv yiheng-wang-nv commented Mar 1, 2022

Signed-off-by: Yiheng Wang [email protected]

Fixes #3867 .

Description

This PR fixes the _set_default_range issue in class RandKSpaceSpikeNoise.

There are two errors in this function:

  1. For numpy based img, np.mean does not have the arg dim (this bug is reported in RandKSpaceSpikeNoise got an unexpected keyword argument 'dim' #3867 , thanks to @mibaumgartner !)
  2. the generated intensity range has the same type as img, if img is saved in GPU, error will be raised in the following self.R.uniform manipulation step.

In addition, this PR adds the test case (none intensity_range) for RandKSpaceSpikeNoise, and the test case (none k_intensity) for KSpaceSpikeNoise.

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 --disttests.
  • In-line docstrings updated.
  • Documentation updated, tested make html command in the docs/ folder.

Signed-off-by: Yiheng Wang <[email protected]>
Signed-off-by: Yiheng Wang <[email protected]>
Copy link
Copy Markdown
Contributor

@Nic-Ma Nic-Ma left a comment

Choose a reason for hiding this comment

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

Hi @rijobro @wyli ,

Looks good to me, but I am not very familiar with the algorithm here, could you please help double confirm it?

Thanks in advance.

@wyli wyli enabled auto-merge (squash) March 1, 2022 10:52
@wyli wyli merged commit 5c56b55 into Project-MONAI:dev Mar 1, 2022
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.

RandKSpaceSpikeNoise got an unexpected keyword argument 'dim'

3 participants