コード例 #1
0
        public DicomContentItem(DicomCodeItem code, DicomRelationship relationship, DicomValueType type, DateTime value)
        {
            Dataset      = new DicomDataset();
            Code         = code;
            Relationship = relationship;
            Type         = type;

            if (type == DicomValueType.Date)
            {
                Dataset.Add(DicomTag.Date, value);
            }
            else if (type == DicomValueType.Time)
            {
                Dataset.Add(DicomTag.Time, value);
            }
            else if (type == DicomValueType.DateTime)
            {
                Dataset.Add(DicomTag.DateTime, value);
            }
            else
            {
                throw new DicomStructuredReportException(
                          "Type of DateTime is not the correct value type for {0} content item.",
                          type);
            }
        }
コード例 #2
0
ファイル: DicomContentItem.cs プロジェクト: zcr01/fo-dicom
 public DicomContentItem Add(
     DicomCodeItem code,
     DicomRelationship relationship,
     DicomValueType type,
     DicomReferencedSOP value)
 {
     return(Add(new DicomContentItem(code, relationship, type, value)));
 }
コード例 #3
0
ファイル: DicomContentItem.cs プロジェクト: zcr01/fo-dicom
 public DicomContentItem Add(
     DicomCodeItem code,
     DicomRelationship relationship,
     DicomContinuity continuity,
     params DicomContentItem[] items)
 {
     return(Add(new DicomContentItem(code, relationship, continuity, items)));
 }
コード例 #4
0
        public DicomContentItem(DicomCodeItem code, DicomRelationship relationship, DicomMeasuredValue value)
        {
            Dataset      = new DicomDataset();
            Code         = code;
            Relationship = relationship;
            Type         = DicomValueType.Numeric;

            Dataset.Add(DicomTag.MeasuredValueSequence, value);
        }
コード例 #5
0
        public DicomContentItem(DicomCodeItem code, DicomRelationship relationship, DicomCodeItem value)
        {
            Dataset      = new DicomDataset();
            Code         = code;
            Relationship = relationship;
            Type         = DicomValueType.Code;

            Dataset.Add(DicomTag.ConceptCodeSequence, value);
        }
コード例 #6
0
        public DicomContentItem(DicomCodeItem code, DicomRelationship relationship, DicomUID value)
        {
            Dataset      = new DicomDataset();
            Code         = code;
            Relationship = relationship;
            Type         = DicomValueType.UIDReference;

            Dataset.Add(DicomTag.UID, value);
        }
コード例 #7
0
        public DicomContentItem(DicomCodeItem code, DicomRelationshipType relationship, DicomContinuity continuity, params DicomContentItem[] items)
        {
            Dataset      = new DicomDataset();
            Code         = code;
            Relationship = relationship;
            Type         = DicomValueType.Container;
            Continuity   = continuity;

            Dataset.Add(DicomTag.ContentSequence, items);
        }
コード例 #8
0
ファイル: DicomContentItem.cs プロジェクト: zcr01/fo-dicom
        public T Get <T>(DicomCodeItem code, T defaultValue)
        {
            var item = Children().FirstOrDefault(x => x.Code == code);

            if (item == null)
            {
                return(default(T));
            }

            if (typeof(T) == typeof(DicomContentItem))
            {
                return((T)(object)item);
            }

            return(item.Get <T>());
        }
コード例 #9
0
        public DicomContentItem(DicomCodeItem code, DicomRelationshipType relationship, DicomValueType type, DicomReferencedSOP value)
        {
            Dataset      = new DicomDataset();
            Code         = code;
            Relationship = relationship;
            Type         = type;

            if (type == DicomValueType.Composite || type == DicomValueType.Image || type == DicomValueType.Waveform)
            {
                Dataset.Add(DicomTag.ReferencedSOPSequence, value);
            }
            else
            {
                throw new DicomStructuredReportException("Type of DicomReferencedSOP is not the correct value type for {0} content item.", type);
            }
        }
コード例 #10
0
        public DicomContentItem(DicomCodeItem code, DicomRelationshipType relationship, DicomValueType type, string value)
        {
            Dataset      = new DicomDataset();
            Code         = code;
            Relationship = relationship;
            Type         = type;

            if (type == DicomValueType.Text)
            {
                Dataset.Add(DicomTag.TextValue, value);
            }
            else if (type == DicomValueType.PersonName)
            {
                Dataset.Add(DicomTag.PersonName, value);
            }
            else
            {
                throw new DicomStructuredReportException("Type of string is not the correct value type for {0} content item.", type);
            }
        }
コード例 #11
0
 public DicomStructuredReport(DicomCodeItem code, params DicomContentItem[] items) : base(code, DicomRelationshipType.Contains, DicomContinuity.Separate, items)
 {
     // relationship type is not needed for root element
     Dataset.Remove(DicomTag.RelationshipType);
 }
コード例 #12
0
ファイル: DicomContentItem.cs プロジェクト: zcr01/fo-dicom
 public DicomContentItem Add(DicomCodeItem code, DicomRelationship relationship, DicomMeasuredValue value)
 {
     return(Add(new DicomContentItem(code, relationship, value)));
 }
コード例 #13
0
 public DicomMeasuredValue(decimal value, DicomCodeItem units)
 {
     Add(DicomTag.NumericValue, value);
     Add(new DicomSequence(DicomTag.MeasurementUnitsCodeSequence, units));
 }
コード例 #14
0
		public DicomMeasuredValue(decimal value, DicomCodeItem units) {
			Add(DicomTag.NumericValue, value);
			Add(new DicomSequence(DicomTag.MeasurementUnitsCodeSequence, units));
		}
コード例 #15
0
		public DicomStructuredReport(DicomCodeItem code, params DicomContentItem[] items) : base(code, DicomRelationship.Contains, DicomContinuity.Separate, items) {
			// relationship type is not needed for root element
			Dataset.Remove(DicomTag.RelationshipType);
		}