private static IEnumerable<SupportedSop> GetSupportedSops() { var extendedConfiguration = LocalDicomServer.GetExtendedConfiguration(); foreach (SopClass sopClass in GetSopClasses(extendedConfiguration.ImageStorageSopClassUids)) { var supportedSop = new SupportedSop { SopClass = sopClass }; supportedSop.AddSyntax(TransferSyntax.ExplicitVrLittleEndian); supportedSop.AddSyntax(TransferSyntax.ImplicitVrLittleEndian); foreach (TransferSyntax transferSyntax in GetTransferSyntaxes(extendedConfiguration.StorageTransferSyntaxUids)) { if (transferSyntax.DicomUid.UID != TransferSyntax.ExplicitVrLittleEndianUid && transferSyntax.DicomUid.UID != TransferSyntax.ImplicitVrLittleEndianUid) { supportedSop.AddSyntax(transferSyntax); } } yield return supportedSop; } }
private static IEnumerable<SupportedSop> GetSupportedSops() { var extendedConfiguration = LocalDicomServer.GetExtendedConfiguration(); foreach (SopClass sopClass in GetSopClasses(extendedConfiguration.NonImageStorageSopClassUids)) { var supportedSop = new SupportedSop { SopClass = sopClass }; supportedSop.AddSyntax(TransferSyntax.ExplicitVrLittleEndian); supportedSop.AddSyntax(TransferSyntax.ImplicitVrLittleEndian); yield return supportedSop; } }
/// <summary> /// Load a list of preferred SOP Classes and Transfer Syntaxes for a Device. /// </summary> /// <param name="read">A read context to read from the database.</param> public void LoadPreferredSyntaxes(IPersistenceContext read) { var select = read.GetBroker<IDevicePreferredTransferSyntaxEntityBroker>(); // Setup the select parameters. var criteria = new DevicePreferredTransferSyntaxSelectCriteria(); criteria.DeviceKey.EqualTo(_remoteDevice.GetKey()); IList<DevicePreferredTransferSyntax> list = select.Find(criteria); // Translate the list returned into the database into a list that is supported by the Storage SCU Component var sopList = new List<SupportedSop>(); foreach (DevicePreferredTransferSyntax preferred in list) { var sop = new SupportedSop { SopClass = SopClass.GetSopClass(preferred.GetServerSopClass().SopClassUid) }; sop.AddSyntax(TransferSyntax.GetTransferSyntax(preferred.GetServerTransferSyntax().Uid)); sopList.Add(sop); } SetPreferredSyntaxList(sopList); }
/// <summary> /// Load a list of preferred SOP Classes and Transfer Syntaxes for a Device. /// </summary> /// <param name="request">A read context to read from the database.</param> public void LoadPreferredSyntaxes(DicomSendRequest request) { _sendRequest = request; // TODO (CR Jun 2012): Just set it since it's not an event? // Add a delegate to do the actual selection of the contexts; PresentationContextSelectionDelegate += SelectPresentationContext; var dic = new Dictionary<SopClass, SupportedSop>(); foreach (var storageInstance in StorageInstanceList) { // skip if failed in LoadStorageInstanceInfo, ie file not found if (storageInstance.SendStatus == DicomStatuses.ProcessingFailure) continue; storageInstance.LoadInfo(); SupportedSop sop; if (!dic.TryGetValue(storageInstance.SopClass,out sop)) { sop = new SupportedSop { SopClass = storageInstance.SopClass }; if (request.CompressionType == CompressionType.JpegLossless) sop.AddSyntax(TransferSyntax.JpegLosslessNonHierarchicalFirstOrderPredictionProcess14SelectionValue1); else if (request.CompressionType == CompressionType.Rle) sop.AddSyntax(TransferSyntax.RleLossless); else if (request.CompressionType == CompressionType.J2KLossy) sop.AddSyntax(TransferSyntax.Jpeg2000ImageCompression); else if (request.CompressionType == CompressionType.J2KLossless) sop.AddSyntax(TransferSyntax.Jpeg2000ImageCompressionLosslessOnly); else if (request.CompressionType == CompressionType.JpegLossy) { sop.AddSyntax(TransferSyntax.JpegBaselineProcess1); sop.AddSyntax(TransferSyntax.JpegExtendedProcess24); } dic.Add(storageInstance.SopClass, sop); } } SetPreferredSyntaxList(dic.Values); }