/DICOM/DicomItem.cs
https://github.com/petnet/fo-dicom · C# · 39 lines · 29 code · 7 blank · 3 comment · 3 complexity · 34c30bade94a0041e44a6bfe63506cc1 MD5 · raw file
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using Dicom.IO;
- namespace Dicom {
- public abstract class DicomItem : IComparable<DicomItem>, IComparable {
- protected DicomItem(DicomTag tag) {
- Tag = tag;
- //DicomDictionaryEntry entry = DicomDictionary.Default[Tag];
- //if (entry != null && !entry.ValueRepresentations.Contains(ValueRepresentation))
- // throw new DicomDataException("{0} is not a valid value representation for {1}", ValueRepresentation, Tag);
- }
- public DicomTag Tag {
- get;
- protected set;
- }
- public abstract DicomVR ValueRepresentation {
- get;
- }
- public int CompareTo(DicomItem other) {
- return Tag.CompareTo(other.Tag);
- }
- public int CompareTo(object obj) {
- if (obj == null)
- throw new ArgumentNullException("obj");
- if (!(obj is DicomItem))
- throw new ArgumentException("Passed non-DicomItem to comparer", "obj");
- return CompareTo(obj as DicomItem);
- }
- }
- }