2

I am using both ImageJ and scikit-image to analyze 3D images. My original image is 16-bit and it is very big. I converted 16-bit image to 8-bit image in imageJ so that I can work easily.
Now when I am reading the image with scikit-image module both 16-bit and 8-bit image showing 16-bit only. Can anyone suggest how to read images as 8-bit in scikit-image module?

from skimage import io,color
image = io.imread(files)
Tonechas
  • 13,398
  • 16
  • 46
  • 80
ankit agrawal
  • 301
  • 1
  • 14

1 Answers1

0

You can perform the conversion through integer division (//) or bitwise right shift (>>) followed by type casting.

image = np.uint8(io.imread('Image8bit.tif') >> 8)

or

image = np.uint8(io.imread('Image8bit.tif') // 2**8)
Tonechas
  • 13,398
  • 16
  • 46
  • 80
  • Hi, Thanks for your answer. I am sharing small sample of 8bit 3d image got from ImageJ in this google drive link. https://drive.google.com/file/d/1VFL-C6Jk9JKUYE40uzHu9bAlNLiwdSPE/view – ankit agrawal Mar 20 '19 at 09:30
  • When I am reading this image from skimage it is showing as 16 bit. Can you suggest how to read as it is as 8 bit. – ankit agrawal Mar 20 '19 at 09:34