Skip to content

Issue with dimensions on output from the "Spleen 3D tutorial" - outputs "Multi-Component" images in ITK-snap #1006

Answered by KumoLiu
carlpe asked this question in General
Discussion options

You must be logged in to vote

Hi @carlpe, you don't need to one-hot your output before SaveImage, it will turn your segmentation into 3 channels, you can simply do it like this:

post_trans = Compose([Activations(softmax=True), AsDiscrete(argmax=True)])
saver = SaveImage(output_dir="./output", output_ext=".nii.gz", output_postfix="seg")

Thanks!

Replies: 3 comments 7 replies

Comment options

You must be logged in to vote
4 replies
@carlpe
Comment options

@carlpe
Comment options

@KumoLiu
Comment options

@carlpe
Comment options

Answer selected by carlpe
Comment options

You must be logged in to vote
1 reply
@KumoLiu
Comment options

Comment options

You must be logged in to vote
2 replies
@KumoLiu
Comment options

@carlpe
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1005 on October 20, 2022 10:04.