你好,我正在尝试运行以下代码:
plt.figure()
subplotsize = np.ceil(np.sqrt(len(localpeaks)))
imRawMovie = io.imread('DNAPAINT_substack.tiff')
singleFrameRawMovie = imRawMovie[30,:,:]
for l in range(0, len(localpeaks)):
#Extract the ROI - we know it is centered around the localpeaks[l,:] position, with radius ROIradius
ROI = singleFrameRawMovie[localpeaks[l,0]-ROIradius:localpeaks[l,0]+ROIradius+1,
localpeaks[l,1]-ROIradius:localpeaks[l,1]+ROIradius+1]
#Show the ROIs in a subplot image
plt.subplot(subplotsize,subplotsize,l+1)
plt.imshow(ROI,cmap='gray')
我得到一个关于整数的错误。有人能帮我解决这个问题吗?我也附上了错误Image of the error的屏幕截图
我试过查找错误,但失败了
1条答案
按热度按时间von4xj4u1#
np.ceil()
返回float
,而不是int
。使用math.ceil()
。