Skip to content

decollate batch#1624

Merged
rijobro merged 15 commits into
Project-MONAI:masterfrom
rijobro:decollate_batch
Feb 25, 2021
Merged

decollate batch#1624
rijobro merged 15 commits into
Project-MONAI:masterfrom
rijobro:decollate_batch

Conversation

@rijobro

@rijobro rijobro commented Feb 23, 2021

Copy link
Copy Markdown
Contributor

decollate a batch of data

#1515

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 commented Feb 23, 2021

Copy link
Copy Markdown
Contributor Author

this requires #1625

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>

@wyli wyli left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

thanks! this could also be packaged as a post-processing transform? https://github.com/Project-MONAI/MONAI/blob/master/monai/transforms/post/dictionary.py#L33

@rijobro

rijobro commented Feb 24, 2021

Copy link
Copy Markdown
Contributor Author

I've added the Decollated as a post transform, good idea.

@rijobro rijobro enabled auto-merge (squash) February 24, 2021 17:55
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
@Nic-Ma

Nic-Ma commented Feb 25, 2021

Copy link
Copy Markdown
Contributor

Hi @rijobro ,

Thanks for developing this new feature, may I know what's the typical use cases?

@rijobro

rijobro commented Feb 25, 2021

Copy link
Copy Markdown
Contributor Author

Hi @Nic-Ma of course. After the data loader, the data are collated. Images that were C,H,W,[D] become B,C,H,W,[D]. Similarly metadata are merged (e.g., a list of the transforms applied to each image).

To perform the inverse transforms on images, I want to convert them back from B,C,H,W,[D] and collated metadata to a list containing B elements, each element containing C,H,W,[D] images, and only the metadata associated with that image.

My particular use case is for inverse transforms of a batch of images, but I'm sure this isn't the only use case for this functionality (for example, NiftiSaver.save_batch could be rewritten to use it).

@Nic-Ma

Nic-Ma commented Feb 25, 2021

Copy link
Copy Markdown
Contributor

OK, I see, thanks for your explanation.

Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
@rijobro rijobro merged commit 69d9fcc into Project-MONAI:master Feb 25, 2021
@rijobro rijobro deleted the decollate_batch branch February 25, 2021 09:41
@wyli

wyli commented Feb 25, 2021

Copy link
Copy Markdown
Contributor

not sure why it gives a circular import error in the container https://github.com/Project-MONAI/MONAI/runs/1977893666?check_suite_focus=true#step:3:32 I couldn't replicate the issue locally

@rijobro

rijobro commented Feb 25, 2021

Copy link
Copy Markdown
Contributor Author

Hm, so all the different CI builds were OK, but the docker one is causing a problem? Is this using master branch (since it's already merged)?

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