-
Hey, I'm trying to create easy to digest outputs where the outline of the model segmentation is overlaid with the original image. What I'm struggling to do is to get the outline to appear in colour (ie yellow) so that is stands out nicely against the greyscale input image. I've tried changing or removing cmap but my lack of skills is showing because of course this affects the entire combined output eg: Does anyone have any advice for how I could best keep the model output/LabelToContour in colour and the input scan in greyscale? Thanks in advance. Here is the code: `
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
You can set the alpha (opacity) on a voxel-by-voxel basis. Normally, you would probably create another array, with the same shape as fig, ax = plt.subplots()
ax.imshow(im, cmap="gray")
ax.imshow(contour, alpha=contour)
ax.set_axis_off()
plt.show() |
Beta Was this translation helpful? Give feedback.
You can set the alpha (opacity) on a voxel-by-voxel basis. Normally, you would probably create another array, with the same shape as
contour
with alpha values between 0 and 1. However, in your case,contour
already contains the correct alphas! (Because you wantalpha=1
wherecontour=1
and 0 elsewhere.)