当前位置: 首页>>代码示例>>C#>>正文


C# Dicom.DicomMessageBase类代码示例

本文整理汇总了C#中ClearCanvas.Dicom.DicomMessageBase的典型用法代码示例。如果您正苦于以下问题:C# DicomMessageBase类的具体用法?C# DicomMessageBase怎么用?C# DicomMessageBase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DicomMessageBase类属于ClearCanvas.Dicom命名空间,在下文中一共展示了DicomMessageBase类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: InsertStudyDelete

        private IWorkItemProcessor InsertStudyDelete(DicomMessageBase msg, WorkItemPriorityEnum priority, WorkItemStatusEnum status)
        {
            var rq = new WorkItemInsertRequest
                         {
                             Request = new DeleteStudyRequest
                                           {
                                               Patient = new WorkItemPatient(msg.DataSet),
                                               Study = new WorkItemStudy(msg.DataSet),
                                               Priority = priority
                                           }
                         };
            var rsp = WorkItemService.Instance.Insert(rq);

            var updateRequest = new WorkItemUpdateRequest
            {
                Status = status,
                Identifier = rsp.Item.Identifier
            };

            WorkItemService.Instance.Update(updateRequest);

            using (var context = new DataAccessContext(DataAccessContext.WorkItemMutex))
            {
                var broker = context.GetWorkItemBroker();

                var d = new DeleteStudyItemProcessor();
                d.Initialize(new WorkItemStatusProxy(broker.GetWorkItem(rsp.Item.Identifier)));
                return d;
            }
        }
开发者ID:nhannd,项目名称:Xian,代码行数:30,代码来源:WorkItemSchedulingTest.cs

示例2: LoadRequestAttributes

        /// <summary>
        /// Load the values for the sequence <see cref="DicomTags.RequestAttributesSequence"/>
        /// into a response message for a specific series.
        /// </summary>
        /// <param name="read">The connection to use to read the values.</param>
        /// <param name="response">The message to add the values into.</param>
        /// <param name="row">The <see cref="Series"/> entity to load the related <see cref="RequestAttributes"/> entity for.</param>
        private static void LoadRequestAttributes(IPersistenceContext read, DicomMessageBase response, Series row)
        {
            var select = read.GetBroker<IRequestAttributesEntityBroker>();

            var criteria = new RequestAttributesSelectCriteria();

            criteria.SeriesKey.EqualTo(row.GetKey());

            IList<RequestAttributes> list = select.Find(criteria);

            if (list.Count == 0)
            {
                response.DataSet[DicomTags.RequestAttributesSequence].SetNullValue();
                return;
            }

            foreach (RequestAttributes request in list)
            {
                var item = new DicomSequenceItem();
                item[DicomTags.ScheduledProcedureStepId].SetStringValue(request.ScheduledProcedureStepId);
                item[DicomTags.RequestedProcedureId].SetStringValue(request.RequestedProcedureId);

                response.DataSet[DicomTags.RequestAttributesSequence].AddSequenceItem(item);
            }
        }
开发者ID:nhannd,项目名称:Xian,代码行数:32,代码来源:SeriesServerQuery.cs

示例3: Validate

        /// <summary>
        /// Validates the contents in the <see cref="DicomMessageBase"/> object.
        /// </summary>
        /// <param name="message"></param>
        /// <exception cref="DicomDataException"/> is thrown if the DICOM object fails the validation.
        public void Validate(DicomMessageBase message)
        {
            String studyInstanceUid = message.DataSet[DicomTags.StudyInstanceUid].GetString(0, string.Empty);
            String seriesInstanceUid = message.DataSet[DicomTags.SeriesInstanceUid].GetString(0, string.Empty);
            String sopInstanceUid = message.DataSet[DicomTags.SopInstanceUid].GetString(0, string.Empty);

            if (String.IsNullOrEmpty(studyInstanceUid))
            {
                throw new DicomDataException("Study Instance UID is missing or empty");
            }

            if (studyInstanceUid.Length > 64 || seriesInstanceUid.Length > 64 || sopInstanceUid.Length > 64)
            {
            	if (studyInstanceUid.Length > 64)
                    throw new DicomDataException(string.Format("Study Instance UID is > 64 bytes in the SOP Instance : {0}", studyInstanceUid));

            	if (seriesInstanceUid.Length > 64)
            		throw new DicomDataException(string.Format("Series Instance UID is > 64 bytes in the SOP Instance : {0}", seriesInstanceUid));

            	throw new DicomDataException(string.Format("SOP Instance UID is > 64 bytes in the SOP Instance : {0}", sopInstanceUid));
            }

			if (studyInstanceUid.EndsWith("."))
				throw new DicomDataException(string.Format("Study Instance UID ends with period : {0}", studyInstanceUid));

			if (seriesInstanceUid.EndsWith("."))
				throw new DicomDataException(string.Format("Series Instance UID ends with period : {0}", seriesInstanceUid));

			if (sopInstanceUid.EndsWith("."))
				throw new DicomDataException(string.Format("SOP Instance UID ends with period : {0}", sopInstanceUid));
		}
开发者ID:nhannd,项目名称:Xian,代码行数:36,代码来源:DicomSopInstanceValidator.cs

示例4: ServerActionContext

 public ServerActionContext(DicomMessageBase msg, ServerEntityKey filesystemKey,
                            ServerPartition partition, ServerEntityKey studyLocationKey)
 {
     Message = msg;
     ServerPartitionKey = partition.Key;
     StudyLocationKey = studyLocationKey;
     FilesystemKey = filesystemKey;
 	ServerPartition = partition;
 }
开发者ID:nhannd,项目名称:Xian,代码行数:9,代码来源:ServerActionContext.cs

示例5: DicomCompressedPixelData

		public DicomCompressedPixelData(DicomMessageBase msg, byte[] frameData) : base(msg)
		{
			_sq = new DicomFragmentSequence(DicomTags.PixelData);
			AddFrameFragment(frameData);
			//ByteBuffer buffer = new ByteBuffer(frameData);
			//DicomFragment fragment = new DicomFragment(buffer);
			//_sq.AddFragment(fragment);
			NumberOfFrames = 1;
		}
开发者ID:m-berkani,项目名称:ClearCanvas,代码行数:9,代码来源:DicomCompressedPixelData.cs

示例6: UpdateWorkQueueCommand

 public UpdateWorkQueueCommand(DicomMessageBase message, StudyStorageLocation location, bool duplicate, string extension, string uidGroupId)
     : base("Update/Insert a WorkQueue Entry")
 {
     Platform.CheckForNullReference(message, "Dicom Message object");
     Platform.CheckForNullReference(location, "Study Storage Location");
     
     _message = message;
     _storageLocation = location;
     _duplicate = duplicate;
     _extension = extension;
     _uidGroupId = uidGroupId;
 }
开发者ID:nhannd,项目名称:Xian,代码行数:12,代码来源:UpdateWorkQueueCommand.cs

示例7: UpdateWorkQueueCommand

        public UpdateWorkQueueCommand(DicomMessageBase message, StudyStorageLocation location, bool duplicate, WorkQueueData data=null, WorkQueueUidData uidData=null, ExternalRequestQueue request=null, WorkQueuePriorityEnum priority=null)
            : base("Update/Insert a WorkQueue Entry")
        {
            Platform.CheckForNullReference(message, "Dicom Message object");
            Platform.CheckForNullReference(location, "Study Storage Location");
            
            _message = message;
            _storageLocation = location;
            _duplicate = duplicate;
            _data = data;
            _request = request;
            _uidData = uidData;
	        _priority = priority;
        }
开发者ID:m-berkani,项目名称:ClearCanvas,代码行数:14,代码来源:UpdateWorkQueueCommand.cs

示例8: LoadModalitiesInStudy

        /// <summary>
        /// Load the values for the tag <see cref="DicomTags.ModalitiesInStudy"/> into a response
        /// message for a specific <see cref="Study"/>.
        /// </summary>
        /// <param name="read">The connection to use to read the values.</param>
        /// <param name="response">The message to add the value into.</param>
        /// <param name="key">The <see cref="ServerEntityKey"/> for the <see cref="Study"/>.</param>
        private static void LoadModalitiesInStudy(IPersistenceContext read, DicomMessageBase response, ServerEntityKey key)
        {
            var select = read.GetBroker<IQueryModalitiesInStudy>();

            var parms = new ModalitiesInStudyQueryParameters { StudyKey = key };

            IList<Series> list = select.Find(parms);

            string value = "";
            foreach (Series series in list)
            {
                value = value.Length == 0
                    ? series.Modality
                    : String.Format("{0}\\{1}", value, series.Modality);
            }
            response.DataSet[DicomTags.ModalitiesInStudy].SetStringValue(value);
        }
开发者ID:nhannd,项目名称:Xian,代码行数:24,代码来源:StudyServerQuery.cs

示例9: GetSopListForPatient

        /// <summary>
        /// Create a list of SOP Instances to move based on a Patient level C-MOVE-RQ.
        /// </summary>
        /// <param name="read"></param>
        /// <param name="msg"></param>
        /// <param name="errorComment"> </param>
        /// <returns></returns>
        private bool GetSopListForPatient(IPersistenceContext read, DicomMessageBase msg, out string errorComment)
        {
            errorComment = string.Empty;
            string patientId = msg.DataSet[DicomTags.PatientId].GetString(0, "");

            var select = read.GetBroker<IStudyEntityBroker>();

            var criteria = new StudySelectCriteria();
            criteria.PatientId.EqualTo(patientId);
			criteria.ServerPartitionKey.EqualTo(Partition.Key);

            IList<Study> studyList = select.Find(criteria);

        	bool bOfflineFound = false;
            foreach (Study study in studyList)
            {
                StudyStorageLocation location;

				try
				{
					FilesystemMonitor.Instance.GetReadableStudyStorageLocation(Partition.Key, study.StudyInstanceUid,
					                                                           StudyRestore.True, StudyCache.True, out location);
				}
                catch (StudyIsNearlineException e)
                {
                    errorComment = string.Format(e.RestoreRequested ? "Study is nearline, inserted restore request: {0}" : "Study is nearline: {0}", study.StudyInstanceUid);

                    bOfflineFound = true;
                    continue;				        
                }
				catch (Exception e)
				{
				    errorComment = string.Format("Exception occurred when determining study location: {0}", e.Message);
					bOfflineFound = true;
					continue;
				}

            	StudyXml theStream = LoadStudyXml(location);

                _theScu.LoadStudyFromStudyXml(location.GetStudyPath(), theStream);
            }

            return !bOfflineFound;
        }
开发者ID:nhannd,项目名称:Xian,代码行数:51,代码来源:MoveScpExtension.cs

示例10: ProcessStoredDuplicateFile

		/// <summary>
		/// Process the duplicate with the supplied <see cref="DuplicateProcessingEnum"/>
		/// </summary>
		/// <param name="context">The processing context</param>
		/// <param name="message">A subset of the message stored in <paramref name="sourceFilename"/></param>
		/// <param name="sourceFilename">The location of the filename that is a duplicate</param>
		/// <param name="data">The data</param>
		/// <param name="duplicate">How the processor should handle the duplicate</param>
		public static void ProcessStoredDuplicateFile(SopInstanceProcessorContext context,
													  string sourceFilename,
													  DicomMessageBase message,
													  StudyProcessWorkQueueData data,
													  DuplicateProcessingEnum duplicate)
		{
			SaveDuplicateFile(context, message.DataSet[DicomTags.SopInstanceUid].ToString(), sourceFilename);
			var uidData = new WorkQueueUidData
			{
				Extension = ServerPlatform.DuplicateFileExtension,
				GroupId = context.Group,
				DuplicateProcessing = duplicate
			};

			if (context.Request != null)
				uidData.OperationToken = context.Request.OperationToken;

			context.CommandProcessor.AddCommand(
				new UpdateWorkQueueCommand(message, context.StudyLocation, true, data, uidData, context.Request));
		}
开发者ID:yjsyyyjszf,项目名称:ClearCanvas-1,代码行数:28,代码来源:DuplicateSopProcessorHelper.cs

示例11: GetExistingOrCreateNewStudy

 /// <summary>
 /// Traverse at the Study level to check if a Study exists or create a Study if it doesn't exist.
 /// </summary>
 /// <param name="studies"></param>
 /// <param name="file"></param>
 /// <returns></returns>
 private static DirectoryRecordSequenceItem GetExistingOrCreateNewStudy(DirectoryRecordSequenceItem studies, DicomMessageBase file)
 {
     DirectoryRecordSequenceItem currentStudy = studies;
     while (currentStudy != null)
     {
         if (currentStudy[DicomTags.StudyInstanceUid].Equals(file.DataSet[DicomTags.StudyInstanceUid]))
         {
             return currentStudy;
         }
         if (currentStudy.NextDirectoryRecord == null)
         {
             currentStudy.NextDirectoryRecord = CreateStudyItem(file);
             return currentStudy.NextDirectoryRecord;
         }
         currentStudy = currentStudy.NextDirectoryRecord;
     }
     return null;
 }
开发者ID:emmandeb,项目名称:ClearCanvas-1,代码行数:24,代码来源:DicomDirectory.cs

示例12: DicomUncompressedPixelData

		/// <summary>
		/// Initializes a <see cref="DicomUncompressedPixelData"/> from the attributes in a DICOM file/message.
		/// </summary>
		/// <param name="dicomMessage">A DICOM file/message from which to initialize the properties of the <see cref="DicomUncompressedPixelData"/>.</param>
		public DicomUncompressedPixelData(DicomMessageBase dicomMessage)
			: base(dicomMessage)
		{
			_pd = dicomMessage.DataSet[DicomTags.PixelData];
			InitializeFrameData(this, _pd);
		}
开发者ID:jfphilbin,项目名称:ClearCanvas,代码行数:10,代码来源:DicomUncompressedPixelData.cs

示例13: GetExistingOrCreateNewPatient

 /// <summary>
 /// Traverse at the Patient level to check if a Patient exists or create a Patient if it doesn't exist.
 /// </summary>
 /// <param name="patients"></param>
 /// <param name="file"></param>
 /// <returns></returns>
 private static DirectoryRecordSequenceItem GetExistingOrCreateNewPatient(DirectoryRecordSequenceItem patients, DicomMessageBase file)
 {
     DirectoryRecordSequenceItem currentPatient = patients;
     while (currentPatient != null)
     {
         if (currentPatient[DicomTags.PatientId].Equals(file.DataSet[DicomTags.PatientId])
             && currentPatient[DicomTags.PatientsName].Equals(file.DataSet[DicomTags.PatientsName]))
         {
             return currentPatient;
         }
         if (currentPatient.NextDirectoryRecord == null)
         {
             currentPatient.NextDirectoryRecord = CreatePatientItem(file);
             return currentPatient.NextDirectoryRecord;
         }
         currentPatient = currentPatient.NextDirectoryRecord;
     }
     return null;
 }
开发者ID:emmandeb,项目名称:ClearCanvas-1,代码行数:25,代码来源:DicomDirectory.cs

示例14: LogDifferences

		private static void LogDifferences(DicomMessageBase message, DifferenceCollection list)
		{
			string sopInstanceUid = message.DataSet[DicomTags.SopInstanceUid].GetString(0, String.Empty);
			StringBuilder sb = new StringBuilder();
			sb.AppendFormat("Found {0} issue(s) in SOP {1}\n", list.Count, sopInstanceUid);
			sb.Append(list.ToString());
			Platform.Log(LogLevel.Warn, sb.ToString());
		}
开发者ID:yjsyyyjszf,项目名称:ClearCanvas-1,代码行数:8,代码来源:SopInstanceProcessor.cs

示例15: UpdateMessage

		/// <summary>
		/// Update a <see cref="DicomMessageBase"/> with the pixel data contained
		/// within this object and also update pixel data related tags.
		/// </summary>
		/// <param name="message"></param>
		public override void UpdateMessage(DicomMessageBase message)
		{
			UpdateAttributeCollection(message.DataSet);
			DicomFile file = message as DicomFile;
			if (file != null)
				file.TransferSyntax = TransferSyntax;
		}
开发者ID:jfphilbin,项目名称:ClearCanvas,代码行数:12,代码来源:DicomUncompressedPixelData.cs


注:本文中的ClearCanvas.Dicom.DicomMessageBase类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。