コード例 #1
0
ファイル: TagTypeList.cs プロジェクト: ewcasas/DVTK
 /// <summary>
 /// Removes the first occurrence of a specific <see cref="TagType"/> from the <see cref="TagTypeList"/>.
 /// </summary>
 /// <param name="value">The <see cref="TagType"/> to remove from the <see cref="TagTypeList"/>.</param>
 public void Remove(TagType value)
 {
     List.Remove(value);
 }
コード例 #2
0
ファイル: TagTypeList.cs プロジェクト: ewcasas/DVTK
 /// <summary>
 /// Adds an object to the end of the <see cref="TagTypeList"/>.
 /// </summary>
 /// <param name="value">The <see cref="TagType"/> to be added to the end of the <see cref="TagTypeList"/>.</param>
 /// <returns>The <see cref="TagTypeList"/> index at which the value has been added.</returns>
 public int Add(TagType value)
 {
     return (List.Add(value));
 }
コード例 #3
0
ファイル: TagTypeList.cs プロジェクト: ewcasas/DVTK
 /// <summary>
 /// Searches for the specified <see cref="TagType"/> and 
 /// returns the zero-based index of the first occurrence within the entire <see cref="TagTypeList"/>.
 /// </summary>
 /// <param name="value">The <see cref="TagType"/> to locate in the <see cref="TagTypeList"/>.</param>
 /// <returns>
 /// The zero-based index of the first occurrence of value within the entire <see cref="TagTypeList"/>, 
 /// if found; otherwise, -1.
 /// </returns>
 public int IndexOf(TagType value)
 {
     return (List.IndexOf(value));
 }
コード例 #4
0
ファイル: TagTypeList.cs プロジェクト: ewcasas/DVTK
 /// <summary>
 /// Inserts an <see cref="TagType"/> element into the <see cref="TagType"/> at the specified index.
 /// </summary>
 /// <param name="index">The zero-based index at which value should be inserted.</param>
 /// <param name="value">The <see cref="TagTypeList"/> to insert.</param>
 public void Insert(int index, TagType value)
 {
     List.Insert(index, value);
 }
コード例 #5
0
ファイル: BaseInformationEntity.cs プロジェクト: ewcasas/DVTK
        private bool IsTagFoundInParent(BaseInformationEntity infoEntity,TagType tag)
        {
            if (infoEntity.Parent == null)
                return false;
            if(IsTagFoundInParent(infoEntity.Parent,tag))
            {
                return true;
            }
            if(TagTypeList==null)
                return false;

            foreach (TagType actTag in infoEntity.Parent.TagTypeList)
            {
                if (actTag.Tag.ElementNumber == tag.Tag.ElementNumber &&
                    actTag.Tag.GroupNumber == tag.Tag.GroupNumber
                    )
                {
                    return true;
                }

            }
            return false;
        }
コード例 #6
0
ファイル: BaseInformationEntity.cs プロジェクト: ewcasas/DVTK
        /// <summary>
        /// Check if the given Tag Type is in the local Tag Type list.
        /// </summary>
        /// <param name="tagType">Tag Type.</param>
        /// <returns>Boolean indicating if the Tag Type is in the local Tag Type list - true or false.</returns>
        private bool IsTagTypeIn(TagType tagType)
        {
            bool isTagTypeIn = false;
            foreach(TagType lTagType in _tagTypeList)
            {
                if (lTagType.Tag == tagType.Tag)
                {
                    isTagTypeIn = true;
                    break;
                }
            }

            return isTagTypeIn;
        }
コード例 #7
0
ファイル: BaseInformationEntity.cs プロジェクト: ewcasas/DVTK
 void HandleStudyRelatedSeries(TagType tagType, AttributeSet sourceDataset)
 {
     DvtkData.Dimse.Attribute sourceAttribute = sourceDataset.GetAttribute(tagType.Tag);
     if (sourceAttribute == null)
     {
         sourceAttribute = new DvtkData.Dimse.Attribute();
         sourceAttribute.Tag = Tag.NUMBER_OF_STUDY_RELATED_SERIES;
         sourceAttribute.Name = "Number of Study related Series";
     }
     DvtkData.Dimse.Attribute destinationAttribute = _dataset.GetAttribute(tagType.Tag);
     if (destinationAttribute != null)
     {
         _dataset.Remove(destinationAttribute);
     }
     IntegerString str = new IntegerString();
     StringCollection colle = new StringCollection();
     colle.Add(Children.Count.ToString());
     str.Values = colle;
     System.UInt32 length = 0;
     foreach (String data in str.Values)
     {
         length += (System.UInt32)data.Length;
     }
     sourceAttribute.DicomValue = str;
     sourceAttribute.Length = length + (System.UInt32)str.Values.Count - 1;
     _dataset.Add(sourceAttribute);
 }
コード例 #8
0
 /// <summary>
 /// Searches for the specified <see cref="TagType"/> and
 /// returns the zero-based index of the first occurrence within the entire <see cref="TagTypeList"/>.
 /// </summary>
 /// <param name="value">The <see cref="TagType"/> to locate in the <see cref="TagTypeList"/>.</param>
 /// <returns>
 /// The zero-based index of the first occurrence of value within the entire <see cref="TagTypeList"/>,
 /// if found; otherwise, -1.
 /// </returns>
 public int IndexOf(TagType value)
 {
     return(List.IndexOf(value));
 }
コード例 #9
0
ファイル: BaseInformationEntity.cs プロジェクト: ewcasas/DVTK
 void HandlePatientRelatedInstances(TagType tagType, AttributeSet sourceDataset)
 {
     DvtkData.Dimse.Attribute sourceAttribute = sourceDataset.GetAttribute(tagType.Tag);
     if (sourceAttribute == null)
     {
         sourceAttribute = new DvtkData.Dimse.Attribute();
         sourceAttribute.Tag = Tag.NUMBER_OF_PATIENT_RELATED_INSTANCES;
         sourceAttribute.Name = "Number of Patient related instances";
     }
     DvtkData.Dimse.Attribute destinationAttribute = _dataset.GetAttribute(tagType.Tag);
     if (destinationAttribute != null)
     {
         _dataset.Remove(destinationAttribute);
     }
     IntegerString str = new IntegerString();
     StringCollection colle = new StringCollection();
     int noOfInstances = 0;
     for (int i = 0; i < Children.Count; i++)
     {
         for (int j = 0; j < Children[i].Children.Count; j++)
         {
             noOfInstances = noOfInstances + Children[i].Children[j].Children.Count;
         }
     }
     colle.Add(noOfInstances.ToString());
     str.Values = colle;
     System.UInt32 length = 0;
     foreach (String data in str.Values)
     {
         length += (System.UInt32)data.Length;
     }
     sourceAttribute.DicomValue = str;
     sourceAttribute.Length = length + (System.UInt32)str.Values.Count - 1;
     _dataset.Add(sourceAttribute);
 }
コード例 #10
0
ファイル: BaseInformationEntity.cs プロジェクト: ewcasas/DVTK
        void HandlePatientRelatedSeries(TagType tagType, AttributeSet sourceDataset)
        {
            DvtkData.Dimse.Attribute sourceAttribute = sourceDataset.GetAttribute(tagType.Tag);
            if (sourceAttribute == null)
            {
                sourceAttribute = new DvtkData.Dimse.Attribute();
                sourceAttribute.Tag = Tag.NUMBER_OF_PATIENT_RELATED_SERIES;
                sourceAttribute.Name = "Number of Patient related series";
            }
            DvtkData.Dimse.Attribute destinationAttribute = _dataset.GetAttribute(tagType.Tag);
            if (destinationAttribute != null)
            {
                _dataset.Remove(destinationAttribute);
            }
            IntegerString str = new IntegerString();
            StringCollection colle = new StringCollection();
            int noOfSeries = 0;
            for (int i = 0; i < Children.Count; i++)
            {
                noOfSeries = noOfSeries + Children[i].Children.Count;
            }
            colle.Add(noOfSeries.ToString());
            str.Values = colle;
            System.UInt32 length = 0;
            foreach (String data in str.Values)
            {
                length += (System.UInt32)data.Length;
            }
            sourceAttribute.DicomValue = str;
            sourceAttribute.Length = length + (System.UInt32)str.Values.Count - 1;
            _dataset.Add(sourceAttribute);

            //DvtkData.Dimse.Attribute sourceAttribute = sourceDataset.GetAttribute(tagType.Tag);
            //if (sourceAttribute != null)
            //{
            //    // if an entry already exists - remove it
            //    DvtkData.Dimse.Attribute destinationAttribute = _dataset.GetAttribute(tagType.Tag);
            //    if (destinationAttribute != null)
            //    {
            //        _dataset.Remove(destinationAttribute);
            //    }
            //    if (destinationAttribute != null && destinationAttribute.Tag == Tag.NUMBER_OF_PATIENT_RELATED_STUDIES)
            //    {
            //        IntegerString str = new IntegerString();
            //        StringCollection colle = new StringCollection();
            //        int noOfSeries = 0;
            //        for (int i = 0; i < Children.Count; i++)
            //        {
            //            noOfSeries = noOfSeries + Children[i].Children.Count;
            //        }

            //        colle.Add(noOfSeries.ToString());
            //        str.Values = colle;
            //        System.UInt32 length = 0;
            //        foreach (String data in str.Values)
            //        {
            //            length += (System.UInt32)data.Length;
            //        }
            //        sourceAttribute.Length = length + (System.UInt32)str.Values.Count - 1;
            //    }
            //    _dataset.Add(sourceAttribute);
            //}
            //else
            //{
            //    sourceAttribute = new DvtkData.Dimse.Attribute();
            //    sourceAttribute.Tag = Tag.NUMBER_OF_PATIENT_RELATED_STUDIES;
            //    sourceAttribute.Name = "Number of Patient related series";
            //    DvtkData.Dimse.Attribute destinationAttribute = _dataset.GetAttribute(tagType.Tag);
            //    StringCollection values = null;
            //    if (destinationAttribute != null)
            //    {
            //        _dataset.Remove(destinationAttribute);
            //    }
            //    values = new StringCollection();
            //    int noOfSeries = 0;
            //    for (int i = 0; i < Children.Count; i++)
            //    {
            //        noOfSeries = noOfSeries + Children[i].Children.Count;
            //    }
            //    values.Add(noOfSeries.ToString());

            //    IntegerString IS = new IntegerString();
            //    IS.Values = values;
            //    sourceAttribute.DicomValue = IS;
            //    System.UInt32 length = 0;
            //    foreach (String data in IS.Values)
            //    {
            //        length += (System.UInt32)data.Length;
            //    }
            //    sourceAttribute.Length = length + (System.UInt32)IS.Values.Count - 1;
            //    _dataset.Add(sourceAttribute);
            //}
        }
コード例 #11
0
 /// <summary>
 /// Determines whether the <see cref="TagTypeList"/> contains a specific element.
 /// </summary>
 /// <param name="value">The <see cref="TagType"/> to locate in the <see cref="TagTypeList"/>.</param>
 /// <returns>
 /// <c>true</c> if the <see cref="TagTypeList"/> contains the specified value;
 /// otherwise, <c>false</c>.
 /// </returns>
 public bool Contains(TagType value)
 {
     // If value is not of type Code, this will return false.
     return(List.Contains(value));
 }
コード例 #12
0
 /// <summary>
 /// Removes the first occurrence of a specific <see cref="TagType"/> from the <see cref="TagTypeList"/>.
 /// </summary>
 /// <param name="value">The <see cref="TagType"/> to remove from the <see cref="TagTypeList"/>.</param>
 public void Remove(TagType value)
 {
     List.Remove(value);
 }
コード例 #13
0
 /// <summary>
 /// Inserts an <see cref="TagType"/> element into the <see cref="TagType"/> at the specified index.
 /// </summary>
 /// <param name="index">The zero-based index at which value should be inserted.</param>
 /// <param name="value">The <see cref="TagTypeList"/> to insert.</param>
 public void Insert(int index, TagType value)
 {
     List.Insert(index, value);
 }
コード例 #14
0
ファイル: TagTypeList.cs プロジェクト: ewcasas/DVTK
 /// <summary>
 /// Determines whether the <see cref="TagTypeList"/> contains a specific element.
 /// </summary>
 /// <param name="value">The <see cref="TagType"/> to locate in the <see cref="TagTypeList"/>.</param>
 /// <returns>
 /// <c>true</c> if the <see cref="TagTypeList"/> contains the specified value; 
 /// otherwise, <c>false</c>.
 /// </returns>
 public bool Contains(TagType value)
 {
     // If value is not of type Code, this will return false.
     return (List.Contains(value));
 }
コード例 #15
0
ファイル: BaseInformationEntity.cs プロジェクト: ewcasas/DVTK
        private bool IsTagFoundInChildren(BaseInformationEntity infoEntity, TagType tag)
        {
            if(infoEntity.Children ==null||infoEntity.Children.Count==0)
            {
                return false;
            }
            for (int i = 0; i < infoEntity.Children.Count; i++)
            {
                if (IsTagFoundInChildren(infoEntity.Children[i], tag))
                    return true;
                foreach (TagType actTag in infoEntity.Children[i].TagTypeList)
                {
                    if (actTag.Tag.ElementNumber == tag.Tag.ElementNumber &&
                        actTag.Tag.GroupNumber == tag.Tag.GroupNumber
                        )
                    {
                        return true;
                    }

                }
            }
                return false;
        }
コード例 #16
0
ファイル: TagTypeList.cs プロジェクト: ewcasas/DVTK
 /// <summary>
 /// Copies the elements of the <see cref="ICollection"/> to a strong-typed <c>TagType[]</c>, 
 /// starting at a particular <c>TagType[]</c> index.
 /// </summary>
 /// <param name="array">
 /// The one-dimensional <c>TagType[]</c> that is the destination of the elements 
 /// copied from <see cref="ICollection"/>.
 /// The <c>TagType[]</c> must have zero-based indexing. 
 /// </param>
 /// <param name="index">
 /// The zero-based index in array at which copying begins.
 /// </param>
 /// <remarks>
 /// Provides the strongly typed member for <see cref="ICollection"/>.
 /// </remarks>
 public void CopyTo(TagType[] array, int index)
 {
     ((ICollection)this).CopyTo(array, index);
 }
コード例 #17
0
 /// <summary>
 /// Adds an object to the end of the <see cref="TagTypeList"/>.
 /// </summary>
 /// <param name="value">The <see cref="TagType"/> to be added to the end of the <see cref="TagTypeList"/>.</param>
 /// <returns>The <see cref="TagTypeList"/> index at which the value has been added.</returns>
 public int Add(TagType value)
 {
     return(List.Add(value));
 }