Implement CancellationToken in Fo-Dicom

158 Views Asked by At

I need to implement a Cancellation token in a fo-dicom but didn't find any proper solution or example, based on that I can get an idea or help, So if anyone has implemented or has any example please post here. Thank you very much,

                DicomDataset sqContent = new DicomDataset
                {
                    { DicomTag.Modality, "OT" },
                    { DicomTag.ScheduledProcedureStepStartDate, DateTime.Now.Date }
                }; //Content of the sequence

                DicomSequence sq = new DicomSequence(DicomTag.ScheduledProcedureStepSequence, sqContent); // Create sequence, add content
                ds.AddOrUpdate(sq);
                byte[] videoBytes = File.ReadAllBytes(dicomModel.UploadMediaModel.Files[0].FileName);
                MemoryByteBuffer buffer = new MemoryByteBuffer(videoBytes);
                pixelData.AddFrame(buffer);
                DicomFile dicomfile = new DicomFile(ds);
                dicomfile.FileMetaInfo.TransferSyntax = DicomTransferSyntax.Lookup(DicomUID.MPEG4HP41);
                dicomfile.Save(fileName);

                await client.AddRequestAsync(new DicomCStoreRequest(dicomfile));
                await client.SendAsync();
0

There are 0 best solutions below