Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Overlay two labels into a dual channel label #7796

Closed
wxr521314 opened this issue May 23, 2024 · 2 comments
Closed

Overlay two labels into a dual channel label #7796

wxr521314 opened this issue May 23, 2024 · 2 comments

Comments

@wxr521314
Copy link

I have data.nii.gzl. Label.nii.gz and label_2.nii.gz, I would like to add label.nii.gz, Label_2.nii.gz is superimposed into a two channel data. Can LoadNiftid be automatically completed? What should I do?

@wxr521314
Copy link
Author

I have a dual channel 128 * 128 * 128 data, and I use EnsureChannelFirst(), torch.Size ([1, 2, 128, 128, 128, 1]), why is there an extra dimension? It shouldn't be torch.Size ([1, 2, 128, 128, 128,]) correct?

@KumoLiu
Copy link
Contributor

KumoLiu commented May 24, 2024

I have data.nii.gzl. Label.nii.gz and label_2.nii.gz, I would like to add label.nii.gz, Label_2.nii.gz is superimposed into a two channel data. Can LoadNiftid be automatically completed? What should I do?

You can use ConcatItemsd to help you concate.

class ConcatItemsd(MapTransform):

I have a dual channel 128 * 128 * 128 data, and I use EnsureChannelFirst(), torch.Size ([1, 2, 128, 128, 128, 1]), why is there an extra dimension? It shouldn't be torch.Size ([1, 2, 128, 128, 128,]) correct?

EnsureChannelFirst is used to ensure the channel dim first, if you already have 2 as your channel dim, no need to add this transform.

Thanks.
(Move to discussion as more like a usage issue.)

@Project-MONAI Project-MONAI locked and limited conversation to collaborators May 24, 2024
@KumoLiu KumoLiu converted this issue into discussion #7801 May 24, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants