public void Show()
        {
            // check if a layout component is already displayed
            if (_shelves.ContainsKey(Context.DesktopWindow))
            {
                _shelves[Context.DesktopWindow].Activate();
            }
            else
            {
                BlockingOperation.Run(delegate
                {
                    _desktopWindow = Context.DesktopWindow;

                    var component =
                        new SegmentationComponent(Context.DesktopWindow);

                    IShelf shelf = ApplicationComponent.LaunchAsShelf(
                        _desktopWindow,
                        component,
                        SR.SegmentationTitle,
                        "DICOM Segmentation",
                        ShelfDisplayHint.DockRight | ShelfDisplayHint.DockAutoHide);

                    shelf.Closed            += OnShelfClosed;
                    _shelves[_desktopWindow] = shelf;
                });
            }
        }
            private void Apply()
            {
                _ownerTool.Show();
                SegmentationComponent component = _ownerTool.GetActiveComponent();

                if (component != null)
                {
                    bool isLoaded = _ownerTool.EnsureSeriesIsLoaded(_info.DisplayImageSeriesUid,
                                                                    _info.ImagePositionPatient,
                                                                    _info.ImageOrientationPatient,
                                                                    _info.FrameOfReferenceUid);
                    if (isLoaded)
                    {
                        Seg seg = component.SegFromDocumentUidAndSegNumber(_info.SegmentationDocumentUid,
                                                                           _info.SegmentationNumber);
                        if (seg != null)
                        {
                            component.SegmentationTree.SelectedSeg = seg;
                            component.ShowImageContainingSeg(seg);
                        }
                    }
                }
            }
        public void Show()
        {
            // check if a layout component is already displayed
            if (_shelves.ContainsKey(Context.DesktopWindow))
            {
                _shelves[Context.DesktopWindow].Activate();
            }
            else
            {
                BlockingOperation.Run(delegate
                                          {
                                              _desktopWindow = Context.DesktopWindow;

                                              var component =
                                                  new SegmentationComponent(Context.DesktopWindow);

                                              IShelf shelf = ApplicationComponent.LaunchAsShelf(
                                                  _desktopWindow,
                                                  component,
                                                  SR.SegmentationTitle,
                                                  "DICOM Segmentation",
                                                  ShelfDisplayHint.DockRight | ShelfDisplayHint.DockAutoHide);

                                              shelf.Closed += OnShelfClosed;
                                              _shelves[_desktopWindow] = shelf;
                                          });
            }
        }