简体   繁体   English

在 Octave 中读取 tif 文件的问题

[英]Issues with reading tif file in Octave

I am trying to read a medical imaging data which is in .tif format using Octave .我正在尝试使用 Octave 读取.tif格式的医学成像数据。 It so happens that only software from https://fiji.sc/ has the ability to read the medical images I have.碰巧只有来自https://fiji.sc/的软件才能读取我拥有的医学图像。 A sample of the image that I am referring is this one.我所指的图像样本就是 这个 This image is readable in .tif format only in fiji.此图像只能在斐济以.tif格式读取。 The image can also be converted to jpg image.图片也可以转换成jpg图片。 Only after data points is visible to other image editing software.只有在数据点对其他图像编辑软件可见之后。 Now the issue is , I want to load it into octave and read it - at the moment it is not possible.现在的问题是,我想将它加载到八度并阅读它 - 目前这是不可能的。 The imshow() function in octave is not allowing me to visualize the given .tif file. octave 中的imshow()函数不允许我可视化给定的.tif文件。

So, if anybody has experience in reading such file formats please let me know.因此,如果有人有阅读此类文件格式的经验,请告诉我。 Thanks.谢谢。

Your linked image is a 16bit grayscale image, see $ gm identify -verbose hello.tif .您的链接图像是 16 位灰度图像,请参见$ gm identify -verbose hello.tif So lets load it into GNU Octave:所以让我们把它加载到 GNU Octave 中:

img = imread ("hello.tif");
hist (img(:), 200);            # show histogram

图像直方图

Ah!, the main information of your image is in the range 0-600 (probably the image aquisition system used had 11 or 12bit resolution), so lets scale and print this part as color encoded (viridis) image:啊!,您的图像的主要信息在 0-600 范围内(可能使用的图像采集系统具有 11 或 12 位分辨率),因此让我们将此部分缩放并打印为颜色编码(viridis)图像:

imagesc (img, [0 600])
colorbar

带有 viridis 颜色图的 imagesc

Is this what you want?这是你想要的吗? Of course we can also use a gray colormap, try: colormap gray当然我们也可以使用灰色的颜色图,试试: colormap gray

If this still doesn't fit your need you should really explain what you expect to see....如果这仍然不符合您的需要,您应该真正解释您期望看到的内容......

imread() 依靠图像魔术来进行转换,其中一些版本只能以 8 位模式读取 TIFF(给出警告消息),但我不知道何时以及如何发生这种情况。

It works for me using a .raw ṕicture converted to .tif in Fiji.它适用于我在斐济使用转换为 .tif 的 .raw ṕicture。 I am specifically interested in several spectral analysis from my pictures which are taken illuminating with 660 and 850nm.我对我在 660 和 850nm 照明下拍摄的照片中的几种光谱分析特别感兴趣。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM