public class DicomPage extends RasterCachedImage
It is class for work with DICOM files of the type multi frame
Create a multi-page Dicom image.
try (DicomOptions dicomOptions = new DicomOptions())
{
dicomOptions.setSource(new StreamSource());
try (DicomImage image = (DicomImage) Image.create(
dicomOptions,
100,
100))
{
// Draw something using vector graphics
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);
// Save the pixels of the drawn image. They are now on the first page of the Dicom image.
int[] pixels = image.loadArgb32Pixels(image.getBounds());
// Add a few pages after, making them darker
for (int i = 1; i < 5; i++)
{
DicomPage page = image.addPage();
page.saveArgb32Pixels(page.getBounds(), pixels);
page.adjustBrightness(i * 30);
}
// Add a few pages in front of the main page, making them brighter
for (int i = 1; i < 5; i++)
{
DicomPage page = image.insertPage(0);
page.saveArgb32Pixels(page.getBounds(), pixels);
page.adjustBrightness(-i * 30);
}
// Save the created multi-page image to the output file
image.save("MultiPage.dcm");
}
}
| Constructor and Description |
|---|
DicomPage(DicomImage image,
int index)
Initializes a new instance of the
DicomPage class. |
DicomPage(DicomImage image,
int index,
LoadOptions loadOptions)
Initializes a new instance of the
DicomPage class. |
| Modifier and Type | Method and Description |
|---|---|
int |
getBitsPerPixel()
Gets the image bits per pixel count.
|
long |
getFileFormat()
Gets a value of file format
|
int |
getHeight()
Gets the image height.
|
int |
getIndex()
Gets the index of the current page.
|
int |
getWidth()
Gets the image width.
|
adjustBrightness, adjustContrast, adjustGamma, adjustGamma, binarizeBradley, binarizeBradley, binarizeFixed, binarizeOtsu, cacheData, crop, dither, grayscale, isCached, resize, resize, rotate, rotateFlipcrop, dither, filter, getArgb32Pixel, getDefaultArgb32Pixels, getDefaultPixels, getDefaultRawData, getDefaultRawData, getHorizontalResolution, getImageOpacity, getModifyDate, getPixel, getPremultiplyComponents, getRawCustomColorConverter, getRawDataFormat, getRawDataSettings, getRawFallbackIndex, getRawIndexedColorConverter, getRawLineSize, getSkewAngle, getTransparentColor, getUpdateXmpData, getUseRawData, getVerticalResolution, getXmpData, hasAlpha, hasTransparentColor, isRawDataAvailable, isUsePalette, loadArgb32Pixels, loadArgb64Pixels, loadCmyk32Pixels, loadCmykPixels, loadPartialArgb32Pixels, loadPartialPixels, loadPixels, loadRawData, loadRawData, normalizeAngle, normalizeAngle, readArgb32ScanLine, readScanLine, replaceColor, replaceColor, replaceNonTransparentColors, replaceNonTransparentColors, rotate, saveArgb32Pixels, saveCmyk32Pixels, saveCmykPixels, savePixels, saveRawData, setArgb32Pixel, setHorizontalResolution, setPalette, setPixel, setPremultiplyComponents, setRawCustomColorConverter, setRawFallbackIndex, setRawIndexedColorConverter, setResolution, setTransparentColor, setTransparentColor, setUpdateXmpData, setUseRawData, setVerticalResolution, setXmpData, toBitmap, writeArgb32ScanLine, writeScanLinecanLoad, canLoad, canLoad, canLoad, canSave, create, create, create, getBackgroundColor, getBounds, getBufferSizeHint, getContainer, getDefaultOptions, getFileFormat, getFileFormat, getFittingRectangle, getFittingRectangle, getInterruptMonitor, getOriginalOptions, getPalette, getProgressEventHandler, getProgressEventHandlerInfo, getProportionalHeight, getProportionalWidth, getSize, hasBackgroundColor, isAutoAdjustPalette, load, load, load, load, load, load, resize, resizeHeightProportionally, resizeHeightProportionally, resizeHeightProportionally, resizeWidthProportionally, resizeWidthProportionally, resizeWidthProportionally, save, save, save, save, save, save, save, save, setAutoAdjustPalette, setBackgroundColor, setBackgroundColor, setBufferSizeHint, setInterruptMonitor, setPalettegetDataStreamContainer, save, save, saveclose, dispose, getDisposedpublic DicomPage(DicomImage image, int index)
Initializes a new instance of the DicomPage class.
image - The image.index - The index.public DicomPage(DicomImage image, int index, LoadOptions loadOptions)
Initializes a new instance of the DicomPage class.
image - The image.index - The index.loadOptions - The load options.public final int getIndex()
Gets the index of the current page.
Value: The index.public int getWidth()
Gets the image width.
Value: The image width.getWidth in interface IObjectWithBoundsgetWidth in class Imagepublic int getHeight()
Gets the image height.
Value: The image height.getHeight in interface IObjectWithBoundsgetHeight in class Imagepublic int getBitsPerPixel()
Gets the image bits per pixel count.
Value: The image bits per pixel count.getBitsPerPixel in class Imagepublic long getFileFormat()
Gets a value of file format
getFileFormat in class ImageFileFormatCopyright (c) 2008-2022 Aspose Pty Ltd. All Rights Reserved.