DicomPage
内容
[
隐藏
]Inheritance: java.lang.Object, com.aspose.imaging.DisposableObject, com.aspose.imaging.DataStreamSupporter, com.aspose.imaging.Image, com.aspose.imaging.RasterImage, com.aspose.imaging.RasterCachedImage
public class DicomPage extends RasterCachedImage
它是用于处理多帧类型 DICOM 文件的类
构造函数
| 构造函数 | 描述 |
|---|---|
| DicomPage(DicomImage image, int index) | 初始化 DicomPage 类的新实例。 |
| DicomPage(DicomImage image, int index, LoadOptions loadOptions) | 初始化 DicomPage 类的新实例。 |
方法
| 方法 | 描述 |
|---|---|
| getIndex() | 获取当前页面的索引。 |
| getWidth() | 获取图像宽度。 |
| getHeight() | 获取图像高度。 |
| getBitsPerPixel() | 获取图像每像素位数计数。 |
| getFileFormat() | 获取文件格式的值 |
Example: Create a multi-page Dicom image.
try (DicomOptions dicomOptions = new DicomOptions())
{
dicomOptions.setSource(new StreamSource());
try (DicomImage image = (DicomImage) Image.create(
dicomOptions,
100,
100))
{
// 使用矢量图形绘制内容。
Graphics graphics = new Graphics(image);
graphics.fillRectangle(new SolidBrush(Color.getBlueViolet()), image.getBounds());
graphics.fillRectangle(new SolidBrush(Color.getAqua()), 10, 20, 50, 20);
graphics.fillEllipse(new SolidBrush(Color.getOrange()), 30, 50, 70, 30);
// 保存绘制图像的像素。它们现在位于 Dicom 图像的第一页。
int[] pixels = image.loadArgb32Pixels(image.getBounds());
// 在后面添加几页,使其更暗。
for (int i = 1; i < 5; i++)
{
DicomPage page = image.addPage();
page.saveArgb32Pixels(page.getBounds(), pixels);
page.adjustBrightness(i * 30);
}
// 在主页面前面添加几页,使其更亮。
for (int i = 1; i < 5; i++)
{
DicomPage page = image.insertPage(0);
page.saveArgb32Pixels(page.getBounds(), pixels);
page.adjustBrightness(-i * 30);
}
// 将创建的多页图像保存到输出文件。
image.save("MultiPage.dcm");
}
}
DicomPage(DicomImage image, int index)
public DicomPage(DicomImage image, int index)
初始化 DicomPage 类的新实例。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| image | DicomImage | 图像。 |
| index | int | 索引。 |
DicomPage(DicomImage image, int index, LoadOptions loadOptions)
public DicomPage(DicomImage image, int index, LoadOptions loadOptions)
初始化 DicomPage 类的新实例。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| image | DicomImage | 图像。 |
| index | int | 索引。 |
| loadOptions | LoadOptions | 加载选项。 |
getIndex()
public final int getIndex()
获取当前页面的索引。
值:索引。
Returns: int - 当前页面的索引。
getWidth()
public int getWidth()
获取图像宽度。
值:图像宽度。
Returns: int
getHeight()
public int getHeight()
获取图像高度。
值:图像高度。
Returns: int
getBitsPerPixel()
public int getBitsPerPixel()
获取图像每像素位数计数。
值:图像每像素位数。
Returns: int
getFileFormat()
public long getFileFormat()
获取文件格式的值
Returns: long