Skip to content

Commit ba70ee0

Browse files
committed
zpos sometimes comes as a float, make it an int
1 parent 87697fb commit ba70ee0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

stabilityfuncs.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ def markroi(theinputroi, zpos, roislice, theval):
414414
xend = theinputroi[1][0]
415415
ystart = theinputroi[0][1]
416416
yend = theinputroi[1][1]
417-
roislice[zpos, ystart:yend, xstart:xend] = theval
417+
roislice[int(zpos), ystart:yend, xstart:xend] = theval
418418

419419

420420
def setroilims(xpos, ypos, size):
@@ -435,7 +435,7 @@ def getroisnr(theimage, theroi, zpos):
435435
xend = theroi[1][0]
436436
ystart = theroi[0][1]
437437
yend = theroi[1][1]
438-
thesubreg = theimage[:, zpos, ystart:yend, xstart:xend]
438+
thesubreg = theimage[:, int(zpos), ystart:yend, xstart:xend]
439439
theshape = thesubreg.shape
440440
numtimepoints = theshape[0]
441441
themeans = np.zeros(numtimepoints)
@@ -507,7 +507,7 @@ def getroival(theimage, theroi, zpos):
507507
xend = theroi[1][0]
508508
ystart = theroi[0][1]
509509
yend = theroi[1][1]
510-
theroival = np.mean(theimage[zpos, ystart:yend, xstart:xend])
510+
theroival = np.mean(theimage[int(zpos), ystart:yend, xstart:xend])
511511
return theroival
512512

513513
def qualitytag(thestring, thequality):

0 commit comments

Comments
 (0)