当前位置: 首页 > 工具软件 > raw2tiff > 使用案例 >

matlab将raw转为tiff,使用Matlab将tiff转换为dicom(Convert tiff to dicom using Matlab)

蒋阳华
2023-12-01

使用Matlab将tiff转换为dicom(Convert tiff to dicom using Matlab)

我有一系列的dicom图像并且使用MATLAB脚本更改了图像中的MATLAB ,然后我将它们导入ImageJ进行显示。 然后我意识到我可以使用ImageJ gui修改图像(更简单,只需移动鼠标)。 但是,当我在ImageJ保存修改后的图像时,它们以tiff格式保存。 我的问题是,有没有办法将imageJ中的图像保存为dicom格式? 或者是否可以使用MATLAB将tiff格式转换为dicom?

有什么建议吗?

I have a series of dicom images and did change the HUs in the images using MATLAB scripts, then I imported them in ImageJ for display. Then I realised I can modify the images using ImageJ gui (which much easier, just moving the mouse). However, when I saved the modified images in ImageJ, they were saved in tiff format. My question is that, is there a way to save images in imageJ as dicom format ? or is there away to convert tiff format to dicom using MATLAB ?

Any suggestion ?

原文:https://stackoverflow.com/questions/30338697

更新时间:2019-11-13 14:11

相关问答

如果您正在处理单色图像,则可以如下设置最小像素值与最大像素值之间的线性缩放比例: img = dicomread('filename');

imshow(img, [minAllowedPixValue maxAllowedPixValue]);

或者,您可以在全动态范围内显示图像: imshow(img, []);

If you are dealing with monochrome images, you can set a linear scaling between a minimum

...

好,所以它们嵌套在可能是供应商特定的结构条目中。 当在Matlab中加载时,嵌套的名称是inf.PerFrameFunctionalGroupsSequence.Item_X。 ,然后framenumber,然后更多的嵌套,这是更直接/自我解释,所以我不需要在这里添加它。 但是在那里搜索你需要的条目。 切片间距称为SpacingBetweenSlices (或单切片情况下的切片厚度),像素间距称为PixelSpacing ,然后是用于翻译的ImagePositionPatient和用于旋转的Ima

...

在默认情况下,ImageJ使用DICOM头中的Window Center和Window Width标签在显示原始像素数据之前对窗口和电平对比度进行调整 ,而MATLAB代码则使用显示器的全部数据范围。 从ImageJ用户指南中获取 : 16 DICOM图像的显示范围 使用DICOM图像,ImageJ根据窗口中心 (0028,1050)和窗口宽度 (0028,1051)标签设置初始显示范围。 单击W&L或B&C窗口上的重置 ,显示范围将设置为最小和最大像素值。 因此,将ImageJ设置为使用全范围的

...

您可以使用FEX vol3d-v2中的以下文件。 you can use the following file from the FEX vol3d-v2.

如果你想添加均匀分布的随机整数,你应该去randi 所以例如这段代码: img(1:410,1:410)= img(1:410,1:410) +randi([3000 3100],410,410);

将现有图像伪随机均匀分布的整数从3000添加到3100。 If you want to add random integers uniformly distributed, you should go for randi so for example this code: img(1:410,1:4

...

您的问题的解决方案是只读取相关的tiff页面(即奇数页面)并将它们保存在单独的文件中。 这可以按如下方式完成: %defines path to input and output files

inputFileName = '';

outFileName = 'out.tiff';

%reads tiff file info

tiffData= imfinfo(inputFileName);

%reads every odd page and append i

...

自编写代码示例以来,调用montage函数的语法已经改变(早在2002年!)。 如文件交换提交的注释部分中所示, 样本DICOM数据文件的新正确语法如下: montage(X, 'DisplayRange', []);

因为新语法解释了montage(X, []);所以你得到了这个错误montage(X, []); 好像X是一个索引的彩色图像(根据错误不允许是带符号的int16类型),带有空的颜色图[] 。 The syntax for calling the montage function

...

如果你的矩阵是M,并且有d维(3,或者你有什么),并且你想要绘制其中一个维度的1-D“切片”,那么: plot(squeeze(M(n1,n2, ...,:,...));

其中n1,n2,...是要切片的维度x,y,...的位置,运算符(:)是要绘制的维度。 例如,给定5维矩阵M = rand(10,10,10,10,10),让我们围绕某些点切割第4维(x = n1,y = n2等......) M=rand(10,10,10,10,10);

n1=4; n2=7; n3=3;

...

我已经通过创建GUI(R2012b)并在按钮回调中插入代码来测试代码,并且它工作正常。 所以我可以看到两种可能性: - 您加载的dcom图像以某种方式被损坏 - dcom图像良好,并且是contrast概率 我会去寻求第二种可能性。 作为示例,我使用了从DICOM样本图像集下载的dcom图像“CARDIX”。 当这些图像中的一个被加载时,它看起来是黑色的,轴的clim是[0 65535 ]。 如果分别将clim范围设置为dcom图像数据值的minimum和maximum ,则可以开始“看见某些东西

...

您可以使用dicomwrite将tiff格式转换为dicom: dicomwrite( imread('input_image.tif'), 'output_image.dcm')

You can convert tiff format to dicom with dicomwrite: dicomwrite( imread('input_image.tif'), 'output_image.dcm')

 类似资料: