• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Dicom.DicomMessageBase类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: CheckDataLength

        /// <summary>
        /// Checks the data in the message and generates warning logs/alerts if
        /// any of them exceeeds the max size allowed in the database
        /// </summary>
        /// <param name="file"></param>
        private void CheckDataLength(DicomMessageBase file)
        {
            //TODO: Maybe this should be part of the model?

            String studyInstanceUid = file.DataSet[DicomTags.StudyInstanceUid].GetString(0, String.Empty);
            
            String patientId = file.DataSet[DicomTags.PatientId].GetString(0, String.Empty);
            String issuerOfPatientId = file.DataSet[DicomTags.IssuerOfPatientId].GetString(0, String.Empty);
            String patientsName = file.DataSet[DicomTags.PatientsName].GetString(0, String.Empty);
            String patientsBirthDate = file.DataSet[DicomTags.PatientsBirthDate].GetString(0, String.Empty);
            String patientsSex = file.DataSet[DicomTags.PatientsSex].GetString(0, String.Empty);
            String accessionNumber = file.DataSet[DicomTags.AccessionNumber].GetString(0, String.Empty);

            bool alert = false;
            if (!string.IsNullOrEmpty(patientId) && patientId.Length>64)
            {
                alert = true;
                Platform.Log(LogLevel.Warn, "Patient ID ({0}) in the dicom message exceeeds 64 characters", patientId);
            }

            if (!string.IsNullOrEmpty(issuerOfPatientId) && issuerOfPatientId.Length > 64)
            {
                alert = true; 
                Platform.Log(LogLevel.Warn, "Issuer Of Patient ID ({0}) in the dicom message exceeeds 64 characters", issuerOfPatientId);
            }
            if (!string.IsNullOrEmpty(patientsName) && patientsName.Length > 64)
            {
                alert = true; 
                Platform.Log(LogLevel.Warn, "Patient's Name ({0}) in the dicom message exceeeds 64 characters", patientsName);
            }
            if (!string.IsNullOrEmpty(patientsBirthDate) && patientsBirthDate.Length > 8)
            {
                alert = true;
                Platform.Log(LogLevel.Warn, "Patient's Birth Date ({0}) in the dicom message exceeeds 8 characters", patientsBirthDate);
            }
            if (!string.IsNullOrEmpty(patientsSex) && patientsSex.Length > 2)
            {
                alert = true; 
                Platform.Log(LogLevel.Warn, "Patient's Sex ({0}) in the dicom message exceeeds 2 characters", patientsSex);
            }
            if (!string.IsNullOrEmpty(accessionNumber) && accessionNumber.Length > 16)
            {
                alert = true; 
                Platform.Log(LogLevel.Warn, "Accession Number ({0}) in the dicom message exceeeds 16 characters", accessionNumber);
            }

            if (alert)
            {
                StudyAlertGenerator.Generate(
                    new StudyAlert("Study Process", _context.Partition.AeTitle, studyInstanceUid, StudyAlertType.BadDicomData, 
                        String.Format("Study {0} contains some bad data which may have been truncated. It may not appear when queried by remote devices.", 
                        studyInstanceUid)));
            }
        }
开发者ID:yjsyyyjszf,项目名称:ClearCanvas-1,代码行数:59,代码来源:SopInstanceProcessor.cs


示例17: ShouldReconcile

		/// <summary>
		/// Returns a value indicating whether the Dicom image must be reconciled.
		/// </summary>
		/// <param name="storageLocation"></param>
		/// <param name="message">The Dicom message</param>
		/// <returns></returns>
		private bool ShouldReconcile(StudyStorageLocation storageLocation, DicomMessageBase message)
		{
			Platform.CheckForNullReference(_context, "_context");
			Platform.CheckForNullReference(message, "message");

			if (_context.Study == null)
			{
				// the study doesn't exist in the database
				return false;
			}

		    StudyComparer comparer = new StudyComparer();
            DifferenceCollection list = comparer.Compare(message, storageLocation.Study, storageLocation.ServerPartition.GetComparisonOptions());

		    if (list != null && list.Count > 0)
		    {
		        LogDifferences(message, list);
		        return true;
		    }
		    return false;
		}
开发者ID:yjsyyyjszf,项目名称:ClearCanvas-1,代码行数:27,代码来源:SopInstanceProcessor.cs


示例18: ConvertToDicomFile

        static private DicomFile ConvertToDicomFile(DicomMessageBase message, string filename, string sourceAe)
        {
            // This routine sets some of the group 0x0002 elements.
            DicomFile file;
            if (message is DicomFile)
            {
                file = message as DicomFile;
            }
            else if (message is DicomMessage)
            {
                file = new DicomFile(message as DicomMessage, filename);
            }
            else
            {
                throw new NotSupportedException(String.Format("Cannot convert {0} to DicomFile", message.GetType()));
            }

            file.SourceApplicationEntityTitle = sourceAe;
            file.TransferSyntax = message.TransferSyntax;

            return file;
        }
开发者ID:yjsyyyjszf,项目名称:ClearCanvas-1,代码行数:22,代码来源:SopInstanceImporter.cs


示例19: GetQueueEntryDescription

        private static ReconcileStudyQueueDescription GetQueueEntryDescription(StudyStorageLocation existingStorage, DicomMessageBase file)
        {
            ReconcileStudyQueueDescription desc = new ReconcileStudyQueueDescription
                                                  	{
                                                  		ExistingPatientId = existingStorage.Study.PatientId,
                                                  		ExistingPatientName = existingStorage.Study.PatientsName,
                                                  		ExistingAccessionNumber = existingStorage.Study.AccessionNumber,
                                                  		ConflictingPatientName =
                                                  			file.DataSet[DicomTags.PatientsName].GetString(0, String.Empty),
                                                  		ConflictingPatientId =
                                                  			file.DataSet[DicomTags.PatientId].GetString(0, String.Empty),
                                                  		ConflictingAccessionNumber =
                                                  			file.DataSet[DicomTags.AccessionNumber].GetString(0, String.Empty)
                                                  	};

        	return desc;
        }
开发者ID:UIKit0,项目名称:ClearCanvas,代码行数:17,代码来源:ImageReconciler.cs


示例20: GetExistingOrCreateNewSeries

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Dicom.DicomTag类代码示例发布时间:2022-05-24
下一篇:
C# Dicom.DicomMessage类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap