コード例 #1
0
ファイル: PatientNode.cs プロジェクト: hksonngan/Xian
 /// <summary>
 /// Constructs a new <see cref="PatientNode"/> using actual values from attributes in the given <see cref="DicomAttributeCollection"/>.
 /// </summary>
 /// <param name="dicomDataSet">The data set from which to initialize this node.</param>
 public PatientNode(DicomAttributeCollection dicomDataSet)
 {
     _studies   = new StudyNodeCollection(this);
     _patientId = dicomDataSet[DicomTags.PatientId].GetString(0, "");
     _name      = dicomDataSet[DicomTags.PatientsName].GetString(0, "");
     _birthdate = DicomConverter.GetDateTime(dicomDataSet[DicomTags.PatientsBirthDate].GetDateTime(0), dicomDataSet[DicomTags.PatientsBirthTime].GetDateTime(0));
     _sex       = DicomConverter.GetSex(dicomDataSet[DicomTags.PatientsSex].GetString(0, ""));
 }
コード例 #2
0
ファイル: PatientNode.cs プロジェクト: hksonngan/Xian
        /// <summary>
        /// Writes the data in this node into the given <see cref="DicomAttributeCollection"/>
        /// </summary>
        /// <param name="dicomDataSet">The data set to write data into.</param>
        internal void Update(DicomAttributeCollection dicomDataSet)
        {
            dicomDataSet[DicomTags.PatientId].SetStringValue(_patientId);
            dicomDataSet[DicomTags.PatientsName].SetStringValue(_name);
            dicomDataSet[DicomTags.PatientsSex].SetStringValue(DicomConverter.SetSex(_sex));

            DicomConverter.SetDate(dicomDataSet[DicomTags.PatientsBirthDate], _birthdate);
            DicomConverter.SetTime(dicomDataSet[DicomTags.PatientsBirthTime], _birthdate);
        }
コード例 #3
0
ファイル: SeriesNode.cs プロジェクト: scottshea/monodicom
        /// <summary>
        /// Writes the data in this node into the given <see cref="DicomAttributeCollection"/>.
        /// </summary>
        /// <param name="dicomDataSet">The data set to write data into.</param>
        /// <param name="writeUid"></param>
        internal void Update(DicomAttributeCollection dicomDataSet, bool writeUid)
        {
            dicomDataSet[DicomTags.SeriesDescription].SetStringValue(_description);
            DicomConverter.SetDate(dicomDataSet[DicomTags.SeriesDate], _dateTime);
            DicomConverter.SetTime(dicomDataSet[DicomTags.SeriesTime], _dateTime);
            DicomConverter.SetInt32(dicomDataSet[DicomTags.SeriesNumber], _seriesNum);

            if (writeUid)
            {
                dicomDataSet[DicomTags.SeriesInstanceUid].SetStringValue(_instanceUid);
            }
        }
コード例 #4
0
ファイル: SeriesNode.cs プロジェクト: scottshea/monodicom
 /// <summary>
 /// Constructs a new <see cref="SeriesNode"/> using actual values from attributes from the given <see cref="DicomAttributeCollection"/>.
 /// </summary>
 /// <param name="dicomDataSet">The data set from which to initialize this node.</param>
 public SeriesNode(DicomAttributeCollection dicomDataSet)
 {
     _images      = new SopInstanceNodeCollection(this);
     _description = dicomDataSet[DicomTags.SeriesDescription].GetString(0, "");
     _dateTime    =
         DicomConverter.GetDateTime(dicomDataSet[DicomTags.SeriesDate].GetDateTime(0),
                                    dicomDataSet[DicomTags.SeriesTime].GetDateTime(0));
     _instanceUid = dicomDataSet[DicomTags.SeriesInstanceUid].GetString(0, "");
     if (_instanceUid == "")
     {
         _instanceUid = StudyBuilder.NewUid();
     }
 }
コード例 #5
0
ファイル: StudyNode.cs プロジェクト: hksonngan/Xian
 /// <summary>
 /// Constructs a new <see cref="StudyNode"/> using actual values from attributes in the given <see cref="DicomAttributeCollection"/>.
 /// </summary>
 /// <param name="dicomDataSet">The data set from which to initialize this node.</param>
 public StudyNode(DicomAttributeCollection dicomDataSet)
 {
     _series       = new SeriesNodeCollection(this);
     _studyId      = dicomDataSet[DicomTags.StudyId].GetString(0, "");
     _description  = dicomDataSet[DicomTags.StudyDescription].GetString(0, "");
     _dateTime     = DicomConverter.GetDateTime(dicomDataSet[DicomTags.StudyDate].GetDateTime(0), dicomDataSet[DicomTags.StudyTime].GetDateTime(0));
     _accessionNum = dicomDataSet[DicomTags.AccessionNumber].GetString(0, "");
     _instanceUid  = dicomDataSet[DicomTags.StudyInstanceUid].GetString(0, "");
     if (_instanceUid == "")
     {
         _instanceUid = StudyBuilder.NewUid();
     }
 }
コード例 #6
0
ファイル: StudyNode.cs プロジェクト: hksonngan/Xian
        /// <summary>
        /// Writes the data in this node into the given <see cref="DicomAttributeCollection"/>
        /// </summary>
        /// <param name="dicomDataSet">The data set to write data into.</param>
        internal void Update(DicomAttributeCollection dicomDataSet, bool writeUid)
        {
            dicomDataSet[DicomTags.StudyId].SetStringValue(_studyId);
            dicomDataSet[DicomTags.StudyDescription].SetStringValue(_description);
            dicomDataSet[DicomTags.AccessionNumber].SetStringValue(_accessionNum);

            DicomConverter.SetDate(dicomDataSet[DicomTags.StudyDate], _dateTime);
            DicomConverter.SetTime(dicomDataSet[DicomTags.StudyTime], _dateTime);

            if (writeUid)
            {
                dicomDataSet[DicomTags.StudyInstanceUid].SetStringValue(_instanceUid);
            }
        }
コード例 #7
0
        /// <summary>
        /// Writes the data in this node into the given <see cref="DicomAttributeCollection"/>.
        /// </summary>
        /// <param name="dataSet">The data set to write data into.</param>
        /// <param name="writeUid"></param>
        internal void Update(DicomAttributeCollection dataSet, bool writeUid)
        {
            int imageNumber = 0;

            if (this.Parent != null)
            {
                imageNumber = this.Parent.Images.IndexOf(this) + 1;
            }

            DicomConverter.SetInt32(dataSet[DicomTags.InstanceNumber], imageNumber);

            if (writeUid)
            {
                dataSet[DicomTags.SopInstanceUid].SetStringValue(_instanceUid);
            }
        }