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.0.0.0.0.297 (.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.
Remarks

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:

TiffEncoder encoder = new TiffEncoder(outputStream);

encoder.Append = true;

// get dataset

using (DicomDataset dataset = new DicomDataset(intputStream)) {

// get modality transformed dicom image

using (DicomImage dicomImage = dataset.GetModalityTransformedImage(0);

// make the AtalaImage

AtalaImage atalaImage = dicomImage.AllocateAtalaImage();

for (int window = 0; window lt; 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(atalaImage, null);

}

atalaImage.Dispose();

}

}

See Also