Exemplo n.º 1
0
        internal VolumeSlice(IVolumeReference volumeReference, VolumeSliceArgs sliceArgs, Vector3D imagePositionPatient, float?spacingBetweenSlices)
        {
            Platform.CheckForNullReference(volumeReference, "volumeReference");
            Platform.CheckForNullReference(sliceArgs, "slicerArgs");
            Platform.CheckForNullReference(imagePositionPatient, "imagePositionPatient");

            _volumeReference      = volumeReference;
            _sliceArgs            = sliceArgs;
            _imagePositionPatient = imagePositionPatient;

            // compute Rows and Columns to reflect actual output size
            Columns = sliceArgs.Columns;
            Rows    = sliceArgs.Rows;

            // compute Slice Thickness
            var sliceThickness = sliceArgs.SliceThickness;

            SliceThickness = new DicomAttributeDS(DicomTags.SliceThickness)
            {
                Values = sliceThickness
            }.ToString();
            SpacingBetweenSlices = spacingBetweenSlices.HasValue ? new DicomAttributeDS(DicomTags.SpacingBetweenSlices)
            {
                Values = spacingBetweenSlices.Value
            }.ToString() : string.Empty;

            // compute Pixel Spacing
            var spacing = new DicomAttributeDS(DicomTags.PixelSpacing);

            spacing.SetFloat32(0, sliceArgs.RowSpacing);
            spacing.SetFloat32(1, sliceArgs.ColumnSpacing);
            PixelSpacing = spacing.ToString();

            // compute Image Orientation (Patient)
            var rowOrientation    = sliceArgs.RowOrientationPatient;
            var columnOrientation = sliceArgs.ColumnOrientationPatient;
            var orientation       = new DicomAttributeDS(DicomTags.ImageOrientationPatient);

            orientation.SetFloat32(0, rowOrientation.X);
            orientation.SetFloat32(1, rowOrientation.Y);
            orientation.SetFloat32(2, rowOrientation.Z);
            orientation.SetFloat32(3, columnOrientation.X);
            orientation.SetFloat32(4, columnOrientation.Y);
            orientation.SetFloat32(5, columnOrientation.Z);
            ImageOrientationPatient = orientation.ToString();

            // compute Image Position (Patient)
            var position = new DicomAttributeDS(DicomTags.ImagePositionPatient);

            position.SetFloat32(0, _imagePositionPatient.X);
            position.SetFloat32(1, _imagePositionPatient.Y);
            position.SetFloat32(2, _imagePositionPatient.Z);
            ImagePositionPatient = position.ToString();
        }
Exemplo n.º 2
0
        internal VolumeSlice(IVolumeReference volumeReference, IVolumeSlicerParams slicerParams, Vector3D throughPoint)
        {
            Platform.CheckForNullReference(throughPoint, "throughPoint");
            var volume = volumeReference.Volume;

            _volumeReference = volumeReference;
            _slicerParams    = slicerParams;
            _throughPoint    = throughPoint;

            // keep a direct reference to the prototype, so that attribute values are available even if the referenced volume is unloaded via memory management
            _prototypeDataSet = volume.DataSet;

            // JY: ideally, each slicing plane is represented by a single multiframe SOP where the individual slices are the frames.
            // We need to support multi-valued Slice Location in the base viewer first.
            // When that is implemented, the SOPs should be created on the first frame of the slicing (i.e. one of the end slices)
            // and the Slice Location Vector will simply store the slice locations relative to that defined in these attributes.
            // Also, the rows and columns will have to be computed to be the MAX possible size (all frames must have same size)

            // compute Rows and Columns to reflect actual output size
            var frameSize = GetSliceExtent(volume, slicerParams);

            Colums = frameSize.Width;
            Rows   = frameSize.Height;

            // compute Image Orientation (Patient)
            var matrix = new Matrix(slicerParams.SlicingPlaneRotation);

            matrix[3, 0] = _throughPoint.X;
            matrix[3, 1] = _throughPoint.Y;
            matrix[3, 2] = _throughPoint.Z;

            var resliceAxesPatientOrientation = _volumeReference.Volume.RotateToPatientOrientation(matrix);
            var orientation = new DicomAttributeDS(DicomTags.ImageOrientationPatient);

            orientation.SetFloat32(0, resliceAxesPatientOrientation[0, 0]);
            orientation.SetFloat32(1, resliceAxesPatientOrientation[0, 1]);
            orientation.SetFloat32(2, resliceAxesPatientOrientation[0, 2]);
            orientation.SetFloat32(3, resliceAxesPatientOrientation[1, 0]);
            orientation.SetFloat32(4, resliceAxesPatientOrientation[1, 1]);
            orientation.SetFloat32(5, resliceAxesPatientOrientation[1, 2]);
            ImageOrientationPatient = orientation.ToString();

            // compute Image Position (Patient)
            var topLeftOfSlicePatient = GetTopLeftOfSlicePatient(frameSize, _throughPoint, volume, slicerParams);
            var position = new DicomAttributeDS(DicomTags.ImagePositionPatient);

            position.SetFloat32(0, topLeftOfSlicePatient.X);
            position.SetFloat32(1, topLeftOfSlicePatient.Y);
            position.SetFloat32(2, topLeftOfSlicePatient.Z);
            ImagePositionPatient = position.ToString();
        }
Exemplo n.º 3
0
        public void SpecificCharacterSetTest()
        {
            bool testResult = false;
            try
            {
                DicomAttributeDS attrib = new DicomAttributeDS(DicomTagDictionary.GetDicomTag(DicomTags.AccessionNumber));
            }
            catch (DicomException)
            {
                testResult = true;
            }
            Assert.AreEqual(testResult, true);

            testResult = true;
            try
            {
                DicomAttributeDS attrib = new DicomAttributeDS(DicomTagDictionary.GetDicomTag(DicomTags.WindowCenter));
                testResult = true;
            }
            catch (DicomException)
            {
                testResult = false;
            }
            Assert.AreEqual(testResult, true);


        }
Exemplo n.º 4
0
            /// <summary>
            /// Test Get methods.
            ///
            /// </summary>
            public void TestGet()
            {
                DicomAttributeDS attrib ;
                
                #region GetInt16
                Int16 valueInt16;
                attrib = CreateAttribute();
                attrib.SetInt16(0, 1000);
                Assert.IsTrue(attrib.TryGetInt16(0, out valueInt16));
                Assert.AreEqual(1000, valueInt16);
                Assert.AreEqual(1000, attrib.GetInt16(0, 0));
 
                // special case: too big to fit
                attrib = CreateAttribute();
                attrib.SetUInt64(0, UInt64.MaxValue);
                Assert.IsTrue(attrib.TryGetInt16(0, out valueInt16) == false);
                Assert.AreEqual(0, attrib.GetInt16(0, 0));

                // special case: float to Int16
                attrib = CreateAttribute();
                attrib.SetFloat64(0, 1000.50f);
                Assert.IsTrue(attrib.TryGetInt16(0, out valueInt16) == false);
                Assert.AreEqual(0, attrib.GetInt16(0, 0));

                // special case: invalid index
                attrib = CreateAttribute();
                attrib.SetFloat64(0, 1000.50f);
                Assert.IsTrue(attrib.TryGetInt16(10, out valueInt16) == false);
                Assert.AreEqual(0, attrib.GetInt16(10, 0));

                // special case: leading/trailing spaces
                attrib = CreateAttribute();
                attrib.SetString(0, " 1000 ");
                Assert.AreEqual(1, attrib.Count);
                Assert.IsTrue(attrib.TryGetInt16(0, out valueInt16));
                Assert.AreEqual(1000, valueInt16);
                Assert.AreEqual(1000, attrib.GetInt16(0, 0));
 
                #endregion

                #region GetInt32
                Int32 valueInt32;
                attrib = CreateAttribute();
                attrib.SetInt32(0, 1000);
                Assert.IsTrue(attrib.TryGetInt32(0, out valueInt32));
                Assert.AreEqual(1000, valueInt32);
                Assert.AreEqual(1000, attrib.GetInt32(0, 0));

                // special case: too big to fit
                attrib = CreateAttribute();
                attrib.SetUInt64(0, UInt64.MaxValue);
                Assert.IsTrue(attrib.TryGetInt32(0, out valueInt32) == false);
                Assert.AreEqual(0, attrib.GetInt32(0, 0));

                // special case: float to Int32
                attrib = CreateAttribute();
                attrib.SetFloat64(0, 1000.50f);
                Assert.IsTrue(attrib.TryGetInt32(0, out valueInt32) == false);
                Assert.AreEqual(0, attrib.GetInt32(0, 0));

                // special case: invalid index
                attrib = CreateAttribute();
                attrib.SetFloat64(0, 1000.50f);
                Assert.IsTrue(attrib.TryGetInt32(10, out valueInt32) == false);
                Assert.AreEqual(0, attrib.GetInt32(10, 0));

                // special case: leading/trailing spaces
                attrib = CreateAttribute();
                attrib.SetString(0, " 1000 ");
                Assert.AreEqual(1, attrib.Count);
                Assert.IsTrue(attrib.TryGetInt32(0, out valueInt32));
                Assert.AreEqual(1000, valueInt32);
                Assert.AreEqual(1000, attrib.GetInt32(0, 0));

                #endregion

                #region GetInt64
                Int64 valueInt64;
                attrib = CreateAttribute();
                attrib.SetInt64(0, 1000);
                Assert.IsTrue(attrib.TryGetInt64(0, out valueInt64) == true);
                Assert.AreEqual(1000, valueInt64);
                Assert.AreEqual(1000, attrib.GetInt64(0, 0));

                // special case: too big to fit
                attrib = CreateAttribute();
                attrib.SetUInt64(0, UInt64.MaxValue);
                Assert.IsTrue(attrib.TryGetInt64(0, out valueInt64) == false);
                Assert.AreEqual(0, attrib.GetInt64(0, 0));

                // special case: float to Int64
                attrib = CreateAttribute();
                attrib.SetFloat64(0, 1000.50f);
                Assert.IsTrue(attrib.TryGetInt64(0, out valueInt64) == false);
                Assert.AreEqual(0, attrib.GetInt64(0, 0));

                // special case: invalid index
                attrib = CreateAttribute();
                attrib.SetFloat64(0, 1000.50f);
                Assert.IsTrue(attrib.TryGetInt64(10, out valueInt64) == false);
                Assert.AreEqual(0, attrib.GetInt64(10, 0));

                // special case: leading/trailing spaces
                attrib = CreateAttribute();
                attrib.SetString(0, " 1000 ");
                Assert.AreEqual(1, attrib.Count);
                Assert.IsTrue(attrib.TryGetInt64(0, out valueInt64) == true);
                Assert.AreEqual(1000, valueInt64);
                Assert.AreEqual(1000, attrib.GetInt64(0, 0));

                #endregion

                #region GetUInt16
                UInt16 valueUInt16;
                attrib = CreateAttribute();
                attrib.SetUInt16(0, 1000);
                Assert.IsTrue(attrib.TryGetUInt16(0, out valueUInt16) == true);
                Assert.AreEqual(1000, valueUInt16);
                Assert.AreEqual(1000, attrib.GetUInt16(0, 0));

                // special case: too big to fit
                attrib = CreateAttribute();
                attrib.SetUInt64(0, UInt64.MaxValue);
                Assert.IsTrue(attrib.TryGetUInt16(0, out valueUInt16) == false);
                Assert.AreEqual(0, attrib.GetUInt16(0, 0));

                // special case: float to UInt16
                attrib = CreateAttribute();
                attrib.SetFloat64(0, 1000.50f);
                Assert.IsTrue(attrib.TryGetUInt16(0, out valueUInt16) == false);
                Assert.AreEqual(0, attrib.GetUInt16(0, 0));

                // special case: invalid index
                attrib = CreateAttribute();
                attrib.SetFloat64(0, 1000.50f);
                Assert.IsTrue(attrib.TryGetUInt16(10, out valueUInt16) == false);
                Assert.AreEqual(0, attrib.GetUInt16(10, 0));

                // special case: leading/trailing spaces
                attrib = CreateAttribute();
                attrib.SetString(0, " 1000 ");
                Assert.AreEqual(1, attrib.Count);
                Assert.IsTrue(attrib.TryGetUInt16(0, out valueUInt16));
                Assert.AreEqual(1000, valueUInt16);
                Assert.AreEqual(1000, attrib.GetUInt16(0, 0));

                #endregion

                #region GetUInt32
                UInt32 valueUInt32;
                attrib = CreateAttribute();
                attrib.SetUInt32(0, 1000);
                Assert.IsTrue(attrib.TryGetUInt32(0, out valueUInt32));
                Assert.AreEqual(1000, valueUInt32);
                Assert.AreEqual(1000, attrib.GetUInt32(0, 0));

                // special case: too big to fit
                attrib = CreateAttribute();
                attrib.SetUInt64(0, UInt64.MaxValue);
                Assert.IsTrue(attrib.TryGetUInt32(0, out valueUInt32) == false);
                Assert.AreEqual(0, attrib.GetUInt32(0, 0));

                // special case: float to UInt32
                attrib = CreateAttribute();
                attrib.SetFloat64(0, 1000.50f);
                Assert.IsTrue(attrib.TryGetUInt32(0, out valueUInt32) == false);
                Assert.AreEqual(0, attrib.GetUInt32(0, 0));

                // special case: invalid index
                attrib = CreateAttribute();
                attrib.SetFloat64(0, 1000.50f);
                Assert.IsTrue(attrib.TryGetUInt32(10, out valueUInt32) == false);
                Assert.AreEqual(0, attrib.GetUInt32(10, 0));

                // special case: leading/trailing spaces
                attrib = CreateAttribute();
                attrib.SetString(0, " 1000 ");
                Assert.AreEqual(1, attrib.Count);
                Assert.IsTrue(attrib.TryGetUInt32(0, out valueUInt32) == true);
                Assert.AreEqual(1000, valueUInt32);
                Assert.AreEqual(1000, attrib.GetUInt32(0, 0));

                #endregion

                #region GetUInt64
                UInt64 valueUInt64;
                attrib = CreateAttribute();
                attrib.SetUInt64(0, 1000);
                Assert.IsTrue(attrib.TryGetUInt64(0, out valueUInt64) == true);
                Assert.AreEqual(1000, valueUInt64);
                Assert.AreEqual(1000, attrib.GetUInt64(0, 0));

                // special case: too big to fit
                // N/A

                // special case: float to UInt64
                attrib = CreateAttribute();
                attrib.SetFloat64(0, 1000.50f);
                Assert.IsTrue(attrib.TryGetUInt64(0, out valueUInt64) == false);
                Assert.AreEqual(0, attrib.GetUInt64(0, 0));

                // special case: invalid index
                attrib = CreateAttribute();
                attrib.SetFloat64(0, 1000.50f);
                Assert.IsTrue(attrib.TryGetUInt64(10, out valueUInt64) == false);
                Assert.AreEqual(0, attrib.GetUInt64(10, 0));

                // special case: leading/trailing spaces
                attrib = CreateAttribute();
                attrib.SetString(0, " 1000 ");
                Assert.AreEqual(1, attrib.Count);
                Assert.IsTrue(attrib.TryGetUInt64(0, out valueUInt64) == true);
                Assert.AreEqual(1000, valueUInt64);
                Assert.AreEqual(1000, attrib.GetUInt64(0, 0));

                #endregion

                #region GetFloat
                float valueFloat;
                double valueDouble;
                attrib = CreateAttribute();
                attrib.SetInt16(0,-1000);
                attrib.SetFloat32(1, 2000.0f);
                attrib.SetFloat64(2, 3000.0d);
                Assert.AreEqual(3, attrib.Count);
                
                Assert.IsTrue(attrib.TryGetFloat32(0, out valueFloat) == true);
                Assert.IsTrue(attrib.TryGetFloat64(0, out valueDouble) == true);
                Assert.AreEqual(-1000.0f, attrib.GetFloat32(0, 0.0f));
                Assert.AreEqual(2000.0f, attrib.GetFloat32(1, 0.0f));
                Assert.AreEqual(3000.0f, attrib.GetFloat32(2, 0.0f));

                Assert.AreEqual(-1000.0f, attrib.GetFloat64(0, 0.0f));
                Assert.AreEqual(2000.0f, attrib.GetFloat64(1, 0.0f));
                Assert.AreEqual(3000.0f, attrib.GetFloat64(2, 0.0f));
       

                #endregion

                #region GetString
                attrib = new DicomAttributeDS(DicomTagDictionary.GetDicomTag(DicomTags.WindowCenter));
                attrib.AppendFloat32(1.239f);
                attrib.AppendUInt16(1900);
                attrib.AppendInt16(-120);
                Assert.AreEqual(3, attrib.Count);

				//TODO: this test now fails because the value is not reversible.
				//Assert.AreEqual( "1.239", attrib.GetString(0, "")); 
                Assert.AreEqual("1900", attrib.GetString(1, ""));
                Assert.AreEqual("-120", attrib.GetString(2, ""));

                Assert.AreEqual("", attrib.GetString(10, ""));


                // special case: leading/trailing spaces
                // Underyling data is string, spaces should be preserved 
                attrib = CreateAttribute();
                attrib.SetString(0, " 1000 ");
                Assert.AreEqual(1, attrib.Count);
                Assert.AreEqual(" 1000 ", attrib.GetString(0, ""));
                Assert.AreEqual(" 1000 ", attrib.GetString(0, ""));

                #endregion

            }
Exemplo n.º 5
0
 public void TestConstructors()
 {
     try
     {
         DicomAttributeDS attrib = new DicomAttributeDS(DicomTagDictionary.GetDicomTag(DicomTags.AccessionNumber));
         Assert.Fail("Above statement should throw exception");
     }
     catch (DicomException)
     {
         
     }
     
 }
Exemplo n.º 6
0
 public DicomAttributeDS CreateAttribute()
 {
     DicomAttributeDS attrib = new DicomAttributeDS(DicomTagDictionary.GetDicomTag(DicomTags.WindowCenter));
     Assert.AreEqual(0, attrib.Count);
     Assert.AreEqual(0, attrib.StreamLength);
     return attrib;    
 }
Exemplo n.º 7
0
        //public void SaveEfilm(string efilmFullPath, ref string efilmOriginalSopInstanceUID)
        //{
        //    efilmOriginalSopInstanceUID = string.Empty;

        //}

        public void SaveEfilm(string efilmFullPath, ref string efilmOriginalSopInstanceUID, ref string efilmOriginalStudyInstanceUid, bool ifSaveEFilm)
        {
            efilmOriginalSopInstanceUID = string.Empty;

            try
            {
                Logger.LogFuncUp();

                if (_dicomDataHeader == null)
                {
                    return;
                }

                var wrtBmp = RenderControlWriteableBitmap();

                if (wrtBmp == null)
                {
                    throw new ApplicationException("ViewerControl Writeable Bitmap Render failed.");
                }



                byte[] data = ProcessImage(wrtBmp);
                Console.WriteLine(Convert.ToString(wrtBmp.PixelWidth) + " ,,,,," + Convert.ToString(wrtBmp.PixelHeight));

                ////MedViewerLayoutCell layoutCell = medViewerControl.LayoutManager.RootCell;
                ////MedViewerControlCell cell = GetControlCell(layoutCell);


                var pixelHeightTag = new DicomAttributeUS(new DicomTag(Pipeline.Dictionary.Tag.Rows));
                pixelHeightTag.SetUInt16(0, Convert.ToUInt16(wrtBmp.PixelHeight));
                _dicomDataHeader.RemoveDicomAttribute(Pipeline.Dictionary.Tag.Rows);
                _dicomDataHeader.AddDicomAttribute(pixelHeightTag);

                var pixelWidthTag = new DicomAttributeUS(new DicomTag(Pipeline.Dictionary.Tag.Columns));
                pixelWidthTag.SetUInt16(0, Convert.ToUInt16(wrtBmp.PixelWidth));
                _dicomDataHeader.RemoveDicomAttribute(Pipeline.Dictionary.Tag.Columns);
                _dicomDataHeader.AddDicomAttribute(pixelWidthTag);

                var bitStoredTag = new DicomAttributeUS(new DicomTag(Pipeline.Dictionary.Tag.BitsStored));
                bitStoredTag.SetUInt16(0, 8);
                _dicomDataHeader.RemoveDicomAttribute(Pipeline.Dictionary.Tag.BitsStored);
                _dicomDataHeader.AddDicomAttribute(bitStoredTag);

                var bitAllocatedTag = new DicomAttributeUS(new DicomTag(Pipeline.Dictionary.Tag.BitsAllocated));
                bitAllocatedTag.SetUInt16(0, 8);
                _dicomDataHeader.RemoveDicomAttribute(Pipeline.Dictionary.Tag.BitsAllocated);
                _dicomDataHeader.AddDicomAttribute(bitAllocatedTag);

                var hightBitTag = new DicomAttributeUS(new DicomTag(Pipeline.Dictionary.Tag.HighBit));
                hightBitTag.SetUInt16(0, 7);
                _dicomDataHeader.RemoveDicomAttribute(Pipeline.Dictionary.Tag.HighBit);
                _dicomDataHeader.AddDicomAttribute(hightBitTag);

                var pixelRepresentationTag = new DicomAttributeUS(new DicomTag(Pipeline.Dictionary.Tag.PixelRepresentation));
                pixelRepresentationTag.SetUInt16(0, 0);
                _dicomDataHeader.RemoveDicomAttribute(Pipeline.Dictionary.Tag.PixelRepresentation);
                _dicomDataHeader.AddDicomAttribute(pixelRepresentationTag);

                var rescaleSlopeTag = new DicomAttributeDS(new DicomTag(Pipeline.Dictionary.Tag.RescaleSlope));
                rescaleSlopeTag.SetString(0, "1");
                _dicomDataHeader.RemoveDicomAttribute(Pipeline.Dictionary.Tag.RescaleSlope);
                _dicomDataHeader.AddDicomAttribute(rescaleSlopeTag);

                var rescaleInterceptTag = new DicomAttributeDS(new DicomTag(Pipeline.Dictionary.Tag.RescaleIntercept));
                rescaleInterceptTag.SetString(0, "0");;
                _dicomDataHeader.RemoveDicomAttribute(Pipeline.Dictionary.Tag.RescaleIntercept);
                _dicomDataHeader.AddDicomAttribute(rescaleInterceptTag);


                ////insert Photometric Interpretation //maybe can fix inverse problem
                //var photometricInterpretationTag = new DicomAttributeUS(new DicomTag(Pipeline.Dictionary.Tag.PhotometricInterpretation));
                //rescaleInterceptTag.SetString(0, "MONOCHROME2");
                ////_dicomDataHeader.RemoveDicomAttribute(Pipeline.Dictionary.Tag.PhotometricInterpretation);
                //_dicomDataHeader.AddDicomAttribute(photometricInterpretationTag);
                //insert Photometric Interpretation
                _dicomDataHeader.RemoveDicomAttribute(Pipeline.Dictionary.Tag.PhotometricInterpretation);
                var photometricInterpretationTag = DicomAttribute.CreateAttribute(Pipeline.Dictionary.Tag.PhotometricInterpretation);
                if (!photometricInterpretationTag.SetString(0, "MONOCHROME2"))
                {
                    throw new Exception("Failed to Insert Columns to Data header");
                }
                _dicomDataHeader.AddDicomAttribute(photometricInterpretationTag);

                _dicomDataHeader.RemoveDicomAttribute(Pipeline.Dictionary.Tag.WindowWidth);
                _dicomDataHeader.RemoveDicomAttribute(Pipeline.Dictionary.Tag.WindowCenter);
                var windowWidthTag = new DicomAttributeDS(new DicomTag(Pipeline.Dictionary.Tag.WindowWidth));
                //var windowWidthTag = DicomAttribute.CreateAttribute(Pipeline.Dictionary.Tag.WindowWidth);
                windowWidthTag.SetString(0, "256");
                _dicomDataHeader.AddDicomAttribute(windowWidthTag);
                var windowCenterTag = new DicomAttributeDS(new DicomTag(Pipeline.Dictionary.Tag.WindowCenter));
                //var windowCenterTag = DicomAttribute.CreateAttribute(Pipeline.Dictionary.Tag.WindowCenter);
                windowCenterTag.SetString(0, "127");
                _dicomDataHeader.AddDicomAttribute(windowCenterTag);

                if (_dicomDataHeader.Contains(Pipeline.Dictionary.Tag.PixelData))
                {
                    _dicomDataHeader[Pipeline.Dictionary.Tag.PixelData].SetBytes(0, data);
                }
                else
                {
                    var pixelTag = new DicomAttributeOW(new DicomTag(Pipeline.Dictionary.Tag.PixelData));
                    pixelTag.SetBytes(0, data);
                    _dicomDataHeader.AddDicomAttribute(pixelTag);
                }
                _dicomDataHeader.RemoveDicomAttribute(Pipeline.Dictionary.Tag.ShutterShape);
                _dicomDataHeader.RemoveDicomAttribute(Pipeline.Dictionary.Tag.ShutterLowerHorizontalEdge);
                _dicomDataHeader.RemoveDicomAttribute(Pipeline.Dictionary.Tag.ShutterRightVerticalEdge);
                _dicomDataHeader.RemoveDicomAttribute(Pipeline.Dictionary.Tag.ShutterLeftVerticalEdge);
                _dicomDataHeader.RemoveDicomAttribute(Pipeline.Dictionary.Tag.ShutterUpperHorizontalEdge);
                _dicomDataHeader.RemoveDicomAttribute(Pipeline.Dictionary.Tag.ImageHorizontalFlip);
                _dicomDataHeader.RemoveDicomAttribute(Pipeline.Dictionary.Tag.ImageRotation);
                _dicomDataHeader.RemoveDicomAttribute(Pipeline.Dictionary.Tag.SeriesNumber);
                //_dicomDataHeader.RemoveDicomAttribute(Pipeline.Dictionary.Tag.);
                //AssembleTag();

                var uidManager        = McsfDatabaseDicomUIDManagerFactory.Instance().CreateUIDManager();
                var seriesInstanceUid = uidManager.CreateSeriesUID("1", "2", ""); //seriesUID; //
                var imageUid          = uidManager.CreateImageUID("");

                //_dicomDataHeader.RemoveDicomAttribute(Pipeline.Dictionary.Tag.SeriesInstanceUid);
                //var seriesInstanceUidTag = new DicomAttributeUI(new DicomTag(Pipeline.Dictionary.Tag.SeriesInstanceUid));
                //seriesInstanceUidTag.SetString(0, seriesInstanceUid);
                //_dicomDataHeader.AddDicomAttribute(seriesInstanceUidTag);

                _dicomDataHeader.RemoveDicomAttribute(Pipeline.Dictionary.Tag.SOPInstanceUID);
                var sopInstanceUidTag = new DicomAttributeUI(new DicomTag(Pipeline.Dictionary.Tag.SOPInstanceUID));
                sopInstanceUidTag.SetString(0, imageUid);
                _dicomDataHeader.AddDicomAttribute(sopInstanceUidTag);

                _dicomDataHeader.RemoveDicomAttribute(Pipeline.Dictionary.Tag.ImageType);
                var imageTypeCollection = ("DERIVED\\SECONDARY\\DISPLAY\\FILMING\\EFILM").Split('\\');
                InsertStringArrayDicomElement(_dicomDataHeader, Pipeline.Dictionary.Tag.ImageType, imageTypeCollection);

                _dicomDataHeader.RemoveDicomAttribute(Pipeline.Dictionary.Tag.ConversionType);
                var cTypeTag = new DicomAttributeCS(new DicomTag(Pipeline.Dictionary.Tag.ConversionType));
                cTypeTag.SetString(0, "WSD");
                _dicomDataHeader.AddDicomAttribute(cTypeTag);

                _dicomDataHeader.RemoveDicomAttribute(Pipeline.Dictionary.Tag.SeriesDescription);
                var seriesDescriptionTag = new DicomAttributeLO(new DicomTag(Pipeline.Dictionary.Tag.SeriesDescription));
                seriesDescriptionTag.SetString(0, "Electronic film_" + DateTime.Now.ToString());
                _dicomDataHeader.AddDicomAttribute(seriesDescriptionTag);

                _dicomConvertorProxy.SaveFile(_dicomDataHeader, efilmFullPath, _proxy);

                var medViewerControlCell = medViewerControl.LayoutManager.ControlCells.FirstOrDefault();
                if (medViewerControlCell != null)
                {
                    var currentPage = medViewerControlCell.Image.CurrentPage;
                    efilmOriginalSopInstanceUID = currentPage.SOPInstanceUID;
                    var dicomHeader = currentPage.ImageHeader.DicomHeader;
                    if (dicomHeader.ContainsKey(ServiceTagName.StudyInstanceUID))
                    {
                        efilmOriginalStudyInstanceUid = dicomHeader[ServiceTagName.StudyInstanceUID];
                    }
                }

                if (!ifSaveEFilm)
                {
                    return;
                }
                CreateSeries(efilmOriginalStudyInstanceUid, seriesInstanceUid);
                SaveEFilmInCommonSave(seriesInstanceUid);

                Logger.LogFuncDown();
            }
            catch (Exception ex)
            {
                Logger.LogFuncException(ex.Message + ex.StackTrace);
            }
            finally
            {
                medViewerControl.RemoveAll();
            }
        }