public DicomDatasetWalkerTest() { var dataset = new DicomDataset( new DicomUniqueIdentifier(DicomTag.SOPClassUID, DicomUID.RTDoseStorage), new DicomUniqueIdentifier(DicomTag.SOPInstanceUID, "1.2.3"), new DicomDate(DicomTag.AcquisitionDate, DateTime.Today), new DicomPersonName(DicomTag.ConsultingPhysicianName, "Doe", "John"), new DicomDecimalString(DicomTag.GridFrameOffsetVector, 1.0m, 2.0m, 3.0m, 4.0m, 5.0m, 6.0m), new DicomSequence( DicomTag.BeamSequence, new DicomDataset( new DicomIntegerString(DicomTag.BeamNumber, 1), new DicomDecimalString(DicomTag.FinalCumulativeMetersetWeight, 1.0m), new DicomLongString(DicomTag.BeamName, "Ant")), new DicomDataset( new DicomIntegerString(DicomTag.BeamNumber, 2), new DicomDecimalString(DicomTag.FinalCumulativeMetersetWeight, 100.0m), new DicomLongString(DicomTag.BeamName, "Post")), new DicomDataset( new DicomIntegerString(DicomTag.BeamNumber, 3), new DicomDecimalString(DicomTag.FinalCumulativeMetersetWeight, 2.0m), new DicomLongString(DicomTag.BeamName, "Left"))), new DicomIntegerString(DicomTag.NumberOfContourPoints, 120)); this.walker = new DicomDatasetWalker(dataset); this.walkerImpl = new DatasetWalkerImpl(); }
public static IAsyncResult BeginWalk( this DicomDatasetWalker @this, IDicomDatasetWalker walker, AsyncCallback callback, object state) { return(AsyncFactory.ToBegin(@this.WalkAsync(walker), callback, state)); }
private DicomDataset DeepClone_(DicomDataset dataset) { var ms = new MemoryStream(); var target = new StreamByteTarget(ms); var writer = new DicomWriter(DicomTransferSyntax.ImplicitVRLittleEndian, DicomWriteOptions.Default, target); var walker = new DicomDatasetWalker(dataset); walker.Walk(writer); var clone = new DicomDataset(); var reader = new DicomReader { IsExplicitVR = false }; var byteSource = new ByteBufferByteSource( new MemoryByteBuffer(ms.ToArray())); reader.Read(byteSource, new DicomDatasetReaderObserver(clone)); return clone; }
public void OnBeginWalk(DicomDatasetWalker walker, DicomDatasetWalkerCallback callback) { }
public static void EndWalk(this DicomDatasetWalker @this, IAsyncResult result) { AsyncFactory.ToEnd(result); }