Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A bug about extract patches? #6

Open
liuzhisheng1226 opened this issue Jul 6, 2017 · 0 comments
Open

A bug about extract patches? #6

liuzhisheng1226 opened this issue Jul 6, 2017 · 0 comments
Labels

Comments

@liuzhisheng1226
Copy link

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()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants