显示具有 NaN 值的 32 位图像 (ImageJ)
Displaying a 32-bit image with NaN values (ImageJ)
我写了一个多语言 3-D 图像去噪 ImageJ 插件,它对图像进行一些操作,returns 去噪后的图像作为一维数组。一维数组包含 NaN 值(在边缘周围)。一维数组被转换回图像堆栈并显示。它只是黑色。我保存了图像堆栈并再次在 ImageJ 中打开它。我将光标移到图像上,看到值发生了应有的变化。在某些地方(我假设是神经元),像素值在 1000-4000 的范围内。然而,整个画面简直就是一片漆黑。这是最后将数组转换为图像堆栈的代码片段:
# Image-denoising routines written in C (this is where the nan values are introduced)
fimg = JNApackage.NativeCodeJNA.NativeCall(InputImgArray, medfiltArray, int(searchradius), int(patchradius), beta , int(x), int(y), int(z))
# Optimal Inverse Anscombe Transform (Some more operations in Jython)
fimg = InverseAnscombe.InvAnscombe(fimg)
InputImg.flush()
outputstack = ImageStack(x, y, z )
for i in xrange(0, z):
# Get the slice at index i and assign array elements corresponding to it.
outputstack.setPixels(fimg[int(i*x*y):int((i+1)*x*y)], i+1)
print 'Preparing denoised image for display '
outputImp = ImagePlus("Output Image", outputstack)
#print "OutputImage Stats:"
Stats = StackStatistics(outputImp)
print "mean:", Stats.mean, "minimum:", Stats.min, "maximum:", Stats.max
outputImp.show()
任何关于发生了什么的帮助?
您的图片显示范围可能设置不正确。
尝试
outputImp.resetDisplayRange()
或
outputImp.setDisplayRange(Stats.min, Stats.max)
有关详细信息,请参阅 ImagePlus
javadoc。
我写了一个多语言 3-D 图像去噪 ImageJ 插件,它对图像进行一些操作,returns 去噪后的图像作为一维数组。一维数组包含 NaN 值(在边缘周围)。一维数组被转换回图像堆栈并显示。它只是黑色。我保存了图像堆栈并再次在 ImageJ 中打开它。我将光标移到图像上,看到值发生了应有的变化。在某些地方(我假设是神经元),像素值在 1000-4000 的范围内。然而,整个画面简直就是一片漆黑。这是最后将数组转换为图像堆栈的代码片段:
# Image-denoising routines written in C (this is where the nan values are introduced)
fimg = JNApackage.NativeCodeJNA.NativeCall(InputImgArray, medfiltArray, int(searchradius), int(patchradius), beta , int(x), int(y), int(z))
# Optimal Inverse Anscombe Transform (Some more operations in Jython)
fimg = InverseAnscombe.InvAnscombe(fimg)
InputImg.flush()
outputstack = ImageStack(x, y, z )
for i in xrange(0, z):
# Get the slice at index i and assign array elements corresponding to it.
outputstack.setPixels(fimg[int(i*x*y):int((i+1)*x*y)], i+1)
print 'Preparing denoised image for display '
outputImp = ImagePlus("Output Image", outputstack)
#print "OutputImage Stats:"
Stats = StackStatistics(outputImp)
print "mean:", Stats.mean, "minimum:", Stats.min, "maximum:", Stats.max
outputImp.show()
任何关于发生了什么的帮助?
您的图片显示范围可能设置不正确。
尝试
outputImp.resetDisplayRange()
或
outputImp.setDisplayRange(Stats.min, Stats.max)
有关详细信息,请参阅 ImagePlus
javadoc。