Skip to content

Commit

Permalink
add invert function
Browse files Browse the repository at this point in the history
  • Loading branch information
PolarBean authored Apr 10, 2024
1 parent 3db6625 commit 83ddc27
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/Tiling_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
shape = img.shape
#Get the chunk size
chunk_size = 512
#invert the image if neccessary
img = np.invert(img)
#crop the image and save each chunk
for i in range(0, shape[0], chunk_size):
for j in range(0, shape[1], chunk_size):
chunk = img[i:i+chunk_size, j:j+chunk_size]
tiff.imsave("{}/chunk_{}_{}.tif".format(image_outdir,i, j), chunk)
tiff.imsave("{}/chunk_{}_{}.tif".format(image_outdir,i, j), chunk)

0 comments on commit 83ddc27

Please sign in to comment.