- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在 vtkImageData 中保存了一个卷图像,需要将其转换为 DcmDataset (DCMTK)。我知道我需要将患者数据等一般 DICOM 标签设置为数据集。那不是问题。特别是我对将像素数据放入 DcmDataset 感兴趣。有没有人知道一个例子或可以解释如何做到这一点?
提前致谢
最佳答案
引自DCMTK FAQ :
Is there a tool that converts common graphic formats like PGM/PPM, PNG, TIFF, JPEG or BMP to DICOM?
No, unfortunately, there is no such tool in DCMTK. Currently, you have to write your own little program for that purpose.
The following code snippet from the toolkit's documentation could be a starting point:
char uid[100];
DcmFileFormat fileformat;
DcmDataset *dataset = fileformat.getDataset();
dataset->putAndInsertString(DCM_SOPClassUID, UID_SecondaryCaptureImageStorage);
dataset->putAndInsertString(DCM_SOPInstanceUID, dcmGenerateUniqueIdentifier(uid, SITE_INSTANCE_UID_ROOT));
dataset->putAndInsertString(DCM_PatientsName, "Doe^John");
/* ... */
dataset->putAndInsertUint8Array(DCM_PixelData, pixelData, pixelLength);
OFCondition status = fileformat.saveFile("test.dcm", EXS_LittleEndianExplicit);
if (status.bad())
cerr << "Error: cannot write DICOM file (" << status.text() << ")" << endl;
The current snapshot of the DCMTK (> version 3.5.4) contains a new command line tool "img2dcm" that allows for converting JPEG images to certain DICOM image SOP classes.
我可能会先查看 img2dcm ( documented here ) 的源代码以了解一般过程,然后再回贴任何具体问题。恕我直言,DCMTK 非常强大但极难理解。
关于c++ - vtkImageData 到 DcmDataset,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21162890/
我现在正在使用带有 vtk 的 C++ 构建一个医学注释系统。 我想在 3d vtkimagedata 的切片(轴向,冠状,矢状)上画线或绘画,并连续保存绘制的 3d vtkimagedata 图像。
出于渲染目的,我需要一个带有两个组件的 vtkImageData 对象,其中每个组件由两个 vtkImageData 对象的单个组件组成。我怎样才能做到这一点?是否有像这样的 vtkImageAlgo
我有一个带有 3 个视口(viewport)(3 个 vtkRenderer)的应用程序。在他们每个人之上,我都有一个 vtkImageReslice。这些 vtkImageReslice 可以缩放、
我在 vtkImageData 中保存了一个卷图像,需要将其转换为 DcmDataset (DCMTK)。我知道我需要将患者数据等一般 DICOM 标签设置为数据集。那不是问题。特别是我对将像素数据放
我正在使用 VTK+Paraview 为演示文稿生成一些漂亮的图像。我的问题如下:我有一系列带有相应灰度图像的相机姿势,我想在 3D 空间中可视化它们。对于相机,我使用圆锥体并将其放在正确的位置,然后
是否可以将 vtkImageData 的某些单元格/点指定为空白?关键是cca。我的 vtk 域有 90% 是空的。 vtk 文件很大,因为它们什么都没有。 最佳答案 您是否考虑过使用 vtkImag
我正在尝试拍摄一个或三个 channel 的二维图像,并使用 vtkImageActor 在 VTK 中显示它们。据我了解,可以通过调用 vtkImageActor 上的 SetImageData 并
给定一个 vtk 图像: vtkSmartPointer VTKImage = vtkSmartPointer::New(); 这是一个包含分割结果作为二进制数据的 3D 图像(分割对象 = 1,背景
这个问题已经在这里得到了回答: Copy vtkImageData to cv::Mat 但是答案的链接不再有效。那么如何将 vtkImageData 转换为 cv::Mat? 最佳答案 我在这里使用
我正在尝试将 vtkImageData* 类复制到 cv::Mat 结构 [我的目标是将 MHD 文件读入 OpenCV]。该文件本质上是一个 3D 矩阵,所以我想获得一个包含所有卷的切片。到目前为止
我正在尝试将数据从统一网格写入 vtk XML 文件,以便我可以使用 Paraview 呈现它。我希望我的输出文件包含两个变量:一个 3 分量 vector 和一个标量值在每一点。我设法写了一个 .v
如何在 C++ 中将 cv::Mat 高效地转换为 vtkImageData?我正在寻找一种适用于 BW 和 COLOR 图像的方法。 最佳答案 以下是@lucasahli 上述答案的简化版本。它使用
我有一个简单的 C 指针,其中包含一些 RGBA 图像数据,我想将其用作 vtkImageData 来添加为 vtkActor 上的纹理。为此,我有一些代码,例如 vtkSmartPointer my
因此,我想使用 ParaView 提供的 python 接口(interface)直接从我们当前的文件格式加载数据并显示它,而不是以另一种格式存储我们拥有的所有数据以使其可被 ParaView 显示。
我是一名优秀的程序员,十分优秀!