You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
for bounding_box in bounding_boxes:
b_x_start = int(bounding_box[0])
b_y_start = int(bounding_box[1])
b_x_end = int(bounding_box[0]) + int(bounding_box[2])
b_y_end = int(bounding_box[1]) + int(bounding_box[3])
X = np.random.random_integers(b_x_start, high=b_x_end,
size=utils.NUM_POSITIVE_PATCHES_FROM_EACH_BBOX)
Y = np.random.random_integers
(b_y_start,high=b_y_end,size=utils.NUM_POSITIVE_PATCHES_FROM_EACH_BBOX)
for x, y in zip(X, Y):
if int(tumor_gt_mask[y, x]) is utils.PIXEL_WHITE:
patch = wsi_image.read_region((x * mag_factor, y * mag_factor), 0, (utils.PATCH_SIZE, utils.PATCH_SIZE))
(x,y) in bounding_box,But read_region can't ensure all patches in bounding_box...
I think you should do following check:
if(x+utils.PATCH_SIZE<b_x_end&&y+utils.PATCH_SIZE<b_y_end&&int(tumor_gt_mask[y,x] is
utils.PIXEL_WHITE):
patch=wsi_iamge.read_region()
The text was updated successfully, but these errors were encountered:
In class PatchExtractor(object):
for bounding_box in bounding_boxes:
b_x_start = int(bounding_box[0])
b_y_start = int(bounding_box[1])
b_x_end = int(bounding_box[0]) + int(bounding_box[2])
b_y_end = int(bounding_box[1]) + int(bounding_box[3])
X = np.random.random_integers(b_x_start, high=b_x_end,
size=utils.NUM_POSITIVE_PATCHES_FROM_EACH_BBOX)
Y = np.random.random_integers
(b_y_start,high=b_y_end,size=utils.NUM_POSITIVE_PATCHES_FROM_EACH_BBOX)
for x, y in zip(X, Y):
if int(tumor_gt_mask[y, x]) is utils.PIXEL_WHITE:
patch = wsi_image.read_region((x * mag_factor, y * mag_factor), 0, (utils.PATCH_SIZE, utils.PATCH_SIZE))
(x,y) in bounding_box,But read_region can't ensure all patches in bounding_box...
I think you should do following check:
if(x+utils.PATCH_SIZE<b_x_end&&y+utils.PATCH_SIZE<b_y_end&&int(tumor_gt_mask[y,x] is
utils.PIXEL_WHITE):
patch=wsi_iamge.read_region()
The text was updated successfully, but these errors were encountered: