Denne artikel tjener som en omfattende vejledning om, hvordan man konverterer DICOM-billeder til JPG, PNG, BMP og GIF-format i C# ved hjælp af den kraftige Aspose.Imaging bibliotek.

DICOM to Image

Hvad er DICOM?

Dykom (Digital Imaging and Communications in Medicine) is a standardized format widely used for storing and sharing medical imaging data. It includes both header and image information, typically found in scans such as ultrasounds and MRIs. These images are essential for healthcare professionals to convey critical patient information effectively.

Mens der findes mange offline og online DICOM-søgere, kræver det ofte konvertering til mere universelt accepterede formater som JPG, GIF , PNG eller BMP. I denne artikel vil du lære, hvordan du programmerer at konvertere dicom-billeder** ved hjælp af C# .

  • JPG
  • GIF
  • PNG
  • BMP

Effektiv DICOM Conversion med C# - Gratis Download

To efficiently convert DICOM images, we will leverage Opdagelse for .NET, a user-friendly API designed for creating and manipulating various image types within .NET applications. You can find Opdagelse for .NET on NuGet and download the Binære for integration.

Konverter DICOM til JPG i C#

For at konvertere en DICOM-fil til JPG i C#, skal du følge disse trin:

  • Load the DICOM file into a FileStream object.
  • Create an instance of the af Dicomimage class and initialize it with the FileStream object.
  • Vælg den aktive side i DICOM-filen for konvertering til JPG (den standard aktive side vil blive brugt, hvis ingen er indstillet).
  • Save the converted JPG image using the DicomImage.Save(string, ImageOptionsBase) method.

Her er et kodeksempel, der viser, hvordan man konverterer en DICOM-side til JPG i C#:

Eksempel på indtjening DICOM

DICOM to JPEG

Udgang: DICOM til JPEG

Convert DICOM to JPEG C#

Konverter DICOM til GIF i C#

Processen med at konvertere DICOM til GIF er enkel. Bare få adgang til DIKOM-filen og gem den med udvidelsen .gif. Her er hvordan:

Her er et kodeksempel for at konvertere DICOM til GIF i C#:

C# DICOM til PNG konvertering

Converting DICOM to PNG follows a similar process to converting to JPEG. Access the DICOM file using the af Dicomimage class and save it with the .png extension. Here’s a code sample for converting DICOM to PNG in C#:

Eksport DICOM til BMP i C#

To convert DICOM to BMP, follow the same steps as before to access the DICOM file using the af Dicomimage class. Once accessed, use the DicomImage.Save(string, ImageBaseOptions) method to save the DICOM as BMP. Here’s a code sample for this conversion:

Konklusion

I denne artikel har du lært, hvordan man konverterer DICOM-billeder til PNG, JPG, BMP og GIF-formater ved hjælp af C#. Du kan helt sikkert integrere de leverede kodemønstre i dine applikationer for effektive DICOM-konverteringer, alle faciliteret af den overkommelige Aspose-plugin til kun $99.

Læs mere om C# DICOM til Image Conversion

Explore more about Arbejde med billeder using the Aspose.Imaging for .NET API.

Yderligere ressourcer

Info: You may find the Aspose Tekst til GIF web app interesting.

More in this category