Beispiel #1
0
 public void Dispose()
 {
     if (_data != null)
     {
         _data.OnReferenceDisposed();
         _data = null;
     }
 }
        public override List <IDisplaySet> CreateDisplaySets(Series series)
        {
            List <IDisplaySet> displaySets = new List <IDisplaySet>();

            if (IsValidPETFusionSeries(series))
            {
                var fuseableBaseSeries = new List <Series>(FindFuseableBaseSeries(series));
                if (fuseableBaseSeries.Count > 0)
                {
                    string error;
                    if (!CheckPETFusionSeries(series, out error))
                    {
                        // if there is an error with the PET series, avoid trying to generate the volume entirely
                        // instead, generate a placeholder series for each base series
                        foreach (var baseSeries in fuseableBaseSeries)
                        {
                            displaySets.Add(CreateFusionErrorDisplaySet(baseSeries, series, error));
                        }
                        return(displaySets);
                    }

                    using (var fusionOverlayData = new FusionOverlayData(GetFrames(series.Sops)))
                    {
                        foreach (var baseSeries in fuseableBaseSeries)
                        {
                            if (!CheckBaseSeries(baseSeries, out error))
                            {
                                // if there is an error with a single base series, generate a placeholder series
                                displaySets.Add(CreateFusionErrorDisplaySet(baseSeries, series, error));
                                continue;
                            }

                            var descriptor = new PETFusionDisplaySetDescriptor(baseSeries.GetIdentifier(), series.GetIdentifier(), IsAttenuationCorrected(series.Sops[0]));
                            var displaySet = new DisplaySet(descriptor);
                            foreach (var baseFrame in GetFrames(baseSeries.Sops))
                            {
                                using (var fusionOverlaySlice = fusionOverlayData.CreateOverlaySlice(baseFrame))
                                {
                                    var fus = new FusionPresentationImage(baseFrame, fusionOverlaySlice);
                                    displaySet.PresentationImages.Add(fus);
                                }
                            }
                            displaySet.PresentationImages.Sort();
                            displaySets.Add(displaySet);
                        }
                    }
                }
            }
            return(displaySets);
        }
Beispiel #3
0
 public FusionOverlayDataReference(FusionOverlayData data)
 {
     _data = data;
     _data.OnReferenceCreated();
 }