From 83ddc2785118f6b5714dc0a1722af8f0e8f130b0 Mon Sep 17 00:00:00 2001 From: Harry Carey <38996929+PolarBean@users.noreply.github.com> Date: Wed, 10 Apr 2024 13:06:59 +0200 Subject: [PATCH] add invert function --- scripts/Tiling_script.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/Tiling_script.py b/scripts/Tiling_script.py index fd12fff..c3c65f4 100644 --- a/scripts/Tiling_script.py +++ b/scripts/Tiling_script.py @@ -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) \ No newline at end of file + tiff.imsave("{}/chunk_{}_{}.tif".format(image_outdir,i, j), chunk)