LaurelBridge.DCF.Examples.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.

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.

BitmapToNde Sample Code
public class Program
    private static readonly ILogger Logger = LogManager.GetCurrentClassLogger();
    internal static String[] Usage = new string[]
        "usage:" +
        "   BitmapToNde -h",
        "   BitmapToNde [ -p photometric -s stored -a allocated -r representation -T tsUid ] bmpPath ndePath",
        "Example program to convert a bitmap file to a DICONDE dataset.",
        "Required Parameters:",
        "   bmpPath        : the path to the bitmap file",
        "   ndePath        : the path for the DICONDE output file, which is overwritten if it exists",
        "Optional Parameters:",
        "   photometric    : one of RGB, M2 (MONOCHROME2), M1 (MONOCHOME1), default=RGB",
        "   stored         : 8 for RGB, 3-16 for MONO1 or MONO2, default=8 for RGB, 12 for MONO",
        "   allocated      : 8 or 16, RGB is 8 only, default=8 for bits stored <= 8, otherwise 16",
        "   representation : one of 0 (unsigned) or 1 (signed), RGB is unsigned only, default is unsigned for MONO",
        "   tsUid          : the transfer syntax uid, default=1.2.840.10008.1.2.1 (ELE)",
        "If MONO1 or MONO2 is specified, image is converted to grayscale using the specified bit depth."

    /// <summary>
    /// Main entry point for BitmapToNde.
    /// </summary>
    /// <param name="args">command line arguments</param>
    static void Main(string[] args)
        int status = 1;
            Options options = Options.GetOptions(args, Usage);

            if (options != null)
                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);
                status = 0;
        catch (Exception e)
            Logger.Error(e, "Exception caught during execution:");
            status = 2;

        if (System.Diagnostics.Debugger.IsAttached)
            Console.Write("Press any key to continue . . . ");