DicomImage
内容
[
隐藏
]DicomImage(DicomOptions, int, int)
初始化DicomImage
类.
public DicomImage(DicomOptions dicomOptions, int width, int height)
范围 | 类型 | 描述 |
---|---|---|
dicomOptions | DicomOptions | dicom 选项。 |
width | Int32 | 宽度。 |
height | Int32 | 高度。 |
也可以看看
- class DicomOptions
- class DicomImage
- 命名空间 Aspose.Imaging.FileFormats.Dicom
- 部件 Aspose.Imaging
DicomImage(Stream, LoadOptions)
初始化DicomImage
类.
public DicomImage(Stream stream, LoadOptions loadOptions)
范围 | 类型 | 描述 |
---|---|---|
stream | Stream | 流。 |
loadOptions | LoadOptions | 负载选项。 |
例子
此示例说明如何从文件流加载 DICOM 图像以保持在指定的内存限制内。
[C#]
string dir = "c:\\temp\\";
// 从文件流中加载 DICOM 图像。
using (System.IO.Stream stream = System.IO.File.OpenRead(dir + "multiframe.dicom"))
{
// 所有内部缓冲区的最大允许大小为 256KB。
Aspose.Imaging.LoadOptions loadOptions = new Aspose.Imaging.LoadOptions();
loadOptions.BufferSizeHint = 256 * 1024;
using (Aspose.Imaging.FileFormats.Dicom.DicomImage dicomImage = new Aspose.Imaging.FileFormats.Dicom.DicomImage(stream, loadOptions))
{
// 将每个页面保存为单独的 PNG 图像。
foreach (Aspose.Imaging.FileFormats.Dicom.DicomPage dicomPage in dicomImage.DicomPages)
{
// 根据页面索引生成文件名。
string fileName = string.Format("multiframe.{0}.png", dicomPage.Index);
// DICOM 页面是光栅图像,因此所有允许的光栅图像操作都适用于 DICOM 页面。
dicomPage.Save(dir + fileName, new Aspose.Imaging.ImageOptions.PngOptions());
}
}
}
也可以看看
- class LoadOptions
- class DicomImage
- 命名空间 Aspose.Imaging.FileFormats.Dicom
- 部件 Aspose.Imaging
DicomImage(Stream)
初始化DicomImage
类.
public DicomImage(Stream stream)
范围 | 类型 | 描述 |
---|---|---|
stream | Stream | 流。 |
例子
此示例显示如何从文件流加载 DICOM 图像。
[C#]
string dir = "c:\\temp\\";
// 从文件流中加载 DICOM 图像。
using (System.IO.Stream stream = System.IO.File.OpenRead(dir + "sample.dicom"))
{
using (Aspose.Imaging.FileFormats.Dicom.DicomImage dicomImage = new Aspose.Imaging.FileFormats.Dicom.DicomImage(stream))
{
// 将每个页面保存为单独的 PNG 图像。
foreach (Aspose.Imaging.FileFormats.Dicom.DicomPage dicomPage in dicomImage.DicomPages)
{
// 根据页面索引生成文件名。
string fileName = string.Format("sample.{0}.png", dicomPage.Index);
// DICOM 页面是光栅图像,因此所有允许的光栅图像操作都适用于 DICOM 页面。
dicomPage.Save(dir + fileName, new Aspose.Imaging.ImageOptions.PngOptions());
}
}
}
也可以看看
- class DicomImage
- 命名空间 Aspose.Imaging.FileFormats.Dicom
- 部件 Aspose.Imaging