LAUREL BRIDGE

LaurelBridge.DCFExamples.BitmapToNde Namespace

DICOM Connectivity Framework V3.4
The BitmapToNde example demonstrates how to use the DCF to create a ultrasound dataset for use in the Non-Destructive Evaluation (NDE) scenarios. A custom tag dictionary with the NDE tag overrides is also provided.
Classes

  ClassDescription
Public classHistogram
A histogram class ultimately used to calculate a window center and width for monochrome images.
Public classNDETags
DICONDE tag constants.
Public classOptions
A class for BitmapToNde program options.
Public classProgram
An example program to demonstrate how to create a DICONDE non-destructive evaluation (NDE) dataset from a bitmap file.
Public classRgbToMono
A class that facilitates the conversion of 24 bit RGB pixel values to monochrome.
Public classUSImage
An example USImage class to demonstrate loading and or creating a DICONDE image.
Remarks

Supported OS Platforms:

  • Windows - .Net Framework 4.7.2 64-bit and 32-bit
  • Windows - .Net Core 2.1 64-bit and 32-bit
  • Linux - .Net Core 2.1 64-bit

Examples

BitmapToNde Sample Code
public class Program
{
    private static readonly ILogger Logger = LogManager.GetCurrentClassLogger();

    /// <summary>
    /// Main entry point for BitmapToNde.
    /// </summary>
    /// <param name="args">command line arguments</param>
    [STAThread]
    static void Main(string[] args)
    {
        try
        {
            Options options;
            if (!Options.TryParse(args, out options))
            {
                throw new ArgumentException("bad command line parameters");
            }

            USImage usImage = USImage.LoadImage(options);
            // Modify usImage to add demographics
            usImage.ComponentName = new DicomPNElement(NDETags.ComponentName, "my component name");
            usImage.Save(options.DicomPath, options.TransferSyntax);
            Console.WriteLine("Bitmap file {0} saved to DICOM file {1}", options.BitmapPath, options.DicomPath);
        }
        catch (Exception e)
        {
            Logger.Error(e, "Exception caught during execution:");
            Environment.ExitCode = 1;
        }
        finally
        {
            if (System.Diagnostics.Debugger.IsAttached)
            {
                Console.Write("Press any key to continue . . . ");
                Console.ReadKey();
            }
        }
    }
}