Class DicomImage
이름 공간 : Aspose.Imaging.FileFormats.Dicom 모임: Aspose.Imaging.dll (25.4.0)
이 클래스는 의학에서 디지털 이미지와 커뮤니케이션을 구현합니다.(DICOM) 라스터 이미지 형식 지원 및 포괄적 인 솔루션을 제공DICOM 이미지를 정확성과 유연성으로 처리할 수 있습니다.이미지 페이지를 조작, 페이지를 얻거나 추가하거나 제거하는 작업을 포함하여, 그리고기본 및 활성 페이지를 제어합니다.알파 채널과 함께 작업 할 수있는 능력으로,XMP 메타 데이터를 삽입, 재구성, 회전, 식물, 바이너리화, 조정, 필터를 적용,그리고 다른 raster 형식으로 변환합니다.이 API는 개발자가 처리 할 수 있습니다.DICOM 이미지 효과적으로 다양한 응용 요구 사항을 충족하는 동안의학적 이미지 컨텍스트
[JsonObject(MemberSerialization.OptIn)]
public sealed class DicomImage : RasterCachedMultipageImage, IDisposable, IObjectWithBounds, IRasterImageArgb32PixelLoader, IRasterImageRawDataLoader, IHasXmpData, IHasMetadata, IMultipageImageExt, IMultipageImage
Inheritance
object ← DisposableObject ← DataStreamSupporter ← Image ← RasterImage ← RasterCachedImage ← RasterCachedMultipageImage ← DicomImage
Implements
IDisposable , IObjectWithBounds , IRasterImageArgb32PixelLoader , IRasterImageRawDataLoader , IHasXmpData , IHasMetadata , IMultipageImageExt , IMultipageImage
상속 회원들
RasterCachedMultipageImage.AdjustBrightness(int) , RasterCachedMultipageImage.AdjustContrast(float) , RasterCachedMultipageImage.AdjustGamma(float, float, float) , RasterCachedMultipageImage.AdjustGamma(float) , RasterCachedMultipageImage.Blend(Point, RasterImage, Rectangle, byte) , RasterCachedMultipageImage.BinarizeFixed(byte) , RasterCachedMultipageImage.BinarizeBradley(double, int) , RasterCachedMultipageImage.BinarizeBradley(double) , RasterCachedMultipageImage.BinarizeOtsu() , RasterCachedMultipageImage.Crop(Rectangle) , RasterCachedMultipageImage.Crop(int, int, int, int) , RasterCachedMultipageImage.Dither(DitheringMethod, int, IColorPalette) , RasterCachedMultipageImage.Grayscale() , RasterCachedMultipageImage.NormalizeHistogram() , RasterCachedMultipageImage.Rotate(float, bool, Color) , RasterCachedMultipageImage.RotateFlip(RotateFlipType) , RasterCachedMultipageImage.RotateFlipAll(RotateFlipType) , RasterCachedMultipageImage.Resize(int, int, ResizeType) , RasterCachedMultipageImage.Resize(int, int, ImageResizeSettings) , RasterCachedMultipageImage.ResizeWidthProportionally(int, ResizeType) , RasterCachedMultipageImage.ResizeHeightProportionally(int, ResizeType) , RasterCachedMultipageImage.ReplaceColor(int, byte, int) , RasterCachedMultipageImage.ReplaceNonTransparentColors(int) , RasterCachedMultipageImage.Filter(Rectangle, FilterOptionsBase) , RasterCachedMultipageImage.NormalizeAngle(bool, Color) , RasterCachedMultipageImage.CacheData() , RasterCachedMultipageImage.GetSerializedStream(ImageOptionsBase, Rectangle, out int) , RasterCachedMultipageImage.Height , RasterCachedMultipageImage.Width , RasterCachedMultipageImage.BitsPerPixel , RasterCachedMultipageImage.IsCached , RasterCachedMultipageImage.PageCount , RasterCachedMultipageImage.Pages , RasterCachedMultipageImage.HasAlpha , RasterCachedMultipageImage.HasTransparentColor , RasterCachedMultipageImage.ImageOpacity , RasterCachedMultipageImage.BackgroundColor , RasterCachedMultipageImage.XmpData , RasterCachedMultipageImage.PageExportingAction , RasterCachedImage.CacheData() , RasterCachedImage.Blend(Point, RasterImage, Rectangle, byte) , RasterCachedImage.Resize(int, int, ResizeType) , RasterCachedImage.Resize(int, int, ImageResizeSettings) , RasterCachedImage.RotateFlip(RotateFlipType) , RasterCachedImage.Rotate(float, bool, Color) , RasterCachedImage.Crop(Rectangle) , RasterCachedImage.Dither(DitheringMethod, int, IColorPalette) , RasterCachedImage.Grayscale() , RasterCachedImage.NormalizeHistogram() , RasterCachedImage.BinarizeFixed(byte) , RasterCachedImage.BinarizeOtsu() , RasterCachedImage.BinarizeBradley(double, int) , RasterCachedImage.BinarizeBradley(double) , RasterCachedImage.AdjustBrightness(int) , RasterCachedImage.AdjustContrast(float) , RasterCachedImage.AdjustGamma(float, float, float) , RasterCachedImage.AdjustGamma(float) , RasterCachedImage.IsCached , RasterImage.RemoveMetadata() , RasterImage.Save(Stream, ImageOptionsBase, Rectangle) , RasterImage.GetModifyDate(bool) , RasterImage.Dither(DitheringMethod, int) , RasterImage.Dither(DitheringMethod, int, IColorPalette) , RasterImage.GetDefaultPixels(Rectangle, IPartialArgb32PixelLoader) , RasterImage.GetDefaultRawData(Rectangle, IPartialRawDataLoader, RawDataSettings) , RasterImage.GetDefaultArgb32Pixels(Rectangle) , RasterImage.GetDefaultRawData(Rectangle, RawDataSettings) , RasterImage.GetArgb32Pixel(int, int) , RasterImage.GetPixel(int, int) , RasterImage.SetArgb32Pixel(int, int, int) , RasterImage.SetPixel(int, int, Color) , RasterImage.ReadScanLine(int) , RasterImage.ReadArgb32ScanLine(int) , RasterImage.WriteScanLine(int, Color[]) , RasterImage.WriteArgb32ScanLine(int, int[]) , RasterImage.LoadPartialArgb32Pixels(Rectangle, IPartialArgb32PixelLoader) , RasterImage.LoadPartialPixels(Rectangle, IPartialPixelLoader) , RasterImage.LoadArgb32Pixels(Rectangle) , RasterImage.LoadArgb64Pixels(Rectangle) , RasterImage.LoadPartialArgb64Pixels(Rectangle, IPartialArgb64PixelLoader) , RasterImage.LoadPixels(Rectangle) , RasterImage.LoadCmykPixels(Rectangle) , RasterImage.LoadCmyk32Pixels(Rectangle) , RasterImage.LoadRawData(Rectangle, RawDataSettings, IPartialRawDataLoader) , RasterImage.LoadRawData(Rectangle, Rectangle, RawDataSettings, IPartialRawDataLoader) , RasterImage.SaveRawData(byte[], int, Rectangle, RawDataSettings) , RasterImage.SaveArgb32Pixels(Rectangle, int[]) , RasterImage.SavePixels(Rectangle, Color[]) , RasterImage.SaveCmykPixels(Rectangle, CmykColor[]) , RasterImage.SaveCmyk32Pixels(Rectangle, int[]) , RasterImage.SetResolution(double, double) , RasterImage.SetPalette(IColorPalette, bool) , RasterImage.Resize(int, int, ImageResizeSettings) , RasterImage.Rotate(float, bool, Color) , RasterImage.Rotate(float) , RasterImage.BinarizeFixed(byte) , RasterImage.BinarizeOtsu() , RasterImage.BinarizeBradley(double) , RasterImage.BinarizeBradley(double, int) , RasterImage.Blend(Point, RasterImage, Rectangle, byte) , RasterImage.Blend(Point, RasterImage, byte) , RasterImage.Grayscale() , RasterImage.NormalizeHistogram() , RasterImage.AdjustBrightness(int) , RasterImage.AdjustContrast(float) , RasterImage.AdjustGamma(float, float, float) , RasterImage.AdjustGamma(float) , RasterImage.GetSkewAngle() , RasterImage.NormalizeAngle() , RasterImage.NormalizeAngle(bool, Color) , RasterImage.Filter(Rectangle, FilterOptionsBase) , RasterImage.ReplaceColor(Color, byte, Color) , RasterImage.ReplaceColor(int, byte, int) , RasterImage.ReplaceNonTransparentColors(Color) , RasterImage.ReplaceNonTransparentColors(int) , RasterImage.ToBitmap() , RasterImage.PremultiplyComponents , RasterImage.UseRawData , RasterImage.UpdateXmpData , RasterImage.XmpData , RasterImage.RawIndexedColorConverter , RasterImage.RawCustomColorConverter , RasterImage.RawFallbackIndex , RasterImage.RawDataSettings , RasterImage.UsePalette , RasterImage.RawDataFormat , RasterImage.RawLineSize , RasterImage.IsRawDataAvailable , RasterImage.HorizontalResolution , RasterImage.VerticalResolution , RasterImage.HasTransparentColor , RasterImage.HasAlpha , RasterImage.TransparentColor , RasterImage.ImageOpacity , Image.CanLoad(string) , Image.CanLoad(string, LoadOptions) , Image.CanLoad(Stream) , Image.CanLoad(Stream, LoadOptions) , Image.Create(ImageOptionsBase, int, int) , Image.Create(Image[]) , Image.Create(MultipageCreateOptions) , Image.Create(string[], bool) , Image.Create(string[]) , Image.Create(Image[], bool) , Image.GetFileFormat(string) , Image.GetFileFormat(Stream) , Image.GetFittingRectangle(Rectangle, int, int) , Image.GetFittingRectangle(Rectangle, int[], int, int) , Image.Load(string, LoadOptions) , Image.Load(string) , Image.Load(Stream, LoadOptions) , Image.Load(Stream) , Image.GetProportionalWidth(int, int, int) , Image.GetProportionalHeight(int, int, int) , Image.RemoveMetadata() , Image.CanSave(ImageOptionsBase) , Image.Resize(int, int) , Image.Resize(int, int, ResizeType) , Image.Resize(int, int, ImageResizeSettings) , Image.GetDefaultOptions(object[]) , Image.GetOriginalOptions() , Image.ResizeWidthProportionally(int) , Image.ResizeHeightProportionally(int) , Image.ResizeWidthProportionally(int, ResizeType) , Image.ResizeHeightProportionally(int, ResizeType) , Image.ResizeWidthProportionally(int, ImageResizeSettings) , Image.ResizeHeightProportionally(int, ImageResizeSettings) , Image.RotateFlip(RotateFlipType) , Image.Rotate(float) , Image.Crop(Rectangle) , Image.Crop(int, int, int, int) , Image.Save() , Image.Save(string) , Image.Save(string, ImageOptionsBase) , Image.Save(string, ImageOptionsBase, Rectangle) , Image.Save(Stream, ImageOptionsBase) , Image.Save(Stream, ImageOptionsBase, Rectangle) , Image.GetSerializedStream(ImageOptionsBase, Rectangle, out int) , Image.SetPalette(IColorPalette, bool) , Image.BitsPerPixel , Image.Bounds , Image.Container , Image.Height , Image.Palette , Image.UsePalette , Image.Size , Image.Width , Image.InterruptMonitor , Image.BufferSizeHint , Image.AutoAdjustPalette , Image.HasBackgroundColor , Image.FileFormat , Image.BackgroundColor , DataStreamSupporter.CacheData() , DataStreamSupporter.Save() , DataStreamSupporter.Save(Stream) , DataStreamSupporter.Save(string) , DataStreamSupporter.Save(string, bool) , DataStreamSupporter.DataStreamContainer , DataStreamSupporter.IsCached , DisposableObject.Dispose() , DisposableObject.Disposed , object.GetType() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Examples
DICOM 압축에서 색상 유형을 변경합니다.
using (var inputImage = Image.Load("original.jpg"))
{
var options = new DicomOptions { ColorType = ColorType.Grayscale8Bit };
inputImage.Save("original_8Bit.dcm", options);
}
DICOM 이미지에서 RLE 압축을 사용합니다.
using (var inputImage = Image.Load("original.jpg"))
{
var options = new DicomOptions
{
ColorType = ColorType.Rgb24Bit,
Compression = new Compression { Type = CompressionType.Rle }
};
inputImage.Save("original_RLE.dcm", options);
}
DICOM 이미지에서 JPEG 2000 압축을 사용합니다.
using (var inputImage = Image.Load("original.jpg"))
{
var options = new DicomOptions
{
ColorType = ColorType.Rgb24Bit,
Compression = new Compression
{
Type = CompressionType.Jpeg2000,
Jpeg2000 = new Jpeg2000Options
{
Codec = Jpeg2000Codec.Jp2,
Irreversible = false
}
}
};
inputImage.Save("original_JPEG2000.dcm", options);
}
DICOM 이미지에서 JPEG 압축을 사용합니다.
using (var inputImage = Image.Load("original.jpg"))
{
var options = new DicomOptions
{
ColorType = ColorType.Rgb24Bit,
Compression = new Compression
{
Type = CompressionType.Jpeg,
Jpeg = new JpegOptions
{
CompressionType = JpegCompressionMode.Baseline,
SampleRoundingMode = SampleRoundingMode.Truncate,
Quality = 50
}
}
};
inputImage.Save("original_JPEG.dcm", options);
}
이 예제는 파일 스트림에서 DICOM 이미지를 업로드하는 방법을 보여줍니다.
string dir = "c:\\temp\\";
// Load a DICOM image from a file stream.
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))
{
// Save each page as an individual PNG image.
foreach (Aspose.Imaging.FileFormats.Dicom.DicomPage dicomPage in dicomImage.DicomPages)
{
// Generate a file name based on the page index.
string fileName = string.Format("sample.{0}.png", dicomPage.Index);
// A DICOM page is a raster image, so all allowed operations with a raster image are applicable to a DICOM page.
dicomPage.Save(dir + fileName, new Aspose.Imaging.ImageOptions.PngOptions());
}
}
}
다중 페이지 디코마 이미지를 만드십시오.
using (DicomImage image = (DicomImage)Image.Create(
new DicomOptions() { Source = new StreamSource(new MemoryStream()) },
100,
100))
{
// Draw something using vector graphics
Graphics graphics = new Graphics(image);
graphics.FillRectangle(new SolidBrush(Color.BlueViolet), image.Bounds);
graphics.FillRectangle(new SolidBrush(Color.Aqua), 10, 20, 50, 20);
graphics.FillEllipse(new SolidBrush(Color.Orange), 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.Bounds);
// Add a few pages after, making them darker
for (int i = 1; i < 5; i++)
{
DicomPage page = image.AddPage();
page.SaveArgb32Pixels(page.Bounds, 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.Bounds, pixels);
page.AdjustBrightness(-i * 30);
}
// Save the created multi-page image to the output file
image.Save("MultiPage.dcm");
}
Constructors
DicomImage(디코마옵션, int, int)
이와 함께 DicomImage 클래스의 신선한 사례를 열심히 시작하세요.개발자, 사용 dicomOptions 매개 변수. 개발자를 위해 완벽한Aspose.Imaging.FileFormats.Dicom.DicomImage 개체에 빠르고 효율적으로 그들의 프로젝트에 몰입.
public DicomImage(DicomOptions dicomOptions, int width, int height)
Parameters
dicomOptions
DicomOptions
디코마 옵션
width
int
넓은 넓은
height
int
높이에 대하여
DicomImage(흐름, LoadOptions)
DicomImage 클래스의 새로운 사례를 부드럽게 시작하여 스트림을 사용하고이 컨테이너에서 옵션 매개 변수.이 개발자가 시작하고자하는 데 이상적입니다.Aspose.Imaging.FileFormats.Dicom.DicomImage는 프로젝트에서 신속하고 효과적으로 개체를 작업합니다.
public DicomImage(Stream stream, LoadOptions loadOptions)
Parameters
stream
Stream
그 흐름을
loadOptions
LoadOptions
로드 옵션
Examples
이 예제는 지정된 메모리 한도 내에 머무르기 위해 파일 스트림에서 DICOM 이미지를 업로드하는 방법을 보여줍니다.
string dir = "c:\\temp\\";
// Load a DICOM image from a file stream.
using (System.IO.Stream stream = System.IO.File.OpenRead(dir + "multiframe.dicom"))
{
// The max allowed size for all internal buffers is 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))
{
// Save each page as an individual PNG image.
foreach (Aspose.Imaging.FileFormats.Dicom.DicomPage dicomPage in dicomImage.DicomPages)
{
// Generate a file name based on the page index.
string fileName = string.Format("multiframe.{0}.png", dicomPage.Index);
// A DICOM page is a raster image, so all allowed operations with a raster image are applicable to a DICOM page.
dicomPage.Save(dir + fileName, new Aspose.Imaging.ImageOptions.PngOptions());
}
}
}
DicomImage(Stream)
흐름 매개 변수를 사용하여 DicomImage 클래스의 새로운 예를 만드십시오.이 건축기에서.이 개발자를위한 완벽한 원활한 방법을 찾고있는 개발자Aspose.Imaging.FileFormats.Dicom.DicomImage는 프로젝트에서 기존 데이터 흐름에서 개체를 제공합니다.
public DicomImage(Stream stream)
Parameters
stream
Stream
그 흐름을
Examples
이 예제는 파일 스트림에서 DICOM 이미지를 업로드하는 방법을 보여줍니다.
string dir = "c:\\temp\\";
// Load a DICOM image from a file stream.
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))
{
// Save each page as an individual PNG image.
foreach (Aspose.Imaging.FileFormats.Dicom.DicomPage dicomPage in dicomImage.DicomPages)
{
// Generate a file name based on the page index.
string fileName = string.Format("sample.{0}.png", dicomPage.Index);
// A DICOM page is a raster image, so all allowed operations with a raster image are applicable to a DICOM page.
dicomPage.Save(dir + fileName, new Aspose.Imaging.ImageOptions.PngOptions());
}
}
}
Properties
ActivePage
이 직관적인 속성으로 이미지의 활성 페이지를 관리하십시오.개발자를위한 이상적인다중 페이지 이미지 내에서 페이지 간의 역동적 전환을 추구하여 효율적인탐색 및 처리.
public DicomPage ActivePage { get; set; }
부동산 가치
Exceptions
활성 페이지는 다른 이미지에 속하기 때문에 설정할 수 없습니다.
ActivePageIndex
이 직관적인 속성으로 활성 페이지의 인덱스를 쉽게 회복하십시오.다중 페이지 내에서 현재 페이지 인덱스에 빠른 액세스를 원하는 개발자를위한 이상적인이미지, 효율적인 항해 및 처리를 보장합니다.
public int ActivePageIndex { get; }
부동산 가치
DicomPages
이 직관적인 속성으로 이미지의 페이지에 액세스하십시오. 개발자를위한 이상적인이미지 내에서 개별 페이지와 상호 작용하려고 노력하고, 무시무시를 보장합니다.탐색 및 조작
public DicomPage[] DicomPages { get; }
부동산 가치
DicomPage [ ] [ [ ]
FileFormat
이 직관적인 속성으로 파일 형식의 가치를 쉽게 복구합니다.개발자는 이미지 파일 형식에 빠른 액세스를 추구, 효율적인 보장파일 형식에 따라 처리 및 처리.
public override FileFormat FileFormat { get; }
부동산 가치
FileInfo
귀중한 헤더 정보를 DICOM 파일에서 쉽게 복구하십시오.직관적 인 재산. 필수 세부 사항에 대한 빠른 액세스를 찾는 개발자를위한 이상적인DICOM 파일 내에 캡슐화되어 효율적인 데이터 추출 및 분석을 보장합니다.
public DicomImageInfo FileInfo { get; }
부동산 가치
HasAlpha
이미지가 이 직관적인 채널을 사용하여 노력없이 알파 채널을 가지고 있는지 여부를 확인하십시오.소유권: 개발자가 이미지가 투명성을 포함하는지 확인하려는 데 이상적입니다.정보, 이미지 처리 작업에서 알파 채널 데이터의 정확한 처리 보장.
public override bool HasAlpha { get; }
부동산 가치
PageCount
이 직관적인 속성으로 이미지의 전체 페이지 수를 회복하십시오.개발자는 이미지 내의 페이지 수에 대한 빠른 액세스를 추구하고,효율적인 탐색 및 관리.
public override int PageCount { get; }
부동산 가치
Pages
이 직관적인 속성으로 이미지의 페이지에 액세스하십시오. 개발자를위한 이상적인이미지 내에서 개별 페이지와 상호 작용하려고 노력하고, 무선 항해를 보장합니다.그리고 조작을 한다.
public override Image[] Pages { get; }
부동산 가치
Image [ ] [ [ ]
Methods
AddPage(RasterImage)
이 직관적인 방법으로 새로운 페이지를 추가하여 이미지 컬렉션을 확장합니다.다중 페이지 이미지에 역동적으로 페이지를 첨부하려는 개발자를위한 이상적인,이미지 콘텐츠의 끊임없는 확장 및 조직을 보장합니다.
public void AddPage(RasterImage page)
Parameters
page
RasterImage
추가하는 페이지입니다.
Exceptions
page’ is null.
AddPage()
이 간단한 방법으로 이미지의 페이지 목록의 끝에 새로운 페이지를 추가합니다.다중 페이지 이미지를 역동적으로 확장하기 위해 노력하는 개발자를위한 이상적인, 무선을 보장이미지 콘텐츠의 통합 및 조직.
public DicomPage AddPage()
Returns
새로 만들어진 Aspose.Imaging.FileFormats.Dicom.DicomPage.
Examples
다중 페이지 디코마 이미지를 만드십시오.
using (DicomImage image = (DicomImage)Image.Create(
new DicomOptions() { Source = new StreamSource(new MemoryStream()) },
100,
100))
{
// Draw something using vector graphics
Graphics graphics = new Graphics(image);
graphics.FillRectangle(new SolidBrush(Color.BlueViolet), image.Bounds);
graphics.FillRectangle(new SolidBrush(Color.Aqua), 10, 20, 50, 20);
graphics.FillEllipse(new SolidBrush(Color.Orange), 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.Bounds);
// Add a few pages after, making them darker
for (int i = 1; i < 5; i++)
{
DicomPage page = image.AddPage();
page.SaveArgb32Pixels(page.Bounds, 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.Bounds, pixels);
page.AdjustBrightness(-i * 30);
}
// Save the created multi-page image to the output file
image.Save("MultiPage.dcm");
}
AdjustBrightness(이트)
brightness"의 조정으로 이미지 빛을 향상시킵니다.이 사용자 친화적 인 기능은 개발자가 이미지 빛을 무조건 조작할 수 있게 해주며, 유연성과 시각적 미학에 대한 통제를 제공합니다.
public override void AdjustBrightness(int brightness)
Parameters
brightness
int
빛의 가치
Examples
다음 예제는 DICOM 이미지의 밝기 수정을 수행합니다.
string dir = "c:\\temp\\";
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
Aspose.Imaging.FileFormats.Dicom.DicomImage dicomImage = (Aspose.Imaging.FileFormats.Dicom.DicomImage)image;
// Set the brightness value. The accepted values of brightness are in the range [-255, 255].
dicomImage.AdjustBrightness(50);
dicomImage.Save(dir + "sample.AdjustBrightness.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
AdjustContrast(플로트)
이 사용자 친화적 인 방법으로 Aspose.Imaging.Image 대조를 향상시키고,빛과 어두운 영역 사이의 차이를 조정하고 시각적 명확성을 향상시킵니다.개발자에 대한 직관적 인 통제를 제공하기 위해 노력없이 정의최적의 렌더링을 위한 이미지 대조.
public override void AdjustContrast(float contrast)
Parameters
contrast
float
대조 값 (내 범위 [-100; 100])
Examples
다음 예제는 DICOM 이미지의 대조 수정을 수행합니다.
string dir = "c:\\temp\\";
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
Aspose.Imaging.FileFormats.Dicom.DicomImage dicomImage = (Aspose.Imaging.FileFormats.Dicom.DicomImage)image;
// Set the contrast value. The accepted values of contrast are in the range [-100f, 100f].
dicomImage.AdjustContrast(50f);
dicomImage.Save(dir + "sample.AdjustContrast.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
AdjustGamma(플로트)
이미지 품질을 향상시키고 가마 수정, 강력한 기술을 사용하여 조정미묘한 시각적 외관을 위해.그림을 최적화하려는 개발자를위한 완벽한프레젠테이션, 색상 균형 조정, 그리고 각각의 일관된 렌더링을 보장장치와 환경
public override void AdjustGamma(float gamma)
Parameters
gamma
float
빨간색, 녹색 및 파란색 채널에 대한 Gamma
Examples
다음 예제는 DICOM 이미지의 가마 수정을 수행합니다.
string dir = "c:\\temp\\";
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
Aspose.Imaging.FileFormats.Dicom.DicomImage dicomImage = (Aspose.Imaging.FileFormats.Dicom.DicomImage)image;
// Set gamma coefficient for red, green and blue channels.
dicomImage.AdjustGamma(2.5f);
dicomImage.Save(dir + "sample.AdjustGamma.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
AdjustGamma(해군, 해군, 해군)
독립적으로 gamma 수정을 적용함으로써 정확한 색상 조정을 달성하십시오.그림의 빨간색, 녹색, 파란색 구성 요소에 이 방법은 정확성을 보장합니다.색상 균형과 최적의 시각적 성능, 그라누라를 찾는 개발자를위한 케이팅이미지 렌더링 및 색상 정확도에 대한 제어.
public override void AdjustGamma(float gammaRed, float gammaGreen, float gammaBlue)
Parameters
gammaRed
float
붉은 채널 요소를 위한 Gamma
gammaGreen
float
녹색 채널 요소를 위한 Gamma
gammaBlue
float
파란 채널 요소를 위한 Gamma
Examples
다음 예제는 색상 구성 요소에 다른 요소를 적용하는 DICOM 이미지의 가마 수정을 수행합니다.
string dir = "c:\\temp\\";
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
Aspose.Imaging.FileFormats.Dicom.DicomImage dicomImage = (Aspose.Imaging.FileFormats.Dicom.DicomImage)image;
// Set individual gamma coefficients for red, green and blue channels.
dicomImage.AdjustGamma(1.5f, 2.5f, 3.5f);
dicomImage.Save(dir + "sample.AdjustGamma.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
BinarizeBradley(이중, 이중)
브래들리의 적응형 경계 알고리즘을 사용하여 이미지를 바이너리화하여 통합더 나은 성능을위한 이미지 경계. 개발자를위한 이상적인자동으로 빛의 현지 변동을 기반으로 이미지 분할, 보장정확한 개체 탐지 및 다양한 조명 조건에서 추출.
public override void BinarizeBradley(double brightnessDifference, int windowSize)
Parameters
brightnessDifference
double
픽셀 사이의 밝기 차이와 픽셀의 s x s 창의 평균 차이이 픽셀 주위에 중점을 둡니다.
windowSize
int
이 픽셀 주위에 중점을 둔 픽셀의 s x s 창의 크기
Examples
다음 예제는 Bradley의 적응 범위 알고리즘과 지정된 창 크기로 DICOM 이미지를 이중화합니다.
string dir = "c:\\temp\\";
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
Aspose.Imaging.FileFormats.Dicom.DicomImage dicomImage = (Aspose.Imaging.FileFormats.Dicom.DicomImage)image;
// Binarize the image with a brightness difference of 5. The brightness is a difference between a pixel and the average of an 10 x 10 window of pixels centered around this pixel.
dicomImage.BinarizeBradley(5, 10);
dicomImage.Save(dir + "sample.BinarizeBradley5_10x10.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
BinarizeFixed(바이트)
쉽게 사전 설정 한 경계를 사용하여 이미지를 바이너리 형식으로 변환합니다.이 간단한 방법으로 개발자가 이미지를 단순화하고자하는 데 이상적입니다.작업을 처리하여 이미지를 전면 및 배경 구성 요소로 분류합니다.지정된 강도 수준에 따라
public override void BinarizeFixed(byte threshold)
Parameters
threshold
byte
픽셀의 해당 회색 값이 픽셀의 한계를 초과하는 경우, 픽셀의 값은 픽셀의 한계를 초과합니다.255은 그에게 맡겨질 것이며, 0은 다르게 맡겨질 것이다.
Examples
다음 예제는 사전 정의 한계를 가진 DICOM 이미지를 바이너리화합니다. 바이너리화 된 이미지는 단지 2 가지 색상 - 검정색과 흰색을 포함합니다.
string dir = "c:\\temp\\";
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
Aspose.Imaging.FileFormats.Dicom.DicomImage dicomImage = (Aspose.Imaging.FileFormats.Dicom.DicomImage)image;
// Binarize the image with a threshold value of 127.
// If a corresponding gray value of a pixel is greater than 127, a value of 255 will be assigned to it, 0 otherwise.
dicomImage.BinarizeFixed(127);
dicomImage.Save(dir + "sample.BinarizeFixed.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
BinarizeOtsu()
Otsu 범위를 적용하여 이미지를 바이너리화하여 자동으로 최적의 범위를 결정합니다.그림의 히스토그램을 기반으로 한 경계 값. 개발자가 찾는 데 완벽합니다.신뢰할 수 있는 방법으로 이미지를 전면 및 배경 지역으로 분류하여최소한의 수동 개입
public override void BinarizeOtsu()
Examples
다음 예제는 Otsu 경계를 가진 DICOM 이미지를 바이너리화합니다. 바이너리화 된 이미지는 단지 2 가지 색상 - 검정색과 흰색을 포함합니다.
string dir = "c:\\temp\\";
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
Aspose.Imaging.FileFormats.Dicom.DicomImage dicomImage = (Aspose.Imaging.FileFormats.Dicom.DicomImage)image;
// Binarize the image with Otsu thresholding.
dicomImage.BinarizeOtsu();
dicomImage.Save(dir + "sample.BinarizeOtsu.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
CacheData()
이 방법은 효율적으로 데이터를 암호화하고 성능을 최적화하고 빠른 액세스를 보장합니다.필요할 때. 개발자가 자신의 속도와 효율성을 향상시키고자하는 데 이상적입니다.데이터 자원을 지능적으로 관리함으로써 응용 프로그램.
public override void CacheData()
Examples
다음 예제는 DICOM 이미지의 모든 페이지를 암호화하는 방법을 보여줍니다.
string dir = "c:\\temp\\";
// Load an image from a DICOM file.
using (Aspose.Imaging.FileFormats.Dicom.DicomImage image = (Aspose.Imaging.FileFormats.Dicom.DicomImage)Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
// This call caches all the pages so that no additional data loading will be performed from the underlying data stream.
image.CacheData();
// Or you can cache the pages individually.
foreach (Aspose.Imaging.FileFormats.Dicom.DicomPage page in image.DicomPages)
{
page.CacheData();
}
}
Crop(Rectangle)
원치 않는 영역을 제거하고 이와 함께 필수 콘텐츠에 초점을 맞추기 위해 이미지를 키우십시오.간단한 방법. 개발자가 시각적 구성을 사용자 정의하려는 데 이상적입니다.이미지, 그들이 효과적으로 원하는 메시지를 전달하는 것을 보장합니다.
public override void Crop(Rectangle rectangle)
Parameters
rectangle
Rectangle
오른쪽 쪽 쪽
Examples
다음 예제는 DICOM 이미지를 재배합니다. 재배 영역은 Aspose.Imaging.Rectangle을 통해 지정됩니다.
string dir = "c:\\temp\\";
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
Aspose.Imaging.FileFormats.Dicom.DicomImage dicomImage = (Aspose.Imaging.FileFormats.Dicom.DicomImage)image;
// Crop the image. The cropping area is the rectangular central area of the image.
Aspose.Imaging.Rectangle area = new Aspose.Imaging.Rectangle(dicomImage.Width / 4, dicomImage.Height / 4, dicomImage.Width / 2, dicomImage.Height / 2);
dicomImage.Crop(area);
// Save the cropped image to PNG
dicomImage.Save(dir + "sample.Crop.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
Crop(인트, 인트, 인트)
이 다양 한 방법으로 변환을 적용함으로써 이미지의 굴곡 영역을 조정합니다.농작물에 대한 정확한 통제를 필요로하는 개발자를위한 완벽한, 보장중요한 세부 사항은 불필요한 요소를 제거하는 동안 유지됩니다.
public override void Crop(int leftShift, int rightShift, int topShift, int bottomShift)
Parameters
leftShift
int
왼쪽이 바뀐다.
rightShift
int
올바른 변화
topShift
int
꼭대기 변동
bottomShift
int
밑바닥의 변화
Examples
다음 예제는 DICOM 이미지를 재배합니다. 재배 영역은 왼쪽, 상단, 오른쪽, 바닥 마진을 통해 지정됩니다.
string dir = @"c:\temp\";
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
Aspose.Imaging.FileFormats.Dicom.DicomImage dicomImage = (Aspose.Imaging.FileFormats.Dicom.DicomImage)image;
// Crop again. Set a margin of 10% of the image size.
int horizontalMargin = dicomImage.Width / 10;
int verticalMargin = dicomImage.Height / 10;
dicomImage.Crop(horizontalMargin, horizontalMargin, verticalMargin, verticalMargin);
// Save the cropped image to PNG.
dicomImage.Save(dir + "sample.Crop.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
Dither(Dithering 방법, int, IColorPalette)
현재 이미지를 향상시키는 것은 이 간단한 효과를 사용하여 디트링 효과를 적용함으로써개발자가 이미지에 텍스트와 깊이를 추가하는 것을 목표로하는 데 완벽합니다.그들의 시각적 품질과 전체 매력을 향상시킵니다.
public override void Dither(DitheringMethod ditheringMethod, int bitsCount, IColorPalette customPalette)
Parameters
ditheringMethod
DitheringMethod
디트리밍 방법을 사용합니다.
bitsCount
int
마지막 비트는 디트링을 위해 계산됩니다.
customPalette
IColorPalette
Dithering을 위한 특정 팔레트.
Examples
다음 예제는 DICOM 이미지를 업로드하고 다른 팔레트 깊이를 사용하여 경계 및 흐름 디트링을 수행합니다.
string dir = "c:\\temp\\";
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
Aspose.Imaging.FileFormats.Dicom.DicomImage dicomImage = (Aspose.Imaging.FileFormats.Dicom.DicomImage)image;
// Perform threshold dithering using 4-bit color palette which contains 16 colors.
// The more bits specified the higher quality and the bigger size of the output image.
// Note that only 1-bit, 4-bit and 8-bit palettes are supported at the moment.
dicomImage.Dither(Aspose.Imaging.DitheringMethod.ThresholdDithering, 4, null);
dicomImage.Save(dir + "sample.ThresholdDithering4.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
Aspose.Imaging.FileFormats.Dicom.DicomImage dicomImage = (Aspose.Imaging.FileFormats.Dicom.DicomImage)image;
// Perform floyd dithering using 1-bit color palette which contains only 2 colors - black and white.
// The more bits specified the higher quality and the bigger size of the output image.
// Note that only 1-bit, 4-bit and 8-bit palettes are supported at the moment.
dicomImage.Dither(Aspose.Imaging.DitheringMethod.FloydSteinbergDithering, 1, null);
dicomImage.Save(dir + "sample.FloydSteinbergDithering1.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
Filter(오른쪽, FilterOptionsBase)
지정된 필터를 적용하여 이미지의 특정 영역을 쉽게 향상시킵니다.이 방법은 개발자에게 정확한 통제를 제공합니다.이미지 조작, 목표 조정이 원하는 것을 달성 할 수 있도록시각적 효과가 쉽습니다.
public override void Filter(Rectangle rectangle, FilterOptionsBase options)
Parameters
rectangle
Rectangle
오른쪽 쪽 쪽
options
FilterOptionsBase
그 옵션들
Examples
다음 예제는 DICOM 이미지에 다양한 유형의 필터를 적용합니다.
string dir = "c:\\temp\\";
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
Aspose.Imaging.FileFormats.Dicom.DicomImage dicomImage = (Aspose.Imaging.FileFormats.Dicom.DicomImage)image;
// Apply a median filter with a rectangle size of 5 to the entire image.
dicomImage.Filter(dicomImage.Bounds, new Aspose.Imaging.ImageFilters.FilterOptions.MedianFilterOptions(5));
dicomImage.Save(dir + "sample.MedianFilter.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
Aspose.Imaging.FileFormats.Dicom.DicomImage dicomImage = (Aspose.Imaging.FileFormats.Dicom.DicomImage)image;
// Apply a bilateral smoothing filter with a kernel size of 5 to the entire image.
dicomImage.Filter(dicomImage.Bounds, new Aspose.Imaging.ImageFilters.FilterOptions.BilateralSmoothingFilterOptions(5));
dicomImage.Save(dir + "sample.BilateralSmoothingFilter.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
Aspose.Imaging.FileFormats.Dicom.DicomImage dicomImage = (Aspose.Imaging.FileFormats.Dicom.DicomImage)image;
// Apply a Gaussian blur filter with a radius of 5 and a sigma value of 4.0 to the entire image.
dicomImage.Filter(dicomImage.Bounds, new Aspose.Imaging.ImageFilters.FilterOptions.GaussianBlurFilterOptions(5, 4.0));
dicomImage.Save(dir + "sample.GaussianBlurFilter.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
Aspose.Imaging.FileFormats.Dicom.DicomImage dicomImage = (Aspose.Imaging.FileFormats.Dicom.DicomImage)image;
// Apply a Gauss-Wiener filter with a radius of 5 and a smooth value of 4.0 to the entire image.
dicomImage.Filter(dicomImage.Bounds, new Aspose.Imaging.ImageFilters.FilterOptions.GaussWienerFilterOptions(5, 4.0));
dicomImage.Save(dir + "sample.GaussWienerFilter.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
Aspose.Imaging.FileFormats.Dicom.DicomImage dicomImage = (Aspose.Imaging.FileFormats.Dicom.DicomImage)image;
// Apply a motion wiener filter with a length of 5, a smooth value of 4.0 and an angle of 90.0 degrees to the entire image.
dicomImage.Filter(dicomImage.Bounds, new Aspose.Imaging.ImageFilters.FilterOptions.MotionWienerFilterOptions(10, 1.0, 90.0));
dicomImage.Save(dir + "sample.MotionWienerFilter.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
Aspose.Imaging.FileFormats.Dicom.DicomImage dicomImage = (Aspose.Imaging.FileFormats.Dicom.DicomImage)image;
// Apply a sharpen filter with a kernel size of 5 and a sigma value of 4.0 to the entire image.
dicomImage.Filter(dicomImage.Bounds, new Aspose.Imaging.ImageFilters.FilterOptions.SharpenFilterOptions(5, 4.0));
dicomImage.Save(dir + "sample.SharpenFilter.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
Grayscale()
쉽게 그림을 그레이스케일 표현으로 변환하여 시각을 단순화합니다.분석 및 처리 작업. 이미지 명확성을 향상시키고자하는 개발자를위한 완벽한,복잡성을 줄이고 효율적인 그레이스칼 기반 알고리즘을 촉진합니다.다양한 응용 프로그램을 위한
public override void Grayscale()
Examples
다음 예제는 다채로운 DICOM 이미지를 그레이 스케일 표현으로 변환합니다.그레이 스케일 이미지는 독점적으로 회색의 그림자로 구성되어 있으며 강도 정보만 제공됩니다.
string dir = "c:\\temp\\";
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
Aspose.Imaging.FileFormats.Dicom.DicomImage dicomImage = (Aspose.Imaging.FileFormats.Dicom.DicomImage)image;
dicomImage.Grayscale();
dicomImage.Save(dir + "sample.Grayscale.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
InsertPage(이트)
이 직관을 사용하여 지정된 인덱스에서 이미지의 페이지 목록에 새 페이지를 입력합니다.개발자들은 페이지의 배열에 대한 정확한 통제를 추구하는 데 이상적입니다.멀티 페이지 이미지, 무조건 조직 및 이미지 콘텐츠의 사용자 정의를 보장합니다.
public DicomPage InsertPage(int pageIndex)
Parameters
pageIndex
int
페이지의 인덱스
Returns
새로 만들어진 Aspose.Imaging.FileFormats.Dicom.DicomPage.
Examples
다중 페이지 디코마 이미지를 만드십시오.
using (DicomImage image = (DicomImage)Image.Create(
new DicomOptions() { Source = new StreamSource(new MemoryStream()) },
100,
100))
{
// Draw something using vector graphics
Graphics graphics = new Graphics(image);
graphics.FillRectangle(new SolidBrush(Color.BlueViolet), image.Bounds);
graphics.FillRectangle(new SolidBrush(Color.Aqua), 10, 20, 50, 20);
graphics.FillEllipse(new SolidBrush(Color.Orange), 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.Bounds);
// Add a few pages after, making them darker
for (int i = 1; i < 5; i++)
{
DicomPage page = image.AddPage();
page.SaveArgb32Pixels(page.Bounds, 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.Bounds, pixels);
page.AdjustBrightness(-i * 30);
}
// Save the created multi-page image to the output file
image.Save("MultiPage.dcm");
}
Exceptions
pageIndex’ is out of range.
ReleaseManagedResources()
관리 된 자원을 풀어주십시오. 관리되지 않은 자원이 여기에 풀어주지 않도록하십시오.이미 풀려났다.
protected override void ReleaseManagedResources()
RemovePage(이트)
이 편리한 방법으로 지정된 인덱스의 페이지를 페이지 목록에서 제거합니다.다중 페이지 이미지 관리에 대한 정확한 통제를 추구하는 개발자를위한 이상적인,무한한 조직 및 이미지 콘텐츠의 사용자 정의를 보장합니다.
public void RemovePage(int pageIndex)
Parameters
pageIndex
int
페이지의 인덱스
Exceptions
pageIndex’ is out of range.
Resize(인트, 인트, ResizeType)
이 간단한 방법으로 이미지의 크기를 조정합니다. 개발자를위한 이상적인역동적으로 이미지를 재구성하기 위해 노력하고, 그들이 여러 가지에 깔끔하게 맞는지 확인합니다.그들의 응용 프로그램 내에서 컨텍스트와 레이아웃.
public override void Resize(int newWidth, int newHeight, ResizeType resizeType)
Parameters
newWidth
int
새로운 광도 입니다.
newHeight
int
새로운 높이 입니다.
resizeType
ResizeType
리세스 타입이죠.
Examples
이 예제는 DICOM 이미지를 업로드하고 다양한 재시지 방법을 사용하여 재시지합니다.
string dir = "c:\\temp\\";
using (Aspose.Imaging.FileFormats.Dicom.DicomImage image = (Aspose.Imaging.FileFormats.Dicom.DicomImage)Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
// Scale up by 2 times using Nearest Neighbour resampling.
image.Resize(image.Width* 2, image.Height* 2, Aspose.Imaging.ResizeType.NearestNeighbourResample);
// Save to PNG with default options.
image.Save(dir + "upsample.nearestneighbour.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
using (Aspose.Imaging.FileFormats.Dicom.DicomImage image = (Aspose.Imaging.FileFormats.Dicom.DicomImage)Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
// Scale down by 2 times using Nearest Neighbour resampling.
image.Resize(image.Width / 2, image.Height / 2, Aspose.Imaging.ResizeType.NearestNeighbourResample);
// Save to PNG with default options.
image.Save(dir + "downsample.nearestneighbour.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
using (Aspose.Imaging.FileFormats.Dicom.DicomImage image = (Aspose.Imaging.FileFormats.Dicom.DicomImage)Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
// Scale up by 2 times using Bilinear resampling.
image.Resize(image.Width* 2, image.Height* 2, Aspose.Imaging.ResizeType.BilinearResample);
// Save to PNG with default options.
image.Save(dir + "upsample.bilinear.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
using (Aspose.Imaging.FileFormats.Dicom.DicomImage image = (Aspose.Imaging.FileFormats.Dicom.DicomImage)Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
// Scale down by 2 times using Bilinear resampling.
image.Resize(image.Width / 2, image.Height / 2, Aspose.Imaging.ResizeType.BilinearResample);
// Save to PNG with default options.
image.Save(dir + "downsample.bilinear.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
Resize(이트, 이트, ImageResizeSettings)
이 간단한 재현 방법을 사용하여 이미지의 크기를 조정하십시오.당신의 이미지를 단축하거나 확장하십시오,이 기능은 당신의 재생 요구가 충족되도록 보장합니다효율적이고 정확하게, 빠르고 쉽게 찾는 개발자에게 완벽하게 만듭니다.이미지 크기 조정
public override void Resize(int newWidth, int newHeight, ImageResizeSettings settings)
Parameters
newWidth
int
새로운 광도 입니다.
newHeight
int
새로운 높이 입니다.
settings
ImageResizeSettings
재구성 설정에 대하여
Examples
이 예제는 DICOM 이미지를 업로드하고 다양한 재시작 설정을 사용하여 재시작합니다.
string dir = "c:\\temp\\";
Aspose.Imaging.ImageResizeSettings resizeSettings = new Aspose.Imaging.ImageResizeSettings();
// The adaptive algorithm based on weighted and blended rational function and lanczos3 interpolation.
resizeSettings.Mode = Aspose.Imaging.ResizeType.AdaptiveResample;
// The small rectangular filter
resizeSettings.FilterType = Aspose.Imaging.ImageFilterType.SmallRectangular;
// The number of colors in the palette.
resizeSettings.EntriesCount = 256;
// The color quantization is not used
resizeSettings.ColorQuantizationMethod = ColorQuantizationMethod.None;
// The euclidian method
resizeSettings.ColorCompareMethod = ColorCompareMethod.Euclidian;
using (Aspose.Imaging.Image image = (Aspose.Imaging.Image)Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
Aspose.Imaging.FileFormats.Dicom.DicomImage dicomImage = (Aspose.Imaging.FileFormats.Dicom.DicomImage)image;
// Scale down by 2 times using adaptive resampling.
dicomImage.Resize(image.Width / 2, image.Height / 2, resizeSettings);
// Save to PNG
dicomImage.Save(dir + "downsample.adaptive.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
ResizeHeightProportionally(인트, ResizeType)
이미지의 높이를 조정하면서 이와의 측면 비율을 유지합니다.사용자 친화적 인 방법. 역동적으로 이미지를 재생하려는 개발자를위한 완벽한비율을 유지하면서 최적의 표시와 사용 가능성을 보장합니다.그들의 응용 프로그램에서
public override void ResizeHeightProportionally(int newHeight, ResizeType resizeType)
Parameters
newHeight
int
새로운 높이 입니다.
resizeType
ResizeType
리시스의 종류입니다.
Examples
이 예제는 DICOM 이미지를 업로드하고 다양한 리시팅 방법을 사용하여 비례적으로 재시작합니다.만 높이가 지정되고 폭이 자동으로 계산됩니다.
string dir = "c:\\temp\\";
using (Aspose.Imaging.FileFormats.Dicom.DicomImage image = (Aspose.Imaging.FileFormats.Dicom.DicomImage)Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
// Scale up by 2 times using Nearest Neighbour resampling.
image.ResizeHeightProportionally(image.Height* 2, Aspose.Imaging.ResizeType.NearestNeighbourResample);
// Save to PNG with the default options.
image.Save(dir + "upsample.nearestneighbour.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
using (Aspose.Imaging.FileFormats.Dicom.DicomImage image = (Aspose.Imaging.FileFormats.Dicom.DicomImage)Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
// Scale down by 2 times using Nearest Neighbour resampling.
image.ResizeHeightProportionally(image.Height / 2, Aspose.Imaging.ResizeType.NearestNeighbourResample);
// Save to PNG with the default options.
image.Save(dir + "downsample.nearestneighbour.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
using (Aspose.Imaging.FileFormats.Dicom.DicomImage image = (Aspose.Imaging.FileFormats.Dicom.DicomImage)Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
// Scale up by 2 times using Bilinear resampling.
image.ResizeHeightProportionally(image.Height* 2, Aspose.Imaging.ResizeType.BilinearResample);
// Save to PNG with the default options.
image.Save(dir + "upsample.bilinear.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
using (Aspose.Imaging.FileFormats.Dicom.DicomImage image = (Aspose.Imaging.FileFormats.Dicom.DicomImage)Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
// Scale down by 2 times using Bilinear resampling.
image.ResizeHeightProportionally(image.Height / 2, Aspose.Imaging.ResizeType.BilinearResample);
// Save to PNG with the default options.
image.Save(dir + "downsample.bilinear.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
ResizeProportional(인트, 인트, ResizeType)
이 편리한 방법으로 측면 비율을 유지하는 동안 이미지를 재구성합니다.이 아이디어는 이미지 차원을 비례적으로 조정하고 일관성을 보장하고 원래 콘텐츠의 비율을 유지하려는 개발자를위한 것입니다.비례 재구성은 new의 비율에 따라 각 프레임을 재구성합니다.Width’/width and
newHeight’/height.
public void ResizeProportional(int newWidth, int newHeight, ResizeType resizeType)
Parameters
newWidth
int
새로운 광도 입니다.
newHeight
int
새로운 높이 입니다.
resizeType
ResizeType
리세스 타입이죠.
ResizeWidthProportionally(인트, ResizeType)
이미지의 폭을 조정하면서 이 편리한 것과 함께 측면 비율을 유지합니다.개발자가 이미지를 비례적으로 재시작하려는 데 이상적입니다.다양한 디스플레이 환경에서 일관되고 시각적으로 매력적인 결과를 얻습니다.
public override void ResizeWidthProportionally(int newWidth, ResizeType resizeType)
Parameters
newWidth
int
새로운 광도 입니다.
resizeType
ResizeType
리시스의 종류입니다.
Examples
이 예제는 DICOM 이미지를 업로드하고 다양한 리시팅 방법을 사용하여 비례적으로 재시작합니다.
string dir = "c:\\temp\\";
using (Aspose.Imaging.FileFormats.Dicom.DicomImage image = (Aspose.Imaging.FileFormats.Dicom.DicomImage)Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
// Scale up by 2 times using Nearest Neighbour resampling.
image.ResizeWidthProportionally(image.Width* 2, Aspose.Imaging.ResizeType.NearestNeighbourResample);
// Save to PNG with the default options.
image.Save(dir + "upsample.nearestneighbour.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
using (Aspose.Imaging.FileFormats.Dicom.DicomImage image = (Aspose.Imaging.FileFormats.Dicom.DicomImage)Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
// Scale down by 2 times using Nearest Neighbour resampling.
image.ResizeWidthProportionally(image.Width / 2, Aspose.Imaging.ResizeType.NearestNeighbourResample);
// Save to PNG with the default options.
image.Save(dir + "downsample.nearestneighbour.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
using (Aspose.Imaging.FileFormats.Dicom.DicomImage image = (Aspose.Imaging.FileFormats.Dicom.DicomImage)Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
// Scale up by 2 times using Bilinear resampling.
image.ResizeWidthProportionally(image.Width* 2, Aspose.Imaging.ResizeType.BilinearResample);
// Save to PNG with the default options.
image.Save(dir + "upsample.bilinear.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
using (Aspose.Imaging.FileFormats.Dicom.DicomImage image = (Aspose.Imaging.FileFormats.Dicom.DicomImage)Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
// Scale down by 2 times using Bilinear resampling.
image.ResizeWidthProportionally(image.Width / 2, Aspose.Imaging.ResizeType.BilinearResample);
// Save to PNG with the default options.
image.Save(dir + "downsample.bilinear.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
Rotate(플로트, 볼, 색상)
이 편리한 방법으로 그 중심 주위에 이미지를 회전하십시오.이미지 방향을 역동적으로 조정하고 최적의 프레젠테이션을 보장하고,그들의 응용 프로그램 내에서 일치합니다.
public override void Rotate(float angle, bool resizeProportionally, Color backgroundColor)
Parameters
angle
float
긍정적 값은 시계로 회전합니다.
resizeProportionally
bool
‘진실’으로 설정하면 이미지 크기가 변경되며, 다른 경우에는 측정이 터치되지 않고 internal 이미지 콘텐츠만 회전됩니다.
backgroundColor
Color
배경의 색깔.
Examples
이 예제는 DICOM 이미지의 모든 페이지를 회전하고 다중 프레임 TIFF 이미지로 모두 저장하는 방법을 보여줍니다.
string dir = "c:\\temp\\";
// Load a DICOM image from a file stream.
using (System.IO.Stream stream = System.IO.File.OpenRead(dir + "multiframe.dicom"))
{
using (Aspose.Imaging.FileFormats.Dicom.DicomImage dicomImage = new Aspose.Imaging.FileFormats.Dicom.DicomImage(stream))
{
// Rotate the image around the center by 60 degrees clockwise.
// Use gray as the background color.
dicomImage.Rotate(60, true, Aspose.Imaging.Color.Gray);
Aspose.Imaging.ImageOptions.TiffOptions createOptions = new Aspose.Imaging.ImageOptions.TiffOptions(Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
createOptions.Compression = Aspose.Imaging.FileFormats.Tiff.Enums.TiffCompressions.Deflate;
// Note that if the image is colorful, it will be automatically converted to the grayscale format according to the options below
createOptions.Photometric = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPhotometrics.MinIsBlack;
createOptions.BitsPerSample = new ushort[] { 8 };
// Create an array of TIFF frames.
// The number of the frames is equal to the number of the DJVU pages.
Aspose.Imaging.FileFormats.Tiff.TiffFrame[] tiffFrames = new Aspose.Imaging.FileFormats.Tiff.TiffFrame[dicomImage.DicomPages.Length];
// Save each page as an individual TIFF frame.
foreach (Aspose.Imaging.FileFormats.Dicom.DicomPage dicomPage in dicomImage.DicomPages)
{
// Create a TIFF frame based on the DICOM page.
tiffFrames[dicomPage.Index] = new Aspose.Imaging.FileFormats.Tiff.TiffFrame(dicomPage, createOptions);
}
// Compose a TIFF image from the frames.
using (Aspose.Imaging.FileFormats.Tiff.TiffImage tiffImage = new Aspose.Imaging.FileFormats.Tiff.TiffImage(tiffFrames))
{
// Save to a file.
tiffImage.Save(dir + "multiframe.tif");
}
}
}
RotateFlip(RotateFlipType)
활성 프레임을 라우팅, 플리핑 또는 두 가지 작업을 수행함으로써 쉽게 조작하십시오.이 간단한 방법과 동시에 개발자를위한 이상적인그들의 이미지 순서 내에서 특정 프레임의 방향을 역동적으로 조정,최적의 프레젠테이션과 적응을 보장합니다.
public override void RotateFlip(RotateFlipType rotateFlipType)
Parameters
rotateFlipType
RotateFlipType
로테이트 플립 유형
Examples
이 예제는 DICOM 이미지를 충전하고, 90도 시계로 회전하고, 선택적으로 이미지를 수평 및/또는 수직으로 니다.
string dir = "c:\\temp\\";
Aspose.Imaging.RotateFlipType[] rotateFlipTypes = new Aspose.Imaging.RotateFlipType[]
{
Aspose.Imaging.RotateFlipType.Rotate90FlipNone,
Aspose.Imaging.RotateFlipType.Rotate90FlipX,
Aspose.Imaging.RotateFlipType.Rotate90FlipXY,
Aspose.Imaging.RotateFlipType.Rotate90FlipY,
};
foreach (Aspose.Imaging.RotateFlipType rotateFlipType in rotateFlipTypes)
{
// Rotate, flip and save to the output file.
using (Aspose.Imaging.FileFormats.Dicom.DicomImage image = (Aspose.Imaging.FileFormats.Dicom.DicomImage)Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
image.RotateFlip(rotateFlipType);
image.Save(dir + "sample." + rotateFlipType + ".png", new Aspose.Imaging.ImageOptions.PngOptions());
}
}
Save(흐름, ImageOptionsBase, Rectangle)
원하는 파일 형식의 특정 스트림으로 이미지 데이터를 쉽게 저장합니다.이 편리한 방법을 사용하십시오. JPEG, PNG 또는 다른 형식으로 작업하고 있는지 여부,이 기능은 이미지 데이터가 효율적이고 정확하게 저장되도록 보장합니다.개발자가 파일 저장 프로세스를 단순화하려는 데 이상적입니다.
public override void Save(Stream stream, ImageOptionsBase optionsBase, Rectangle boundsRectangle)
Parameters
stream
Stream
흐름은 이미지의 데이터를 저장합니다.
optionsBase
ImageOptionsBase
저축 옵션
boundsRectangle
Rectangle
목적지 이미지는 직경을 제한합니다. 빈 직경을 설정하여 출처 제한을 사용합니다.
Examples
다음 예제는 파일에서 DICOM 이미지를 업로드 한 다음 PNG 파일 스트림으로 이미지를 저장합니다.
string dir = "c:\\temp\\";
using (Aspose.Imaging.FileFormats.Dicom.DicomImage image = (Aspose.Imaging.FileFormats.Dicom.DicomImage)Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
Aspose.Imaging.ImageOptions.PngOptions saveOptions = new Aspose.Imaging.ImageOptions.PngOptions();
Aspose.Imaging.Rectangle bounds = new Aspose.Imaging.Rectangle(0, 0, image.Width / 2, image.Height / 2);
using (System.IO.Stream outputStream = System.IO.File.Open(dir + "output.png", System.IO.FileMode.Create))
{
// Save the upper-left quarter of the image to a file stream.
image.Save(outputStream, saveOptions, bounds);
}
}
SaveAll(링크, ImageOptionsBase)
지정된 파일에 저장함으로써 개체의 데이터를 저장합니다 (인덱서 + 파일 이름)지정된 파일 형식과 옵션과 함께 위치. 개발자가 찾고있는 데 이상적인다양한 형식의 데이터를 안전하게 저장하면서 유연성과 통제를 유지합니다.저장된 파라미터
public void SaveAll(string filePath, ImageOptionsBase options)
Parameters
filePath
string
파일 경로 입니다.
options
ImageOptionsBase
그 옵션들
SaveData(Stream)
데이터를 저장합니다.
protected override void SaveData(Stream stream)
Parameters
stream
Stream
데이터를 저장하기위한 스트림.
SetResolution(더블, 더블)
이 Aspose.Imaging.RasterImage의 해상도를 정확하게 사용하여 조정합니다.간단한 방법. 개발자가 이미지 해상도를 조정하고자하는 데 이상적입니다.특정 요구 사항, 최적의 디스플레이 품질 및 파일 크기 관리 보장.
public override void SetResolution(double dpiX, double dpiY)
Parameters
dpiX
double
Aspose.Imaging.RasterImage의 수평 해상도, 인치 당 포인트.
dpiY
double
Aspose.Imaging.RasterImage의 수직 해상도, 인치 당 포인트.
UpdateDimensions(이트, 이트)
이미지 차원을 업데이트합니다.
protected override void UpdateDimensions(int newWidth, int newHeight)
Parameters
newWidth
int
새로운 이미지 폭.
newHeight
int
새로운 이미지 높이.