I assume you are able to train your model and are probably using the CrossEntropyLoss, since your model seems to return logits.
Now you would like to compare your model output visually with the target?
Could you give me a hint on your output size for your 3D images? I will try to create a sample for 2D images.
You could try the following:
# Your model output (assuming you have 2 channels)
output = Variable(torch.randn(1, 2, 24, 24))
pred_prob = F.softmax(output, dim=1)[:, 1]
pred = pred_prob > 0.5

plt.imshow(pred.data.numpy()[0, ...])

Let me know, if this helps you or if I misunderstood your question!