Hello,
That's an excellent question, thank you!
I tested it on my side to see if we'd made a mistake ; and rest assured, everything's fine.
The images are not “entirely black” even in your example of image 181 slice 444.
It's not an easy matter, because managing image intensity on microscopy images is quite special.
Firstly, I've checked with print(np.unique(image_3d_fused[444, :, :]))
and there are 3912
different values inside.
Then, I've tried to plot only plt.imshow(image_3d_fused[444, :, :], cmap='gray')
. And we can see that there is something on the image.
So I looked in detail at the code you share and I think it's related to the management of intensity specific to microscopy images, in particular for 3D images.
When writing the vmax with image_3d_fused.max()
you calculate the max value over the full 3D image and by printing it it's 64057
.
However the max value of a slice is not always the same as the one of the full image and for example the maximum value of the slice 444 (image_3d_fused[444, :, :].max()
) is 7375
.
Then you may write the "slice vmax" then you can see the image:
plt.imshow(image_3d_fused[444, :, :], cmap='gray', vmin=0, vmax=image_3d_fused[444, :, :].max())