yfukai/m2stitch

Stitched image in example is in strange format.

Closed this issue · 3 comments

Hi! I am trying to use m2stitch and have a problem in example. Stitched image (as well as images from testimages.npy) has negative values in pixels, moreover they are in float16 format. How to visualize them? Are these values are standardized or something?

Hi thanks @Fredpeperoni for your comment! The stitch_images function will return the position of the tiles, and we need to stitch the image using that data. A simple example is shown in https://m2stitch.readthedocs.io/en/latest/usage.html . If you could paste the piece of code you're running, I might be able to help you more.

Oh I guess you meant the stitching_example.py ... Let me check it then.

Hi, @Fredpeperoni ! I think I normalized the original image, and save it as np.float16 to save some space in the repo... to visualize it, you have two options:

  • using matplotlib :
from matplotlib import pyplot as plt
plt.imshow(stitched_image)
  • saving as a TIFF or something by scikit-image
from skimage.io import imsave
imsave("stitched_image.tiff",stitched_image.astype(np.float32))
# visualize by your favorite viewer

I hope this helps!