Also consult the wiki (https://github.com/fo-dicom/fo-dicom/wiki) for answers to common questions.
DicomPixelData.Create(dicomVideoFile.Dataset, true);
- this file is stored on file system and then read from another process. This process is used to store the pixel data itself. There I am opening the pixel data with DicomPixelData.Create(dicomVideoFile.Dataset, false);
because I only want to add the frames itself. When I use a FileByteBuffer
object from jpeg files to add frames (JpegBaseline TS, EncapsulatedPixelData) everything works as expected. When I use a MemoryByteBuffer
for bitmaps in memory instead (ImplicitVRLittleEndian, OtherWordPixelData) I get following exception: 'Expected pixel data element to have a CompositeByteBuffer.' If I change the call to DicomPixelData.Create(dicomVideoFile.Dataset, true)
it works as expected. Why is there a difference?
Image will be dark completely after resizing, I did resize image as:
using (var renderedImage = image.RenderImage(i))
{
var resizedImage = renderedImage.AsSharedBitmap().Resize(newSize);
resizeImages.Add(resizedImage);
}
Then uncompress DCM file because AddGrayScale
just works with uncompressed DataSet
and Remove PixelData
like:
var clonDs = dicomFile.Dataset.Clone(DicomTransferSyntax.ExplicitVRLittleEndian);
if (clonDs.HasPixelData())
clonDs.Remove(DicomTag.PixelData);
var newDS = clonDs.AddImageGrayscale(new GrayscaleMutationDto() { Images = resizeImages.Cast<Image>(), BitsPerPixel = (ushort)bitsAllocated, RowPixelSpacing = newPixelSpacing.Row, ColumnPixelSpacing = newPixelSpacing.Column });
newDS.Save(@"C:\ResizedImage.dcm");
but ResizedImage.dcm
will be black.
any clue would be appreciated.
var transferSyntaxOfDcm = DicomTransferSyntax.JPEG2000Lossless;
transferSyntaxOfDcm = DicomTransferSyntax.JPEGLSLossless;
var dcm = FellowOakDicom.DicomFile.Open(inPath);
var original = dcm.Dataset;
var changed = original.Clone(transferSyntaxOfDcm);
var newdcm = new FellowOakDicom.DicomFile(changed);
newdcm.Save(outPath);
Hello everyone!
I have a question to use DicomImage in UWP application.
I know, that in fo-dicom version 4.0.8 i can add nuget package extension to UWP app and base dicom lib. But how to do it in higher version?
Version:5.0.3.
How to convert IImage to WriteableBitmap, cause if a use method T As<T>(), i had exeception, that i have byte[] array.
I see, that i need to use IImageManager in article her, but maybe somebody have example for this sutiation?
My code example here:
FileOpenPicker openPicker = new FileOpenPicker();
openPicker.ViewMode = PickerViewMode.Thumbnail;
openPicker.SuggestedStartLocation = PickerLocationId.ComputerFolder;
openPicker.FileTypeFilter.Add(".dcm");
StorageFile file = await openPicker.PickSingleFileAsync();
if (file != null)
{
Windows.Storage.Streams.IRandomAccessStream openFile = await file.OpenAsync(FileAccessMode.Read);
Stream sr = new StreamReader(openFile.AsStream()).BaseStream;
FellowOakDicom.DicomFile dicomFile = FellowOakDicom.DicomFile.Open(sr);
FellowOakDicom.Imaging.DicomImage dicomImage = new FellowOakDicom.Imaging.DicomImage(dicomFile.Dataset, 0);
FellowOakDicom.Imaging.IImage imgInterface = dicomImage.RenderImage(currentFrame);
var img1 = dicomImage.RenderImage(0).As<BitmapImage>();
}
Thanks everyone for you support!
DCT coefficient out of range
error,1.2.840.10008.1.2.4.70 (JPEG Lossless, Non-Hierarchical, First-Order Prediction (Process 14 [Selection Value 1]): Default Transfer Syntax for Lossless JPEG Image Compression)
and I am changing it to DicomTransferSyntax.JPEGProcess2_4
, is there a way to avoid this error?
I have implemented C-Store using OnCStoreRequestAsync of IDicomCStoreProvider. But the speed of transfer seem to be very slow. Which makes it unusable at the current state. Is there improvements that I can take. Such as receiving multiple request and saving those file into the server in async way. I have read through this article:
https://www.dicomstandard.org/docs/librariesprovider2/dicomdocuments/wp-cotent/uploads/2018/10/day2_s19-matthijssen-improvedicomnetwoktransfertime.pdf?sfvrsn=3da9e205_2
it talks about Enhanced Family of objects, and A-synchronous Transfer. How to enable A-synchronous Transfer in the fo-dicom
My Current Code:
Receive a single request -> Save the file in FTP server -> Save the information in the Database -> Return the success result.