Skip to content

Local Patch Shuffle Transform Initial Version Added #2757

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Aug 26, 2021

Conversation

finalelement
Copy link
Collaborator

@finalelement finalelement commented Aug 12, 2021

Signed-off-by: vnath [email protected]

Description

This pull request for adding the Pixel Shuffle Transform. So far I've added the transform for local patch shuffling in the transform/spatial/array

It needs some testing and also simultaneous feedback as how to port it for the dictionary version of it

part of #2701
Also needs test cases.

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.

@wyli
Copy link
Contributor

wyli commented Aug 12, 2021

/black

@wyli
Copy link
Contributor

wyli commented Aug 13, 2021

thanks Vish, this looks like a nice starting point. just a reminder that there is still a style error: https://github.com/Project-MONAI/MONAI/pull/2757/checks?check_run_id=3316962486#step:7:116. for the shuffling, looks like the following is efficient as well https://stackoverflow.com/questions/22426609/shuffle-a-numpy-array:

>>> a = np.arange(9).reshape((3,3))
>>> a
array([[0, 1, 2],
       [3, 4, 5],
       [6, 7, 8]])
>>> np.random.shuffle(a.flat)
>>> a
array([[3, 5, 8],
       [7, 6, 2],
       [1, 4, 0]])

Also, the implementation currently supports 3d, but I think we could extend to support N-d input in the future.

@bhashemian
Copy link
Member

bhashemian commented Aug 23, 2021

Does it work only for 3D? what happen if we use it on 2D?

Copy link
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, this is an initial patch shuffle, will need followups for the dictionary version and have ND support.

@wyli wyli enabled auto-merge (squash) August 26, 2021 18:22
@wyli wyli merged commit 3eb71c7 into Project-MONAI:dev Aug 26, 2021
wyli pushed a commit to Borda/MONAI that referenced this pull request Aug 27, 2021
* Local Patch Shuffle Transform Initial Version Added

Signed-off-by: vnath <[email protected]>
@finalelement finalelement deleted the aug_pixshuf branch May 13, 2022 01:14
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.

3 participants