Skip to content

Commit 4e9f5ac

Browse files
committed
Set default of tile reader to defaultFrame in case of z Stacks (registrion view)
1 parent e16b40c commit 4e9f5ac

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

exact/exact/images/views.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1312,7 +1312,10 @@ def image_snapshots(request, image_source, x_coord, y_coord, size_x,size_y):
13121312
if not image_source_obj.image_set.has_perm('read', request.user):
13131313
return HttpResponseForbidden()
13141314

1315-
tile = slide.read_region(location=(int(x_coord-size_x/2), int(y_coord-size_y/2)), level=0, size=(size_x, size_y))
1315+
if (slide.nFrames>0):
1316+
tile = slide.read_region(location=(int(x_coord-size_x/2), int(y_coord-size_y/2)), frame=image_source_obj.defaultFrame, level=0, size=(size_x, size_y))
1317+
else:
1318+
tile = slide.read_region(location=(int(x_coord-size_x/2), int(y_coord-size_y/2)), level=0, size=(size_x, size_y))
13161319

13171320
format='PNG'
13181321
buf = PILBytesIO()

0 commit comments

Comments
 (0)