Пример #1
0
        private void UpdateStructures(PatientGroupViewModel patientGroupItem)
        {
            LocalGeometryResourceManagerClient gmsc1 =
                new LocalGeometryResourceManagerClient();

            var sdcs = from guid in gmsc1.GetStructureResourceIds(patientGroupItem.PatientId)
                       select gmsc1.GetStructure(guid);

            int countSeries = sdcs.Count();

            foreach (var sdc in sdcs)
            {
                var smdc         = gmsc1.GetSurfaceMeshByRelatedStructureId(sdc.Id);
                int meshVertices = smdc != null ? (int)smdc.VertexBuffer.ElementCount : 0;

                Dispatcher.Invoke(() =>
                                  ImageSelectionManager.AddOrUpdate <StructureViewModel>(
                                      _imageSelectionManager._structures,
                                      s => s.ROIName.CompareTo(sdc.ROIName) == 0,
                                      s =>
                {
                    s.ROICount++;
                    s.MeshStatus =
                        (meshVertices > 0)
                                            ? string.Format("Meshed ({0} vertices)", meshVertices)
                                            : "<not meshed>";
                },
                                      () => new StructureViewModel(sdc.Id, sdc.ROIName)
                {
                    FrameOfReferenceUID = sdc.FrameOfReferenceUID,
                    MeshStatus          =
                        (meshVertices > 0)
                                            ? string.Format("Meshed ({0} vertices)", meshVertices)
                                            : "<not meshed>"
                }));
            }

            gmsc1.Close();
        }
Пример #2
0
        private void UpdateFromImages(PatientGroupViewModel patientGroupItem)
        {
            LocalImageResourceManagerClient cmsc1 =
                new LocalImageResourceManagerClient();

            var idcs = from guid in cmsc1.GetImageResourceIds(patientGroupItem.PatientId)
                       select cmsc1.GetImage(guid);

            var idcsList = idcs.Where(thisIdc => thisIdc != null).ToList();

            foreach (var idc in idcsList)
            {
                int volumeVoxels = 0;

                Dispatcher.Invoke(() =>
                                  ImageSelectionManager.AddOrUpdate <ImageSeriesViewModel>(
                                      _imageSelectionManager._series,
                                      s => s.SeriesInstanceUID.CompareTo(idc.SeriesInstanceUID) == 0,
                                      s =>
                {
                    s.InstanceCount++;
                    s.ResampleStatus =
                        (volumeVoxels > 0)
                                        ? string.Format("Resampled ({0} voxels)", volumeVoxels)
                                        : "<not resampled>";
                },
                                      () =>
                {
                    var isvm            = ImageSeriesViewModel.Create(idc);
                    isvm.ResampleStatus = (volumeVoxels > 0)
                                    ? string.Format("Resampled ({0} voxels)", volumeVoxels)
                                    : "<not resampled>";
                    return(isvm);
                }));
            }

            cmsc1.Close();
        }
Пример #3
0
        private void UpdateFromSeries(PatientGroupViewModel patientGroupItem)
        {
            LocalImageResourceManagerClient cmsc1 =
                new LocalImageResourceManagerClient();

            var ivdcs = from guid in cmsc1.GetImageVolumeResourceIds(patientGroupItem.PatientId)
                        select cmsc1.GetImageVolume(guid);

            // force generation
            var ivdcsList = ivdcs.ToList();

            foreach (var ivdc in ivdcsList)
            {
                Dispatcher.Invoke(() =>
                                  ImageSelectionManager.AddOrUpdate <ImageSeriesViewModel>(
                                      _imageSelectionManager._series,
                                      s => s.SeriesInstanceUID.CompareTo(ivdc.Identity.SeriesInstanceUID) == 0,
                                      s =>
                {
                    s.ResampleStatus =
                        (ivdc != null)
                                        ? string.Format("Resampled ({0} slices)", ivdc.Depth)
                                        : "<not resampled>";
                },
                                      () =>
                {
                    var isvm            = ImageSeriesViewModel.Create(ivdc);
                    isvm.ResampleStatus = (ivdc != null)
                                    ? string.Format("Resampled ({0} slices)", ivdc.Depth)
                                    : "<not resampled>";
                    return(isvm);
                }));
            }

            cmsc1.Close();
        }