The BitmapToDicom example demonstrates how to use the DCF to create a secondary capture dataset.
Classes
Class | Description | |
---|---|---|
Histogram |
A histogram class ultimately used to calculate a window center and width for monochrome images.
| |
Options |
A class for BitmapToDicom program options.
| |
Program |
An example program to demonstrate how to create a DICOM dataset from a bitmap file.
| |
RgbToMono |
A class that facilitates the conversion of 24 bit RGB pixel values to monochrome.
| |
SCImage |
An example SCImage class that derives from SecondaryCaptureImage.
|
Examples
BitmapToDicom Sample Code
public class Program { private static readonly ILogger Logger = LogManager.GetCurrentClassLogger(); /// <summary> /// Main program for BitmapToDicom. /// </summary> /// <param name="args">command line arguments</param> [STAThread] public static void Main(string[] args) { int status = 1; try { Options options; if (!Options.TryParse(args, out options)) return; SCImage scImage = SCImage.LoadImage(options); // Modify scImage to add demographics scImage.Save(options.DicomPath, options.TransferSyntax); status = 0; } catch (Exception e) { status = 2; Logger.Error(e, "BitmapToDicom: failed: "); } finally { if (System.Diagnostics.Debugger.IsAttached) { Console.Write("Press any key to continue . . . "); Console.ReadKey(); } } Environment.Exit(status); } }