本文整理汇总了C#中ClearCanvas.Dicom.Network.ServerAssociationParameters类的典型用法代码示例。如果您正苦于以下问题:C# ServerAssociationParameters类的具体用法?C# ServerAssociationParameters怎么用?C# ServerAssociationParameters使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ServerAssociationParameters类属于ClearCanvas.Dicom.Network命名空间,在下文中一共展示了ServerAssociationParameters类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: OnReceiveRequestMessage
public void OnReceiveRequestMessage(DicomServer server, ServerAssociationParameters association, byte presentationID, ClearCanvas.Dicom.DicomMessage message)
{
foreach (byte pcid in association.GetPresentationContextIDs())
{
DicomPresContext context = association.GetPresentationContext(pcid);
if (context.Result == DicomPresContextResult.Accept)
{
if (context.AbstractSyntax == SopClass.StudyRootQueryRetrieveInformationModelFind)
{
DicomMessage response = new DicomMessage();
response.DataSet[DicomTags.StudyInstanceUid].SetStringValue("1.2.3");
response.DataSet[DicomTags.PatientId].SetStringValue("1");
response.DataSet[DicomTags.PatientsName].SetStringValue("test");
response.DataSet[DicomTags.StudyId].SetStringValue("1");
response.DataSet[DicomTags.StudyDescription].SetStringValue("dummy");
server.SendCFindResponse(presentationID, message.MessageId, response, DicomStatuses.Pending);
DicomMessage finalResponse = new DicomMessage();
server.SendCFindResponse(presentationID, message.MessageId, finalResponse, DicomStatuses.Success);
}
else if (context.AbstractSyntax == SopClass.VerificationSopClass)
{
server.SendCEchoResponse(presentationID, message.MessageId, DicomStatuses.Success);
}
}
}
}
开发者ID:nhannd,项目名称:Xian,代码行数:27,代码来源:Form1.cs
示例2: ReceiveMessageAsFileStream
public override bool ReceiveMessageAsFileStream(Dicom.Network.DicomServer server, ServerAssociationParameters association, byte presentationId,
DicomMessage message)
{
var sopClassUid = message.AffectedSopClassUid;
if (sopClassUid.Equals(SopClass.BreastTomosynthesisImageStorageUid)
|| sopClassUid.Equals(SopClass.EnhancedCtImageStorageUid)
|| sopClassUid.Equals(SopClass.EnhancedMrColorImageStorageUid)
|| sopClassUid.Equals(SopClass.EnhancedMrImageStorageUid)
|| sopClassUid.Equals(SopClass.EnhancedPetImageStorageUid)
|| sopClassUid.Equals(SopClass.EnhancedUsVolumeStorageUid)
|| sopClassUid.Equals(SopClass.EnhancedXaImageStorageUid)
|| sopClassUid.Equals(SopClass.EnhancedXrfImageStorageUid)
|| sopClassUid.Equals(SopClass.UltrasoundMultiFrameImageStorageUid)
|| sopClassUid.Equals(SopClass.MultiFrameGrayscaleByteSecondaryCaptureImageStorageUid)
|| sopClassUid.Equals(SopClass.MultiFrameGrayscaleWordSecondaryCaptureImageStorageUid)
|| sopClassUid.Equals(SopClass.MultiFrameSingleBitSecondaryCaptureImageStorageUid)
|| sopClassUid.Equals(SopClass.MultiFrameTrueColorSecondaryCaptureImageStorageUid))
{
server.DimseDatasetStopTag = DicomTagDictionary.GetDicomTag(DicomTags.ReconstructionIndex); // Random tag at the end of group 20
server.StreamMessage = true;
return true;
}
return false;
}
开发者ID:m-berkani,项目名称:ClearCanvas,代码行数:26,代码来源:StoreScpExtension.cs
示例3: AddPresentationContexts
private static void AddPresentationContexts(ServerAssociationParameters assoc)
{
byte pcid = assoc.AddPresentationContext(SopClass.ModalityWorklistInformationModelFind);
assoc.AddTransferSyntax(pcid, TransferSyntax.ExplicitVrLittleEndian);
assoc.AddTransferSyntax(pcid, TransferSyntax.ImplicitVrLittleEndian);
}
开发者ID:khaha2210,项目名称:radio,代码行数:7,代码来源:WorklistScp.cs
示例4: OnReceiveAssociateRequest
public void OnReceiveAssociateRequest(DicomServer server, ServerAssociationParameters association)
{
if (_delayAssociationAccept.Checked)
Thread.Sleep(TimeSpan.FromSeconds(35));
if (_rejectAssociation.Checked)
server.SendAssociateReject(DicomRejectResult.Permanent, DicomRejectSource.ServiceUser, DicomRejectReason.CallingAENotRecognized);
else
server.SendAssociateAccept(association);
}
开发者ID:nhannd,项目名称:Xian,代码行数:10,代码来源:Form1.cs
示例5: OnStartFilestream
public override IDicomFilestreamHandler OnStartFilestream(Dicom.Network.DicomServer server, ServerAssociationParameters association,
byte presentationId, DicomMessage message)
{
if (_importContext == null)
{
LoadImportContext(association);
}
return new StorageFilestreamHandler(Context, _importContext);
}
开发者ID:m-berkani,项目名称:ClearCanvas,代码行数:10,代码来源:StoreScpExtension.cs
示例6: AddPresentationContexts
private static void AddPresentationContexts(ServerAssociationParameters assoc)
{
byte pcid = assoc.AddPresentationContext(SopClass.VerificationSopClass);
assoc.AddTransferSyntax(pcid, TransferSyntax.ExplicitVrLittleEndian);
assoc.AddTransferSyntax(pcid, TransferSyntax.ImplicitVrLittleEndian);
pcid = assoc.AddPresentationContext(SopClass.ModalityPerformedProcedureStepSopClass);
assoc.AddTransferSyntax(pcid, TransferSyntax.ExplicitVrLittleEndian);
assoc.AddTransferSyntax(pcid, TransferSyntax.ImplicitVrLittleEndian);
}
开发者ID:khaha2210,项目名称:radio,代码行数:11,代码来源:MPPSScp.cs
示例7: StorageFilestreamHandler
public StorageFilestreamHandler(DicomScpContext context, Device remoteDevice, ServerAssociationParameters assoc)
{
_context = context;
_remoteDevice = remoteDevice;
_importContext = new SopInstanceImporterContext(
String.Format("{0}_{1}", assoc.CallingAE, assoc.TimeStamp.ToString("yyyyMMddhhmmss")),
assoc.CallingAE, assoc.CalledAE);
if (_remoteDevice != null && _remoteDevice.DeviceTypeEnum.Equals(DeviceTypeEnum.PrimaryPacs))
{
_importContext.DuplicateProcessing = DuplicateProcessingEnum.OverwriteSopAndUpdateDatabase;
}
}
开发者ID:jfphilbin,项目名称:ClearCanvas,代码行数:13,代码来源:StorageFilestreamHandler.cs
示例8: SetImageTransferSyntaxes
private static void SetImageTransferSyntaxes(byte pcid, ServerAssociationParameters assoc)
{
if (JpegLossless)
assoc.AddTransferSyntax(pcid,TransferSyntax.JpegLosslessNonHierarchicalFirstOrderPredictionProcess14SelectionValue1);
if (Rle)
assoc.AddTransferSyntax(pcid, TransferSyntax.RleLossless);
if (J2KLossy)
assoc.AddTransferSyntax(pcid, TransferSyntax.Jpeg2000ImageCompression);
if (J2KLossless)
assoc.AddTransferSyntax(pcid, TransferSyntax.Jpeg2000ImageCompressionLosslessOnly);
if (JpegLossy)
{
assoc.AddTransferSyntax(pcid, TransferSyntax.JpegBaselineProcess1);
assoc.AddTransferSyntax(pcid, TransferSyntax.JpegExtendedProcess24);
}
assoc.AddTransferSyntax(pcid, TransferSyntax.ExplicitVrLittleEndian);
assoc.AddTransferSyntax(pcid, TransferSyntax.ImplicitVrLittleEndian);
}
开发者ID:m-berkani,项目名称:ClearCanvas,代码行数:18,代码来源:StorageScp.cs
示例9: Listen
public static bool Listen(ServerAssociationParameters parameters, StartAssociation acceptor)
{
lock (_syncLock)
{
Listener theListener;
if (_listeners.TryGetValue(parameters.LocalEndPoint, out theListener))
{
ListenerInfo info = new ListenerInfo();
info.StartDelegate = acceptor;
info.Parameters = parameters;
if (theListener._applications.ContainsKey(parameters.CalledAE))
{
Platform.Log(LogLevel.Error, "Already listening with AE {0} on {1}", parameters.CalledAE,
parameters.LocalEndPoint.ToString());
return false;
}
theListener._applications.Add(parameters.CalledAE, info);
Platform.Log(LogLevel.Info, "Starting to listen with AE {0} on existing port {1}", parameters.CalledAE,
parameters.LocalEndPoint.ToString());
}
else
{
theListener = new Listener(parameters, acceptor);
if (!theListener.StartListening())
{
Platform.Log(LogLevel.Error, "Unexpected error starting to listen on {0}", parameters.LocalEndPoint.ToString());
return false;
}
_listeners[parameters.LocalEndPoint] = theListener;
theListener.StartThread();
Platform.Log(LogLevel.Info, "Starting to listen with AE {0} on port {1}", parameters.CalledAE,
parameters.LocalEndPoint.ToString());
}
return true;
}
}
开发者ID:m-berkani,项目名称:ClearCanvas,代码行数:43,代码来源:Listener.cs
示例10: StartListening
public static void StartListening(string aeTitle, int port)
{
if (_started)
return;
_staticAssocParameters = new ServerAssociationParameters(aeTitle, new IPEndPoint(IPAddress.Any, port));
Platform.Log(LogLevel.Info, "MPPS Server Started");
AddPresentationContexts(_staticAssocParameters);
DicomServer.StartListening(_staticAssocParameters,
delegate(DicomServer server, ServerAssociationParameters assoc)
{
return new MPPSScp(assoc);
});
_started = true;
}
开发者ID:khaha2210,项目名称:radio,代码行数:19,代码来源:MPPSScp.cs
示例11: ScuAbortTest
public void ScuAbortTest()
{
int port = 2112;
/* Setup the Server */
ServerAssociationParameters serverParameters = new ServerAssociationParameters("AssocTestServer", new IPEndPoint(IPAddress.Any, port));
byte pcid = serverParameters.AddPresentationContext(SopClass.MrImageStorage);
serverParameters.AddTransferSyntax(pcid, TransferSyntax.ExplicitVrLittleEndian);
serverParameters.AddTransferSyntax(pcid, TransferSyntax.ExplicitVrBigEndian);
serverParameters.AddTransferSyntax(pcid, TransferSyntax.ImplicitVrLittleEndian);
_serverType = TestTypes.Receive;
DicomServer.StartListening(serverParameters, ServerHandlerCreator);
StorageScu scu = SetupScu();
IList<DicomAttributeCollection> list = SetupMRSeries(4, 2, DicomUid.GenerateUid().UID);
foreach (DicomAttributeCollection collection in list)
{
DicomFile file = new DicomFile("test",new DicomAttributeCollection(),collection );
file.TransferSyntax = TransferSyntax.ExplicitVrLittleEndian;
file.MediaStorageSopClassUid = SopClass.MrImageStorage.Uid;
file.MediaStorageSopInstanceUid = collection[DicomTags.SopInstanceUid].ToString();
scu.AddStorageInstance(new StorageInstance(file));
}
scu.ImageStoreCompleted += delegate(object o, StorageInstance instance)
{
// Test abort
scu.Abort();
};
scu.Send();
scu.Join();
Assert.AreEqual(scu.Status, ScuOperationStatus.NetworkError);
// StopListening
DicomServer.StopListening(serverParameters);
}
开发者ID:khaha2210,项目名称:radio,代码行数:42,代码来源:ScuTests.cs
示例12: Verify
/// <summary>
/// Do the actual verification if an association is acceptable.
/// </summary>
/// <remarks>
/// This method primarily checks the remote AE title to see if it is a valid device that can
/// connect to the partition.
/// </remarks>
/// <param name="context">Generic parameter passed in, is a DicomScpParameters instance.</param>
/// <param name="assocParms">The association parameters.</param>
/// <param name="result">Output parameter with the DicomRejectResult for rejecting the association.</param>
/// <param name="reason">Output parameter with the DicomRejectReason for rejecting the association.</param>
/// <returns>true if the association should be accepted, false if it should be rejected.</returns>
public static bool Verify(DicomScpContext context, ServerAssociationParameters assocParms, out DicomRejectResult result, out DicomRejectReason reason)
{
bool isNew;
Device device = DeviceManager.LookupDevice(context.Partition, assocParms, out isNew);
if (device==null)
{
if (context.Partition.AcceptAnyDevice)
{
reason = DicomRejectReason.NoReasonGiven;
result = DicomRejectResult.Permanent;
return true;
}
reason = DicomRejectReason.CallingAENotRecognized;
result = DicomRejectResult.Permanent;
return false;
}
if (device.Enabled==false)
{
Platform.Log(LogLevel.Error,
"Rejecting association from {0} to {1}. Device is disabled.",
assocParms.CallingAE, assocParms.CalledAE);
reason = DicomRejectReason.CallingAENotRecognized;
result = DicomRejectResult.Permanent;
return false;
}
reason = DicomRejectReason.NoReasonGiven;
result = DicomRejectResult.Permanent;
return true;
}
开发者ID:UIKit0,项目名称:ClearCanvas,代码行数:50,代码来源:AssociationVerifier.cs
示例13: StartListening
public static void StartListening(string aeTitle, int port, int bufferedQueryResponses,int maxQueryResponses)
{
_bufferedQueryResponses = bufferedQueryResponses;
_maxQueryResponses = maxQueryResponses;
if (_started)
return;
_staticAssocParameters = new ServerAssociationParameters(aeTitle, new IPEndPoint(IPAddress.Any, port));
Platform.Log(LogLevel.Info, "MWL Server Started");
AddPresentationContexts(_staticAssocParameters);
DicomServer.StartListening(_staticAssocParameters,
delegate(DicomServer server, ServerAssociationParameters assoc)
{
return new MWLScp(assoc);
});
_started = true;
}
开发者ID:khaha2210,项目名称:radio,代码行数:23,代码来源:MWLScp.cs
示例14: Start
/// <summary>
/// Starts the service.
/// </summary>
/// <returns>True/False depending if service started successfully.</returns>
public bool Start()
{
try
{
if (isRunning)
return true;
_staticAssocParameters = new ServerAssociationParameters(_aet, new IPEndPoint(IPAddress.Any, _port));
AddPresentationContexts(_staticAssocParameters);
if (DicomServer.StartListening(_staticAssocParameters,
delegate (DicomServer server, ServerAssociationParameters assoc)
{
return new DicomSCP(assoc)
{
Aet = _aet,
Port = _port
};
}))
{
isRunning = true;
}
}
catch (Exception ex)
{
throw ex;
}
return isRunning;
}
开发者ID:radiopaedia,项目名称:uploader-agent,代码行数:41,代码来源:DicomSCP.cs
示例15: InstancesTransferredAuditLogger
public static void InstancesTransferredAuditLogger(DicomScpContext context, ServerAssociationParameters assocParams, List<StorageInstance> instances)
{
Dictionary<string, AuditPatientParticipantObject> list = new Dictionary<string, AuditPatientParticipantObject>();
foreach (StorageInstance instance in instances)
{
string key = instance.PatientId + instance.PatientsName;
if (!list.ContainsKey(key))
{
AuditPatientParticipantObject patient =
new AuditPatientParticipantObject(instance.PatientsName, instance.PatientId);
list.Add(key, patient);
}
}
foreach (AuditPatientParticipantObject patient in list.Values)
{
// Audit Log
DicomInstancesTransferredAuditHelper helper =
new DicomInstancesTransferredAuditHelper(ServerPlatform.AuditSource,
EventIdentificationContentsEventOutcomeIndicator.Success,
EventIdentificationContentsEventActionCode.E,
assocParams);
foreach (StorageInstance instance in instances)
{
if (patient.PatientId.Equals(instance.PatientId)
&& patient.PatientsName.Equals(instance.PatientsName))
{
helper.AddStorageInstance(instance);
}
}
ServerAuditHelper.LogAuditMessage(helper);
}
}
开发者ID:m-berkani,项目名称:ClearCanvas,代码行数:36,代码来源:AssociationAuditLogger.cs
示例16: ServerTest
public void ServerTest()
{
int port = 2112;
/* Setup the Server */
ServerAssociationParameters serverParameters = new ServerAssociationParameters("AssocTestServer",new IPEndPoint(IPAddress.Any,port));
byte pcid = serverParameters.AddPresentationContext(SopClass.MrImageStorage);
serverParameters.AddTransferSyntax(pcid, TransferSyntax.ExplicitVrLittleEndian);
serverParameters.AddTransferSyntax(pcid, TransferSyntax.ExplicitVrBigEndian);
serverParameters.AddTransferSyntax(pcid, TransferSyntax.ImplicitVrLittleEndian);
_serverType = TestTypes.SendMR;
DicomServer.StartListening(serverParameters, ServerHandlerCreator);
/* Setup the client */
ClientAssociationParameters clientParameters = new ClientAssociationParameters("AssocTestClient","AssocTestServer",
new System.Net.IPEndPoint(IPAddress.Loopback,port));
pcid = clientParameters.AddPresentationContext(SopClass.MrImageStorage);
clientParameters.AddTransferSyntax(pcid, TransferSyntax.ExplicitVrLittleEndian);
clientParameters.AddTransferSyntax(pcid, TransferSyntax.ImplicitVrLittleEndian);
pcid = clientParameters.AddPresentationContext(SopClass.CtImageStorage);
clientParameters.AddTransferSyntax(pcid, TransferSyntax.ExplicitVrLittleEndian);
clientParameters.AddTransferSyntax(pcid, TransferSyntax.ImplicitVrLittleEndian);
/* Open the association */
ClientHandler handler = new ClientHandler(this,TestTypes.SendMR);
DicomClient client = DicomClient.Connect(clientParameters, handler);
handler._threadStop.WaitOne();
client.Dispose();
DicomServer.StopListening(serverParameters);
}
开发者ID:tcchau,项目名称:ClearCanvas,代码行数:36,代码来源:AssociationTests.cs
示例17: LoadImportContext
protected void LoadImportContext(ServerAssociationParameters association)
{
_importContext = new DicomReceiveImportContext(association.CallingAE, GetRemoteHostName(association), StudyStore.GetConfiguration(), EventSource.CurrentProcess);
// Publish new WorkItems as they're added to the context
lock (_importContext.StudyWorkItemsSyncLock)
{
_importContext.StudyWorkItems.ItemAdded += (sender, args) =>
{
_importContext.PublishWorkItemActivity(WorkItemDataHelper.FromWorkItem(args.Item));
var auditedInstances = new AuditedInstances();
var request = args.Item.Request as DicomReceiveRequest;
if (request != null)
auditedInstances.AddInstance(request.Patient.PatientId, request.Patient.PatientsName, request.Study.StudyInstanceUid);
AuditHelper.LogReceivedInstances(
association.CallingAE, GetRemoteHostName(association),
auditedInstances, EventSource.CurrentProcess,
EventResult.Success, EventReceiptAction.ActionUnknown);
};
_importContext.StudyWorkItems.ItemChanged += (sender, args) =>
_importContext.PublishWorkItemActivity(WorkItemDataHelper.FromWorkItem(args.Item));
}
}
开发者ID:m-berkani,项目名称:ClearCanvas,代码行数:26,代码来源:StoreScpExtension.cs
示例18: ServerHandlerCreator
public IDicomServerHandler ServerHandlerCreator(DicomServer server, ServerAssociationParameters assoc)
{
return new ServerHandler(this, _serverType);
}
开发者ID:scottshea,项目名称:monodicom,代码行数:4,代码来源:ScuTests.cs
示例19: OnReceiveRequest
public override bool OnReceiveRequest(Dicom.Network.DicomServer server,
ServerAssociationParameters association, byte presentationID, DicomMessage message)
{
string studyInstanceUid;
string seriesInstanceUid;
DicomUid sopInstanceUid;
bool ok = message.DataSet[DicomTags.SopInstanceUid].TryGetUid(0, out sopInstanceUid);
if (ok) ok = message.DataSet[DicomTags.SeriesInstanceUid].TryGetString(0, out seriesInstanceUid);
if (ok) ok = message.DataSet[DicomTags.StudyInstanceUid].TryGetString(0, out studyInstanceUid);
if (!ok)
{
Platform.Log(LogLevel.Error, "Unable to retrieve UIDs from request message, sending failure status.");
server.SendCStoreResponse(presentationID, message.MessageId, sopInstanceUid.UID,
DicomStatuses.ProcessingFailure);
return true;
}
if (_importContext == null)
{
LoadImportContext(association);
}
var importer = new ImportFilesUtility(_importContext);
var result = importer.Import(message, BadFileBehaviourEnum.Ignore, FileImportBehaviourEnum.Save);
if (result.Successful)
{
if (!String.IsNullOrEmpty(result.AccessionNumber))
Platform.Log(LogLevel.Info, "Received SOP Instance {0} from {1} to {2} (A#:{3} StudyUid:{4})",
result.SopInstanceUid, association.CallingAE, association.CalledAE, result.AccessionNumber,
result.StudyInstanceUid);
else
Platform.Log(LogLevel.Info, "Received SOP Instance {0} from {1} to {2} (StudyUid:{3})",
result.SopInstanceUid, association.CallingAE, association.CalledAE,
result.StudyInstanceUid);
server.SendCStoreResponse(presentationID, message.MessageId, message.AffectedSopInstanceUid, result.DicomStatus);
}
else
{
if (result.DicomStatus == DicomStatuses.ProcessingFailure)
Platform.Log(LogLevel.Error, "Failure importing sop: {0}", result.ErrorMessage);
//OnReceiveError(message, result.ErrorMessage, association.CallingAE);
server.SendCStoreResponse(presentationID, message.MessageId, message.AffectedSopInstanceUid,
result.DicomStatus, result.ErrorMessage);
}
return true;
}
开发者ID:m-berkani,项目名称:ClearCanvas,代码行数:53,代码来源:StoreScpExtension.cs
示例20: Listener
internal Listener(ServerAssociationParameters parameters, StartAssociation acceptor)
{
ListenerInfo info = new ListenerInfo();
info.Parameters = parameters;
info.StartDelegate = acceptor;
_applications.Add(parameters.CalledAE, info);
_ipEndPoint = parameters.LocalEndPoint;
}
开发者ID:m-berkani,项目名称:ClearCanvas,代码行数:11,代码来源:Listener.cs
注:本文中的ClearCanvas.Dicom.Network.ServerAssociationParameters类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论