Skip to content

Commit a2700b1

Browse files
authored
Merge pull request #78 from MouseLand/dev
Fix roi/sigma box issue
2 parents 037f43e + 4005944 commit a2700b1

File tree

1 file changed

+30
-30
lines changed

1 file changed

+30
-30
lines changed

facemap/gui/io.py

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -164,44 +164,44 @@ def open_proc(parent, file_name=None):
164164
# whether or not you can move the ROIs
165165
moveable = not parent.processed
166166
if proc["rois"] is not None:
167-
for roi in proc["rois"]:
168-
dy = roi["yrange"][-1] - roi["yrange"][0]
169-
dx = roi["xrange"][-1] - roi["xrange"][0]
167+
for r in proc["rois"]:
168+
dy = r["yrange"][-1] - r["yrange"][0]
169+
dx = r["xrange"][-1] - r["xrange"][0]
170170
pos = [
171-
roi["yrange"][0] + parent.sy[roi["ivid"]],
172-
roi["xrange"][0] + parent.sx[roi["ivid"]],
171+
r["yrange"][0] + parent.sy[r["ivid"]],
172+
r["xrange"][0] + parent.sx[r["ivid"]],
173173
dy,
174174
dx,
175175
]
176-
parent.saturation.append(roi["saturation"])
176+
parent.saturation.append(r["saturation"])
177177
parent.rROI.append([])
178178
parent.reflectors.append([])
179-
if "pupil_sigma" in roi:
180-
psig = roi["pupil_sigma"]
179+
if "pupil_sigma" in r:
180+
psig = r["pupil_sigma"]
181181
parent.pupil_sigma = psig
182-
parent.sigma_box.setText(str(roi["pupil_sigma"]))
182+
parent.sigma_box.setText(str(r["pupil_sigma"]))
183183
else:
184184
psig = None
185185
parent.ROIs.append(
186186
roi.sROI(
187-
rind=roi["rind"],
188-
rtype=roi["rtype"],
189-
iROI=roi["iROI"],
190-
color=roi["color"],
187+
rind=r["rind"],
188+
rtype=r["rtype"],
189+
iROI=r["iROI"],
190+
color=r["color"],
191191
moveable=moveable,
192192
parent=parent,
193-
saturation=roi["saturation"],
193+
saturation=r["saturation"],
194194
pupil_sigma=psig,
195-
yrange=roi["yrange"],
196-
xrange=roi["xrange"],
195+
yrange=r["yrange"],
196+
xrange=r["xrange"],
197197
pos=pos,
198-
ivid=roi["ivid"],
198+
ivid=r["ivid"],
199199
)
200200
)
201201
parent.ROIs[-1].position(parent)
202202

203-
if "reflector" in roi:
204-
for i, reflector_roi in enumerate(roi["reflector"]):
203+
if "reflector" in r:
204+
for i, reflector_roi in enumerate(r["reflector"]):
205205
pos = [
206206
reflector_roi["yrange"][0],
207207
reflector_roi["xrange"][0],
@@ -212,7 +212,7 @@ def open_proc(parent, file_name=None):
212212
]
213213
parent.rROI[-1].append(
214214
roi.reflectROI(
215-
iROI=roi["iROI"],
215+
iROI=r["iROI"],
216216
wROI=i,
217217
pos=pos,
218218
parent=parent,
@@ -225,30 +225,30 @@ def open_proc(parent, file_name=None):
225225
parent.iROI = k - 1
226226
else:
227227
parent.iROI = k
228-
parent.ROIs[-1].ellipse = roi["ellipse"]
228+
parent.ROIs[-1].ellipse = r["ellipse"]
229229
parent.saturation_sliders[1].setValue(
230230
int(parent.saturation[parent.iROI] * 100 / 255)
231231
)
232232
parent.ROIs[parent.iROI].plot(parent)
233233
if parent.processed and k < 5:
234234
parent.plot2_checkboxes[k].setText(
235-
"%s%d" % (parent.typestr[roi["rind"]], kt[roi["rind"]])
235+
"%s%d" % (parent.typestr[r["rind"]], kt[r["rind"]])
236236
)
237237
parent.lbls[k].setText(
238-
"%s%d" % (parent.typestr[roi["rind"]], kt[roi["rind"]])
238+
"%s%d" % (parent.typestr[r["rind"]], kt[r["rind"]])
239239
)
240240
parent.lbls[k].setStyleSheet(
241241
"color: rgb(%s,%s,%s);"
242242
% (
243-
str(int(roi["color"][0])),
244-
str(int(roi["color"][1])),
245-
str(int(roi["color"][2])),
243+
str(int(r["color"][0])),
244+
str(int(r["color"][1])),
245+
str(int(r["color"][2])),
246246
)
247247
)
248-
parent.wroi[k] = kt[roi["rind"]]
249-
kt[roi["rind"]] += 1
250-
parent.proctype[k] = roi["rind"] + 1
251-
parent.col.append(roi["color"])
248+
parent.wroi[k] = kt[r["rind"]]
249+
kt[r["rind"]] += 1
250+
parent.proctype[k] = r["rind"] + 1
251+
parent.col.append(r["color"])
252252
k += 1
253253
parent.kroi = k
254254

0 commit comments

Comments
 (0)