Click or drag to resize

DicomImageAllocateAtalaImage Method

Allocates an AtalaImage object into which this DicomImage could be transformed.

Namespace:  Atalasoft.Imaging.Codec.Dicom
Assembly:  Atalasoft.dotImage.Dicom (in Atalasoft.dotImage.Dicom.dll) Version: 11.4.0.9.0.377 (.NET 4.5.2, x86)
Syntax
public AtalaImage AllocateAtalaImage()

Return Value

Type: AtalaImage
A new AtalaImage that matches the correct size and PixelFormat appropriate for this DicomImage.
Examples
This method is useful for creating a single AtalaImage into which transforms of the DicomImage can be placed. For example, you might want to encode multiple transforms of a DicomImage into a TIFF file:
C# example
TiffEncoder encoder = new TiffEncoder();
encoder.Append = true;
// get dataset
using (var dataset = new DicomDataset(inputStream))
{
    // get modality transformed dicom image
    using (var dicomImage = dataset.GetModalityTransformedImage(0))
    {
        // make the AtalaImage
        var atalaImage = dicomImage.AllocateAtalaImage();
        for (int window = 0; window < 200; window += 10) {
            int normalizedWindow = window + dicomImage.DefaultWindow;
            if (dicomImage.ImageCameFromSignedSamples)
                normalizedWindow += dicomImage.ImageDataShiftedBy;
            // transform the dicom image into our AtalaImage
            dicomImage.GetAtalaImage(atalaImage, normalizedWindow, dicomImage.DefaultLeveling);
            // append to the tiff file
            encoder.Save(outputStream, atalaImage, null);
        }
        atalaImage.Dispose();
    }
}
See Also