DicomImageAllocateAtalaImage Method |
Namespace: Atalasoft.Imaging.Codec.Dicom
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(); } }