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


C# DcmDataset.GetSQ方法代码示例

本文整理汇总了C#中Dicom.Data.DcmDataset.GetSQ方法的典型用法代码示例。如果您正苦于以下问题:C# DcmDataset.GetSQ方法的具体用法?C# DcmDataset.GetSQ怎么用?C# DcmDataset.GetSQ使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Dicom.Data.DcmDataset的用法示例。


在下文中一共展示了DcmDataset.GetSQ方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnReceiveNCreateResponse

        protected override void OnReceiveNCreateResponse(byte presentationID, ushort messageIdRespondedTo, DicomUID affectedClass, DicomUID affectedInstance,
            DcmDataset dataset, DcmStatus status)
        {
            if (_filmSession != null)
            {
                if (affectedClass == DicomUID.BasicFilmSessionSOPClass)
                {
                    if (status == DcmStatus.Success)
                    {
                        int filmBoxesCount = CalculateRequiredImageBoxes();
                        if (filmBoxesCount == 0)
                        {
                            SendReleaseRequest();
                            return;
                        }

                        for (int i = 0; i < filmBoxesCount; i++)
                        {
                            DicomUID uid = DicomUID.Generate();
                            DcmDataset filmBoxDataset = new DcmDataset(DicomTransferSyntax.ImplicitVRLittleEndian);
                            DcmFilmBox filmBox = _filmSession.CreateFilmBox(uid, filmBoxDataset.Clone());

                            filmBox.AnnotationDisplayFormatID = _annotationDisplayFormatID;
                            filmBox.BorderDensity = _borderDensity;
                            filmBox.ConfigurationInformation = _configurationInformation;
                            filmBox.EmptyImageDensity = _emptyImageDensity;
                            filmBox.FilmOrientation = _filmOrientation;
                            filmBox.FilmSizeID = _filmSizeID;
                            filmBox.Illumination = _illumination;
                            filmBox.ImageDisplayFormat = _imageDisplayFormat;
                            filmBox.MagnificationType = _magnificationType;
                            filmBox.MaxDensity = _maxDensity;
                            filmBox.MinDensity = _minDensity;
                            filmBox.ReflectedAmbientLight = _reflectedAmbientLight;
                            filmBox.RequestedResolutionID = _requestedResolutionID;
                            filmBox.SmoothingType = _smoothingType;
                            filmBox.Trim = _trim;

                            byte pcid = Associate.FindAbstractSyntax(DicomUID.BasicGrayscalePrintManagementMetaSOPClass);
                            SendNCreateRequest(pcid, NextMessageID(), DicomUID.BasicFilmBoxSOPClass, filmBox.SOPInstanceUID, filmBox.Dataset);
                        }
                        return;
                    }
                }

                if (affectedClass == DicomUID.BasicFilmBoxSOPClass)
                {
                    if (status == DcmStatus.Success)
                    {
                        DcmFilmBox filmBox = _filmSession.FindFilmBox(affectedInstance);
                        int filmBoxIndex = _filmSession.BasicFilmBoxes.IndexOf(filmBox);
                        if (filmBox != null)
                        {
                            DcmItemSequence referencedImageBoxSequenceList = null;
                            referencedImageBoxSequenceList = dataset.GetSQ(DicomTags.ReferencedImageBoxSequence);
                            if (referencedImageBoxSequenceList != null)
                            {
                                foreach (DcmItemSequenceItem item in referencedImageBoxSequenceList.SequenceItems)
                                {
                                    DicomUID referencedSOPInstanceUID = item.Dataset.GetUID(DicomTags.ReferencedSOPInstanceUID);
                                    if (referencedSOPInstanceUID != null)
                                    {
                                        DcmImageBox imageBox = new DcmImageBox(filmBox, DcmImageBox.GraySOPClassUID, referencedSOPInstanceUID);
                                        filmBox.BasicImageBoxes.Add(imageBox);
                                    }
                                }
                            }

                            _pendingImageBoxResponses.Clear();
                            if (filmBox.BasicImageBoxes.Count > 0)
                            {
                                int imageBoxIndex = 0;
                                int imagesPerFilmbox = CalculateImagesPreFilmBox();
                                foreach (DcmImageBox imageBox in filmBox.BasicImageBoxes)
                                {
                                    if (imagesPerFilmbox * filmBoxIndex + imageBoxIndex < _files.Count)
                                    {
                                        UpdateImageBox(imageBox, _files[imagesPerFilmbox * filmBoxIndex + imageBoxIndex], imageBoxIndex);
                                    }
                                    _pendingImageBoxResponses.Add(imageBox);
                                    imageBoxIndex++;

                                    byte pcid = Associate.FindAbstractSyntax(DicomUID.PrinterSOPClass);
                                    SendNSetRequest(pcid, NextMessageID(), imageBox.SOPClassUID, imageBox.SOPInstanceUID, imageBox.Dataset);
                                }
                            }
                            return;
                        }
                    }
                }
            }

            SendAbort(DcmAbortSource.ServiceUser, DcmAbortReason.NotSpecified);
        }
开发者ID:hide1980,项目名称:mdcm,代码行数:94,代码来源:PrintClient.cs


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