Exemplo n.º 1
0
            /// <summary>
            /// Cloning constructor.
            /// </summary>
            /// <param name="source">The source object from which to clone.</param>
            /// <param name="context">The cloning context object.</param>
            private PlaceholderPresentationImage(PlaceholderPresentationImage source, ICloningContext context)
                : base(source, context)
            {
                _sopReference = source._sopReference.Clone();

                context.CloneFields(source, this);
            }
Exemplo n.º 2
0
 public void Dispose()
 {
     if (_sopReference != null)
     {
         _sopReference.Dispose();
         _sopReference = null;
     }
 }
Exemplo n.º 3
0
 public SopDataSourceStudyItem(Sop sop)
 {
     Platform.CheckTrue(sop.DataSource is ILocalSopDataSource, "Sop must be local");
     {
         _filename     = ((ILocalSopDataSource)sop.DataSource).Filename;
         _sopReference = sop.CreateTransientReference();
     }
 }
Exemplo n.º 4
0
		public SopDataSourceStudyItem(ILocalSopDataSource sopDataSource)
		{
			_filename = sopDataSource.Filename;
			using (Sop sop = new Sop(sopDataSource))
			{
				_sopReference = sop.CreateTransientReference();
			}
		}
Exemplo n.º 5
0
			public void Dispose()
			{
				if (_sopReference != null)
				{
					_sopReference.Dispose();
					_sopReference = null;
				}
			}
Exemplo n.º 6
0
		public SopDataSourceStudyItem(Sop sop)
		{
			if (sop.DataSource is ILocalSopDataSource)
			{
				_filename = ((ILocalSopDataSource) sop.DataSource).Filename;
				_sopReference = sop.CreateTransientReference();
			}
		}
Exemplo n.º 7
0
		public SopDataSourceStudyItem(Sop sop)
		{
			Platform.CheckTrue(sop.DataSource is ILocalSopDataSource, "Sop must be local");
			{
				_filename = ((ILocalSopDataSource) sop.DataSource).Filename;
				_sopReference = sop.CreateTransientReference();
			}
		}
Exemplo n.º 8
0
 public SopDataSourceStudyItem(ILocalSopDataSource sopDataSource)
 {
     _filename = sopDataSource.Filename;
     using (Sop sop = new Sop(sopDataSource))
     {
         _sopReference = sop.CreateTransientReference();
     }
 }
Exemplo n.º 9
0
 public SopDataSourceStudyItem(Sop sop)
 {
     if (sop.DataSource is ILocalSopDataSource)
     {
         _filename     = ((ILocalSopDataSource)sop.DataSource).Filename;
         _sopReference = sop.CreateTransientReference();
     }
 }
Exemplo n.º 10
0
 protected override void Dispose(bool disposing)
 {
     if (_sopReference != null)
     {
         _sopReference.Dispose();
         _sopReference = null;
     }
     base.Dispose(disposing);
 }
Exemplo n.º 11
0
		protected override void Dispose(bool disposing)
		{
			if (disposing)
			{
				if (_sopReference != null)
				{
					_sopReference.Dispose();
					_sopReference = null;
				}
			}
			base.Dispose(disposing);
		}
Exemplo n.º 12
0
            public PlaceholderPresentationImage(Sop sop)
                : base(new GrayscaleImageGraphic(1, 1))
            {
                _sopReference = sop.CreateTransientReference();

                var sopClass            = SopClass.GetSopClass(sop.SopClassUid);
                var sopClassDescription = sopClass != null ? sopClass.Name : SR.LabelUnknown;

                CompositeImageGraphic.Graphics.Add(new ErrorMessageGraphic {
                    Text = string.Format(SR.MessageUnsupportedImageType, sopClassDescription), Color = Color.WhiteSmoke
                });
                Platform.Log(LogLevel.Warn, "Unsupported SOP Class \"{0} ({1})\" (SOP Instance {2})", sopClassDescription, sop.SopClassUid, sop.SopInstanceUid);
            }
Exemplo n.º 13
0
        public void TestReferences2()
        {
            IList <DicomAttributeCollection> collections = base.SetupMRSeries(1, 1, "test");
            DicomFile      file       = new DicomFile(null, new DicomAttributeCollection(), collections[0]);
            TestDataSource dataSource = new TestDataSource(file);
            Sop            sop        = Sop.Create(dataSource);

            ISopReference reference1 = sop.CreateTransientReference();
            ISopReference reference2 = sop.CreateTransientReference();

            sop.Dispose();
            Assert.IsFalse(dataSource.IsDisposed);
            Assert.IsFalse(SopDataCache.ItemCount == 0, "The Sop data cache is NOT empty.");

            reference1.Dispose();
            Assert.IsFalse(dataSource.IsDisposed);
            Assert.IsFalse(SopDataCache.ItemCount == 0, "The Sop data cache is NOT empty.");

            reference2.Dispose();
            Assert.IsTrue(dataSource.IsDisposed);
            Assert.IsTrue(SopDataCache.ItemCount == 0, "The Sop data cache is NOT empty.");
        }
Exemplo n.º 14
0
        public void TestCaching()
        {
            IList <DicomAttributeCollection> collections = base.SetupMRSeries(1, 1, "test");
            DicomFile file1 = new DicomFile(null, new DicomAttributeCollection(), collections[0].Copy());
            DicomFile file2 = new DicomFile(null, new DicomAttributeCollection(), collections[0].Copy());

            TestDataSource dataSource1 = new TestDataSource(file1);
            TestDataSource dataSource2 = new TestDataSource(file2);

            Sop sop1 = Sop.Create(dataSource1);

            Assert.IsTrue(SopDataCache.ItemCount == 1, "The Sop data cache should have 1 entry.");

            Sop sop2 = Sop.Create(dataSource2);

            Assert.IsTrue(SopDataCache.ItemCount == 1, "The Sop data cache should have 1 entry.");
            Assert.IsTrue(dataSource2.IsDisposed, "The data source has not been disposed.");
            Assert.IsFalse(dataSource1.IsDisposed, "The data source should not be disposed.");

            sop1.Dispose();
            Assert.IsTrue(SopDataCache.ItemCount == 1, "The Sop data cache should have 1 entry.");

            ISopReference reference21 = sop2.CreateTransientReference();
            ISopReference reference22 = sop2.CreateTransientReference();

            reference21.Dispose();
            Assert.IsFalse(dataSource1.IsDisposed, "The data source has been disposed.");
            Assert.IsTrue(SopDataCache.ItemCount == 1, "The Sop data cache should have 1 entry.");

            sop2.Dispose();
            Assert.IsFalse(dataSource1.IsDisposed, "The data source has been disposed.");
            Assert.IsTrue(SopDataCache.ItemCount == 1, "The Sop data cache should have 1 entry.");

            reference22.Dispose();
            Assert.IsTrue(dataSource1.IsDisposed, "The data source has not been disposed.");
            Assert.IsTrue(SopDataCache.ItemCount == 0, "The Sop data cache is NOT empty.");
        }
Exemplo n.º 15
0
            /// <summary>
            /// Cloning constructor.
            /// </summary>
            /// <param name="source">The source object from which to clone.</param>
            /// <param name="context">The cloning context object.</param>
            private PlaceholderPresentationImage(PlaceholderPresentationImage source, ICloningContext context)
                : base(source, context)
            {
                _sopReference = source._sopReference.Clone();

                context.CloneFields(source, this);
            }
Exemplo n.º 16
0
            public PlaceholderPresentationImage(Sop sop)
                : base(new GrayscaleImageGraphic(1, 1))
            {
                _sopReference = sop.CreateTransientReference();

                var sopClass = SopClass.GetSopClass(sop.SopClassUid);
                var sopClassDescription = sopClass != null ? sopClass.Name : SR.LabelUnknown;
                CompositeImageGraphic.Graphics.Add(new ErrorMessageGraphic { Text = string.Format(SR.MessageUnsupportedImageType, sopClassDescription), Color = Color.WhiteSmoke });
                Platform.Log(LogLevel.Warn, "Unsupported SOP Class \"{0} ({1})\" (SOP Instance {2})", sopClassDescription, sop.SopClassUid, sop.SopInstanceUid);
            }
Exemplo n.º 17
0
 public FrameReference(Frame frame)
 {
     _frame        = frame;
     _sopReference = _frame.ParentImageSop.CreateTransientReference();
 }
Exemplo n.º 18
0
			public FrameReference(Frame frame)
			{
				_frame = frame;
				_sopReference = _frame.ParentImageSop.CreateTransientReference();
			}