阅读uint16形象和转换uint8问题

27日视图(30天)
我一直在想我的气管无名动脉瘘管的16位文件转换为一个8位图像在MATLAB。当打开ImageJ看起来很棒。气管无名动脉瘘管的做imread后的值做不过已经看起来很奇怪。所有的像素值非常接近0.5 * 2 ^ 16。后转换为8位我只得到一个灰度图像在像素值在整个图像(128)。
我可以阅读和MATLAB图像用另一种方式吗?或者有更好的方法来把他们从8位16位吗?
请参阅附上的文件。
5个评论
1月
1月 2019年2月12日
编辑:1月 2019年2月12日
“我观察图像值(约32769)的形象。” 现在,请解释如何观察:之前或之后 imadjust 和/或 unit16 吗?的工具?为什么你希望别的吗?你看到了什么:
obj = Tiff (filepath);
Img =阅读(obj);
类(Img)
Img16 = im2uint16 (Img);
imshow (Img16);
ImgD = im2double (Img);
图像(ImgD)

登录置评。

接受的答案

Guillaume
Guillaume 2019年2月12日
据我所知,是没有错的matlab解码图像的方式。这真的很少与强度在32768到32786之间。查看图像与其他图像观众显示相同的形象。
注意,不是 imadjust ,你可以简单的告诉 imshow 按比例显示图像的强度范围:
img = imread (“ch1_561Exc_685Det_Conf.tif”);
imshow (img, [])
不过注意形象50838年和50839年两个私人标签id。快速搜索显示他们ImageJ标签。也许他们影响ImageJ解释图像。因为他们是私人,matlab肯定不知道要做什么。
> >信息= imfinfo (“ch1_561Exc_685Det_Conf.tif”);
> > info.UnknownTags (1) value
ans =
3608年12
> > char (info.UnknownTags (2) value (1:8))
ans =
“IJIJinfo”
> > native2unicode (uint8 (info.UnknownTags (2) value(13:结束),“UTF16”)
ans =
“ExpControl Ch1 {0} BitsPerPixel = 16
ExpControlCh1 {0} DimensionOrder = XYCZT
ExpControlCh1 {0} IsInterleaved = false
ExpControlCh1 {0} IsRGB = false
ExpControlCh1 {0} LittleEndian = true
ExpControlCh1 {0} PixelType = int16
ExpControlCh1 {0} SizeC = 1
ExpControlCh1 {0} SizeT = 1
ExpControlCh1 {0} SizeX = 170
ExpControlCh1 {0} SizeY = 1510
ExpControlCh1 {0} SizeZ = 1
ExpControlCh2 {0} BitsPerPixel = 16
ExpControlCh2 {0} DimensionOrder = XYCZT
ExpControlCh2 {0} IsInterleaved = false
ExpControlCh2 {0} IsRGB = false
ExpControlCh2 {0} LittleEndian = true
ExpControlCh2 {0} PixelType = int16
ExpControlCh2 {0} SizeC = 1
ExpControlCh2 {0} SizeT = 1
ExpControlCh2 {0} SizeX = 170
ExpControlCh2 {0} SizeY = 1510
ExpControlCh2 {0} SizeZ = 1
系列0名= ExpControl Ch1 {0}
系列1名= ExpControl Ch2 {0}
描述=
ExpControlCh1{0}标签= [ExpControl X, Y ExpControl ax₁, Ax2]
ExpControlCh1{0}长度= [e-5 3.3999999686784577 e-6, 3.020000076503493, 1.0, 1.0)
ExpControlCh1 {0} Name = ExpControl Ch1 {0}
ExpControlCh1{0}偏移量= (-3.7999998312443495 e-6 e-6 -6.800000846851617, 0.0, 0.0)
ExpControlCh1 {0} StepLabels = [[]、[] [], []]
ExpControlCh1{0}步骤= [[]、[][],[]]
ExpControlCh2 ={0}标签(ax₁, ExpControl X, Y ExpControl Ax2]
ExpControlCh2 ={0}长度(3.3999999686784577 e-6 e-5 3.020000076503493, 1.0, 1.0)
ExpControlCh2 ={0}名字ExpControl Ch2 {0}
ExpControlCh2 ={0}补偿[e-6 -3.7999998312443495 e-6, -6.800000846851617, 0.0, 0.0)
ExpControlCh2 {0} StepLabels = [[]、[] [], []]
ExpControlCh2 ={0}步骤[[]、[][],[]]
位置= E: \ LundUniversity \ \、显微镜实验\ JonasSTED \ 2018-01-23_DNA_YOYO3_TOTO3 \ 2018-01-23_Selection_2PanelImages_ConfSTED \ 2018-01-23_v02c_ConfSTED_LambdaDNA-TOTO3.msr

答案(1)

奥斯卡·
奥斯卡· 2019年2月12日
我看到imadjust之前这些值。我看到这之后
obj = Tiff (filepath);
我=读(obj);
I_16 = imread (filepath);
我只是看看变量。查看文件之后再次与ImageJ我看到相似的像素值 (约32769) 。然而,如果我把它转换成8位ImageJ像素值从0到100不等。也许有一个更好的方法来把uint16图像像素值从32768年到32786年uint8吗?
否则我就用ImageJ……
我看到这个后1月代码:
Capture2.PNG
谢谢你所有的帮助!

类别

找到更多的在图像类型转换帮助中心文件交换

社区寻宝

找到宝藏在MATLAB中央,发现社区如何帮助你!

开始狩猎!