Class DicomOptions
Το όνομα: Aspose.Imaging.ImageOptions Συγκέντρωση: Aspose.Imaging.dll (25.4.0)
Το API για την ψηφιακή εικόνα και τις επικοινωνίες στην ιατρική (DICOM)Η δημιουργία μορφής είναι ένα εξειδικευμένο εργαλείο προσαρμοσμένο στις εφαρμογές ιατρικών συσκευών.Επιτρέπει την αδιάβροχη γενιά εικόνων DICOM, κρίσιμης σημασίας για την ιατρική αποθήκευσηδεδομένων και που περιέχουν ζωτικές πληροφορίες αναγνώρισης. με χαρακτηριστικά γιακαι να ρυθμίσετε την συμπίεση, να καθορίσετε τους τύπους χρωμάτων, και να ενσωματώσετε τα μεταδεδομένα XMP, οι προγραμματιστέςμπορεί να εξασφαλίσει τη συμμόρφωση και την ευελιξία στη διαχείριση εικόνων DICOM για ιατρικήσκοπούς απεικόνισης.
public class DicomOptions : ImageOptionsBase, IDisposable, IHasXmpData, IHasMetadata, ICloneable
Inheritance
object ← DisposableObject ← ImageOptionsBase ← DicomOptions
Implements
IDisposable , IHasXmpData , IHasMetadata , ICloneable
Κληρονομημένα μέλη
ImageOptionsBase.Clone() , ImageOptionsBase.ReleaseManagedResources() , ImageOptionsBase.KeepMetadata , ImageOptionsBase.XmpData , ImageOptionsBase.Source , ImageOptionsBase.Palette , ImageOptionsBase.ResolutionSettings , ImageOptionsBase.VectorRasterizationOptions , ImageOptionsBase.BufferSizeHint , ImageOptionsBase.MultiPageOptions , ImageOptionsBase.FullFrame , ImageOptionsBase.ProgressEventHandler , DisposableObject.Dispose() , DisposableObject.ReleaseManagedResources() , DisposableObject.ReleaseUnmanagedResources() , DisposableObject.VerifyNotDisposed() , DisposableObject.Disposed , object.GetType() , object.MemberwiseClone() , 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);
}
Χρησιμοποιήστε τη συμπίεση RLE στην εικόνα DICOM.
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);
}
Χρησιμοποιήστε τη συμπίεση JPEG 2000 σε εικόνα DICOM.
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);
}
Χρησιμοποιήστε τη συμπίεση JPEG σε εικόνα DICOM.
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 (single και multipage).
string fileName = "sample.jpg";
string inputFileNameSingle = fileName;
string inputFileNameMultipage = "multipage.tif";
string outputFileNameSingleDcm = "output.dcm";
string outputFileNameMultipageDcm = "outputMultipage.dcm";
// The next code sample converts JPEG image to DICOM file format
using (var image = Aspose.Imaging.Image.Load(inputFileNameSingle))
{
image.Save(outputFileNameSingleDcm, new Aspose.Imaging.ImageOptions.DicomOptions());
}
// DICOM format supports multipage images. You can convert GIF or TIFF images to DICOM in the same way as JPEG images
using (var imageMultiple = Aspose.Imaging.Image.Load(inputFileNameMultipage))
{
imageMultiple.Save(outputFileNameMultipageDcm, new Aspose.Imaging.ImageOptions.DicomOptions());
}
Δημιουργήστε μια πολλαπλή εικόνα Dicom.
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
DicomOptions()
public DicomOptions()
Properties
ColorType
Αποκτά ή καθορίζει τον τύπο του χρώματος.
public ColorType ColorType { get; set; }
Αξία ιδιοκτησίας
Examples
Αλλαγή τύπου χρώματος σε συμπίεση DICOM.
using (var inputImage = Image.Load("original.jpg"))
{
var options = new DicomOptions { ColorType = ColorType.Grayscale8Bit };
inputImage.Save("original_8Bit.dcm", options);
}
Χρησιμοποιήστε τη συμπίεση RLE στην εικόνα DICOM.
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);
}
Χρησιμοποιήστε τη συμπίεση JPEG 2000 σε εικόνα DICOM.
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);
}
Χρησιμοποιήστε τη συμπίεση JPEG σε εικόνα DICOM.
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);
}
Compression
Πάρτε ή τοποθετήστε την συμπίεση.
public Compression Compression { get; set; }
Αξία ιδιοκτησίας
Examples
Αλλαγή τύπου χρώματος σε συμπίεση DICOM.
using (var inputImage = Image.Load("original.jpg"))
{
var options = new DicomOptions { ColorType = ColorType.Grayscale8Bit };
inputImage.Save("original_8Bit.dcm", options);
}
Χρησιμοποιήστε τη συμπίεση RLE στην εικόνα DICOM.
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);
}
Χρησιμοποιήστε τη συμπίεση JPEG 2000 σε εικόνα DICOM.
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);
}
Χρησιμοποιήστε τη συμπίεση JPEG σε εικόνα DICOM.
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);
}