Skip to content
Snippets Groups Projects
Commit c117f854 authored by tomrink's avatar tomrink
Browse files

minor...

parent 35e254c3
No related branches found
No related tags found
No related merge requests found
...@@ -125,7 +125,7 @@ def run_all(directory, out_directory): ...@@ -125,7 +125,7 @@ def run_all(directory, out_directory):
np.save(out_directory+'label_valid_' + str(cnt), label_valid) np.save(out_directory+'label_valid_' + str(cnt), label_valid)
def run(data_h5f, label_h5f, data_tiles, label_tiles, factor=2): def run(data_h5f, label_h5f, data_tiles, label_tiles, factor=2, border=9):
if label_h5f is None: if label_h5f is None:
label_h5f = data_h5f label_h5f = data_h5f
...@@ -168,7 +168,6 @@ def run(data_h5f, label_h5f, data_tiles, label_tiles, factor=2): ...@@ -168,7 +168,6 @@ def run(data_h5f, label_h5f, data_tiles, label_tiles, factor=2):
i_skip = 3 * mod_tile_width i_skip = 3 * mod_tile_width
i_start = int(mod_num_pixels / 2) - int((num_keep_x_tiles * 3 * mod_tile_width) / 2) i_start = int(mod_num_pixels / 2) - int((num_keep_x_tiles * 3 * mod_tile_width) / 2)
border = 9
num_keep_y_tiles = 16 num_keep_y_tiles = 16
j_skip = 3 * mod_tile_width j_skip = 3 * mod_tile_width
for j in range(num_keep_y_tiles): for j in range(num_keep_y_tiles):
...@@ -181,7 +180,15 @@ def run(data_h5f, label_h5f, data_tiles, label_tiles, factor=2): ...@@ -181,7 +180,15 @@ def run(data_h5f, label_h5f, data_tiles, label_tiles, factor=2):
i_m = i_c + border i_m = i_c + border
i_i = i_m * factor i_i = i_m * factor
nda = mod_data[:, j_m-border:j_m + mod_tile_width+border, i_m:i_m + mod_tile_width] j_stop = j_m + mod_tile_width + border
if j_stop > mod_num_lines - 1:
continue
i_stop = i_m + mod_tile_width + border
if i_stop > mod_num_pixels - 1:
continue
nda = mod_data[:, j_m-border:j_stop, i_m-border:i_stop]
data_tiles.append(nda) data_tiles.append(nda)
nda = img_data[:, j_i:j_i + img_tile_width, i_i:i_i + img_tile_width] nda = img_data[:, j_i:j_i + img_tile_width, i_i:i_i + img_tile_width]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment