dicom

基于cornerstone.js的cornerstoneWADOImageLoader

断了今生、忘了曾经 提交于 2020-08-19 16:13:46
上一篇简单介绍了cornerstone.js的相关使用介绍和基于cornerstone的web库cornerstoneWADOImageLoader,在实际开发中遇到了相关的一些问题,在这里说明一下,也是防止以后再次遇到相似的问题,以便查看。 对于一些外部库,我们不了解实现的每一个细节,所以说就有可能遇到各种各样的坑,通过使用cornerstoneWADOImageLoader库文件,我从中通过爬"坑"体会到了一个道理:尽量不要依赖库自带变量。见代码: /* 假设需要获取cornerstoneWADOImageLoader中imagepath的值 在自己的程序中可能多次需要调用这个path值 */ /* 第一种可能bug的写法 */ var path1= cornerstoneWADOImageLoader.imagepath; ... var path2= cornerstoneWADOImageLoader.imagepath; ... 这种写法出现bug的次数比较多,不一定每次都有bug,因为可能跟调用的变量上下文环境有关,a变量调用没有什么限制条件,b变量也许会有一些上下文限制条件(当然这种情况很少, 但是遇到过bug),或一些其他的限制条件。 /* 避免bug的写法很简单 */ var path=cornerstoneWADOImageLoader.imagepath;

Getting DICOM structure contours as array in Python

…衆ロ難τιáo~ 提交于 2020-08-19 04:14:36
问题 So if I have an image (CT, MRI, etc.) or even a dose from radiation therapy I can pull out the dose or image values into an array through: import dicom ds = dicom.read_file("dicom_file.dcm") print ds.pixel_array This is pretty straightforward, and gives me the ability to manipulate images/doses as I want. However, often you also have a structure file that includes different contoured structures that you can then see in an image viewer or something like that. Again, pretty straightforward. My

Getting DICOM structure contours as array in Python

丶灬走出姿态 提交于 2020-08-19 04:11:13
问题 So if I have an image (CT, MRI, etc.) or even a dose from radiation therapy I can pull out the dose or image values into an array through: import dicom ds = dicom.read_file("dicom_file.dcm") print ds.pixel_array This is pretty straightforward, and gives me the ability to manipulate images/doses as I want. However, often you also have a structure file that includes different contoured structures that you can then see in an image viewer or something like that. Again, pretty straightforward. My

想将GIF动画转换成PDF/PNG等格式吗?Aspose.Imaging快速搞定!

做~自己de王妃 提交于 2020-08-17 04:29:38
动画GIF(图形交换格式)在单个文件中包含特定顺序的许多图像帧。这些帧按顺序显示以创建动画。当您需要将动画GIF转换为其他多页或光栅图像格式时,可能会有各种用例。多页格式包括TIFF和PDF,而光栅图像可以是PNG,JPG,BMP等。 在本文中,我将向您展示如何将GIF动画图像转换为TIFF,PDF,PNG。JPG和BMP图像使用C#进行编程。 使用C#将动画GIF转换为TIFF 使用C#将动画GIF转换为PDF 使用C#提取GIF帧并将其转换为PNG 使用C#将GIF帧转换为JPG 使用C#将GIF帧转换为BMP Aspose.Imaging for .NET 一种高级图像处理控件,允许开发人员创建,编辑,绘制或转换图像。图像导出和转换是API核心功能之一,它允许在不安装Photoshop应用程序或任何其他图像编辑器的情况下保存为AdobePhotoshop®本机格式。 目前发布了Aspose.Imaging for .NET v20.5,支持从TIFF提取路径,优化Dicom格式的速度或内存,支持将可读的全帧gif导出为多页图像格式,还没使用过的朋友可以 点击下载最新版Aspose.Imaging 使用C#将动画GIF转换为TIFF TIFF是一种多页图像格式,可将多个图像保存在一个文件中。由于动画GIF还包含一系列帧,因此您可以将所有或选定的帧导出为TIFF格式。在此转换中

How to read DICOM string value with backslash (VR=LO, Value=“0.4323\0.2325”)?

走远了吗. 提交于 2020-08-08 05:18:48
问题 Our C++ software use ITK to write DICOM files. In it we have a Private Tag with LO (Long String) as VR and 2 decimal values as value like 0.3234\0.34223 . The LO choice is inherent to ITK. In other java application, I use dcm4che3 to read/write them. Since it respects the DICOM protocol, backslash are forbidden, and dcm4che interpret the value as "0.3234" and never reach the second value. All DICOM viewer applications I use can display this value. So my question is: Is there a trick in

How to read DICOM string value with backslash (VR=LO, Value=“0.4323\0.2325”)?

三世轮回 提交于 2020-08-08 05:18:07
问题 Our C++ software use ITK to write DICOM files. In it we have a Private Tag with LO (Long String) as VR and 2 decimal values as value like 0.3234\0.34223 . The LO choice is inherent to ITK. In other java application, I use dcm4che3 to read/write them. Since it respects the DICOM protocol, backslash are forbidden, and dcm4che interpret the value as "0.3234" and never reach the second value. All DICOM viewer applications I use can display this value. So my question is: Is there a trick in

Render JPEG 2000 Image Compression Dicom with Fo-Dicom

天大地大妈咪最大 提交于 2020-07-20 04:36:24
问题 I'm try to create a simple WinForms viewer to show DICOM files generated in a NOVARAD pacs system. I'm using the following code from their GitHub page: var image = new DicomImage(@"C:\myDicom.dcm"); image.RenderImage().AsClonedBitmap().Save(@"test.jpg"); Process.Start("test.jpg"); When I run the code I get the following error: Dicom.Imaging.Codec.DicomCodecException: 'Decoding dataset with transfer syntax: JPEG 2000 Image Compression (Lossless Only) is not supported.' I'm assuming I need to

Should a DICOM StudyInstanceUID be unique to the patient?

女生的网名这么多〃 提交于 2020-06-28 05:30:19
问题 While working with the DICOM study, series and media concepts, I wondered if these values are to be unique over all data, or only to the patient they belong to. Phrased otherwise; can I have 2 patients having a study/series/sop instance uid that is the same value for both patients? Or does the DICOM standard simply doesn't care about that and is that open to the implementor to decide? 回答1: In DICOM, a Study (identified by its Study Instance UID) is always associated with a single Patient. See

使用Python对Dicom文件进行读取与写入

可紊 提交于 2020-04-20 16:58:52
Dicom文件的读取 Pydicom 单张影像的读取 一些简单处理 读取并编辑Dicom Tags 借助Numpy与PIL.Image 可视化 单张影像的写入 SimpleITK 单张影像的读取 序列读取 一些简单操作 边缘检测 可视化 单张影像的写入 Pydicom 单张影像的读取 使用 pydicom.dcmread() 函数进行单张影像的读取,返回一个pydicom.dataset.FileDataset对象. import os import pydicom # 调用本地的 dicom file folder_path = r "D:\Files\Data\Materials" file_name = "PA1_0001.dcm" file_path = os . path . join ( folder_path , file_name ) ds = pydicom . dcmread ( file_path ) 在一些特殊情况下,比如直接读取从医院拿到的数据(未经任何处理)时,可能会发生以下报错: raise InvalidDicomError ( "File is missing DICOM File Meta Information " pydicom . errors . InvalidDicomError : File is missing DICOM File

How can I convert RAW image to DICOM image using imebra?

左心房为你撑大大i 提交于 2020-04-18 05:28:42
问题 I am new to imebra and want to convert raw image to DICOM image. I have complied the imebra library to my virtual machine (ubuntu 16.04), and followed the tutorial from the website. I found that they do not show how to convert raw image to DICOM image. Can anyone help me out or tell me the process of converting? #include <imebra/imebra.h> #include <iostream> #include <fstream> #include <stdlib.h> #include <memory> using namespace std; int main() { //creat read stream using namespace puntoexe;