Skip to content

Conversation

@rijobro
Copy link
Contributor

@rijobro rijobro commented Mar 17, 2021

Batch inverse.

part of #1515

Status

Ready

Types of changes

  • Non-breaking change (fix or new feature that would not break existing functionality).
  • 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.

rijobro added 3 commits March 4, 2021 15:50
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
@rijobro rijobro requested review from Nic-Ma, ericspod and wyli March 17, 2021 16:46
@rijobro rijobro mentioned this pull request Mar 17, 2021
6 tasks
rijobro added 6 commits March 17, 2021 17:07
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
@rijobro rijobro added the enhancement New feature or request label Mar 18, 2021
rijobro added 6 commits March 18, 2021 12:17
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
@rijobro
Copy link
Contributor Author

rijobro commented Mar 19, 2021

Hi @Nic-Ma, @wyli, I know it takes a lot of time, but I would really appreciate reviews on this PR, #1793 and #1794 so that I can move onto something else! Thanks in advance

@wyli
Copy link
Contributor

wyli commented Mar 19, 2021

yes, I'm looking into these... @Nic-Ma is taking a few days off, I think he'll be back next Tuesday

@rijobro
Copy link
Contributor Author

rijobro commented Mar 19, 2021

great, thanks!

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! I put some comments inline, still need more time to think and test this. I'm not very familiar with the use cases, I'll look into #1794 to get a complete picture...

transform: InvertibleTransform,
pad_collation_used: bool,
) -> None:
self.data = decollate_batch(data)
Copy link
Contributor

@wyli wyli Mar 19, 2021

Choose a reason for hiding this comment

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

could you help add some tests for random transforms in test_decollate with random prob=0.0?

also, not in this PR but came across an issue in monai.transforms.Decollated that missing a call to super().__init__

_BatchInverseDataset should call super() in its constructor as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added tests and added call to super constructors

for key in data.keys():
transform_key = str(key) + "_transforms"
transform = data[transform_key][-1]
if transform["class"] == "SpatialPadd":
Copy link
Contributor

Choose a reason for hiding this comment

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

this is coupled with the pad_list_data_collate, could we make a special invertible transformPadListDataCollate, so that we could have the __call__ and inverse in one place...what do you think?

Copy link
Contributor Author

@rijobro rijobro Mar 19, 2021

Choose a reason for hiding this comment

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

Done and split into its own PR. Let's merge that first, which will simply the diff of this PR again.

rijobro added 4 commits March 19, 2021 18:29
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
@rijobro rijobro mentioned this pull request Mar 19, 2021
6 tasks
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, looks good to me now.

Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
@rijobro rijobro enabled auto-merge (squash) March 19, 2021 23:12
rijobro added 6 commits March 20, 2021 07:40
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
@rijobro rijobro merged commit a2aeb40 into Project-MONAI:master Mar 20, 2021
@rijobro rijobro deleted the batch_inverse branch March 20, 2021 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants