public DatabaseQueryTransformRule(string connectionString, DatabaseType dbType, string query, DicomTag[] outputTags, DicomTag[] paramTags) {
     _connectionString = connectionString;
     _dbType = dbType;
     _query = query;
     _output = new List<DicomTag>(outputTags);
     _params = new List<DicomTag>(paramTags);
 }
示例#2
0
        private void ReadBulkData
        (
            fo.DicomTag tag,
            fo.DicomVR vr,
            JsonTextReader reader,
            fo.DicomDataset dataset,
            int level
        )
        {
            fo.IO.Buffer.BulkDataUriByteBuffer data = null;


            if (reader.Read( ))
            {
                string uri = (string)reader.Value;


                if (!string.IsNullOrEmpty(uri))
                {
                    data = new fo.IO.Buffer.BulkDataUriByteBuffer(uri);
                }

                if (tag == fo.DicomTag.PixelData && level == 0)
                {
                    dataset.AddOrUpdatePixelData(vr, data, fo.DicomTransferSyntax.Parse(TransferSyntaxUID));
                }
                else
                {
                    dataset.AddOrUpdate <fo.IO.Buffer.IByteBuffer> (vr, tag, data);
                }
            }
        }
示例#3
0
        private void ReadInlineBinary
        (
            fo.DicomTag tag,
            fo.DicomVR vr,
            JsonTextReader reader,
            fo.DicomDataset dataset,
            int level
        )
        {
            if (reader.Read( ))
            {
                fo.IO.Buffer.MemoryByteBuffer buffer = null;
                byte[] data   = new byte[0];
                string base64 = (string)reader.Value;


                if (!string.IsNullOrEmpty(base64))
                {
                    buffer = new fo.IO.Buffer.MemoryByteBuffer(System.Convert.FromBase64String(base64));
                }

                if (tag == fo.DicomTag.PixelData && level == 0)
                {
                    dataset.AddOrUpdatePixelData(vr, buffer, fo.DicomTransferSyntax.Parse(TransferSyntaxUID));
                }
                else
                {
                    dataset.AddOrUpdate <fo.IO.Buffer.IByteBuffer> (vr, tag, buffer);
                }
            }
        }
示例#4
0
        protected virtual void ReadVr_SQ(JsonTextReader reader, fo.DicomTag tag, fo.DicomDataset dataset, int level)
        {
            fo.DicomSequence seq = new fo.DicomSequence(tag, new fo.DicomDataset[0]);


            if (reader.Value as string == JsonConstants.ValueField)
            {
                while (reader.Read( ) && reader.TokenType == JsonToken.StartArray)
                {
                    while (reader.Read( ) && reader.TokenType != JsonToken.EndArray)
                    {
                        fo.DicomDataset itemDs = new fo.DicomDataset( );

                        ReadChildren(reader, itemDs, ++level);

                        --level;

                        seq.Items.Add(itemDs);
                    }

                    break;
                }
            }

            dataset.AddOrUpdate(seq);
        }
示例#5
0
        private void ReadSequence
        (
            fo.DicomDataset ds,
            XElement element,
            fo.DicomTag tag,
            int level
        )
        {
            fo.DicomSequence seq = new fo.DicomSequence(tag, new fo.DicomDataset[0]);


            foreach (var item in  element.Elements(Constants.ATTRIBUTE_ITEM_NAME))
            {
                fo.DicomDataset itemDs = new fo.DicomDataset( );

                level++;

                ReadChildren(itemDs, item, level);

                level--;

                seq.Items.Add(itemDs);
            }

            ds.AddOrUpdate(seq);
        }
示例#6
0
        private void DoSearch(string directoryToSearch)
        {
            IEnumerable <string> filenames = new List <string>();

            try
            {
                filenames = Directory.EnumerateFiles(directoryToSearch, "*.dcm", SearchOption.AllDirectories);
            }
            catch (DirectoryNotFoundException)
            {
                string errorMsg = $"Error: directory {directoryToSearch} not found.";
                UpdateStatus(lblStatusMessage, StatusCode.Error, errorMsg);
                return;
            }

            Dicom.DicomTag tag1 = tagInput1.Get();
            Dicom.DicomTag tag2 = tagInput2.Get();
            Dicom.DicomTag tag3 = tagInput3.Get();
            foreach (string filename in filenames)
            {
                //TODO!~ Use OpenAsync instead of Open.
                //TODO!+ If the file is not a DICOM file, DicomFile.Open (and DicomFile.OpenAsync) throws an Exception.
                // We catch that Exception. But if we're using Async, we should add  a "finally" to deal with this.

                try
                {
                    Dicom.DicomFile dicomFile = Dicom.DicomFile.Open(filename, Dicom.FileReadOption.Default); //TODO?~ Make sure we ONLY read the tags! Dicom.FileReadOption comes in here.

                    bool noTagsSpecified = (tag1 == null && tag2 == null && tag3 == null);

                    bool tag1Present = tag1 != null && dicomFile.Dataset.Contains(tag1);
                    bool tag2Present = tag2 != null && dicomFile.Dataset.Contains(tag2);
                    bool tag3Present = tag3 != null && dicomFile.Dataset.Contains(tag3);

                    //TODO!+ Adding stuff for finding a file based on SOP Class UID - DICOM Tag (0008,0016).
                    //TODO!~ Use the Tag's Value Representation to determine the type of the returned value.
                    if (tag1 != null)
                    {
                        object val1 = dicomFile.Dataset.GetValue <object>(tag1, 0);
                    }

                    if (noTagsSpecified || tag1Present || tag2Present || tag3Present)
                    {
                        tbSearchResults.Invoke((MethodInvoker) delegate
                        {
                            tbSearchResults.Text += (filename + Environment.NewLine);
                        });
                    }
                }
                catch (DicomFileException)
                {
                    string errMsg = $"Error: tried to open a file that was not a DICOM file.";
                    UpdateStatus(lblStatusMessage, StatusCode.Error, errMsg);
                }
            }
        }
示例#7
0
        /// <summary>
        /// Get a composite <see cref="DateTime"/> instance based on <paramref name="date"/> and <paramref name="time"/> values.
        /// </summary>
        /// <param name="dataset">Dataset from which data should be retrieved.</param>
        /// <param name="date">Tag associated with date value.</param>
        /// <param name="time">Tag associated with time value.</param>
        /// <returns>Composite <see cref="DateTime"/>.</returns>
        public static DateTime GetDateTime(this DicomDataset dataset, DicomTag date, DicomTag time)
        {
            var dd = dataset.Contains(date) ? dataset.Get<DicomDate>(date) : null;
            var dt = dataset.Contains(time) ? dataset.Get<DicomTime>(time) : null;

            var da = dd != null && dd.Count > 0 ? dd.Get<DateTime>(0) : DateTime.MinValue;
            var tm = dt != null && dt.Count > 0 ? dt.Get<DateTime>(0) : DateTime.MinValue;

            return new DateTime(da.Year, da.Month, da.Day, tm.Hour, tm.Minute, tm.Second);
        }
示例#8
0
        public string GetTableName(fo.DicomTag tag)
        {
            IList <ColumnInfo> columns = null;

            if (SchemaSource.Tags.TryGetValue((uint)tag, out columns))
            {
                return(columns.FirstOrDefault( ).Table.Name);
            }

            return(null);
        }
    public void AddTagAndReadOut()
    {
      var dict = new DicomDictionary();

      var tag = new DicomTag(0x0010, 0x0020);
      var dictEntry = new DicomDictionaryEntry(tag, "TestTagName", "TestTagKeyword", DicomVM.VM_1, false, DicomVR.DT);

      dict.Add(dictEntry);

      Assert.Equal(dictEntry, dict[tag]);
    }
示例#10
0
 public bool containsTag(Dicom.DicomTag tag)
 {
     foreach (var dicom in DicomFiles)
     {
         if (dicom.Dataset.Contains(tag))
         {
             return(true);
         }
     }
     return(false);
 }
示例#11
0
        public void Add_MultiVMStringTags_YieldsMultipleValues(DicomTag tag, string[] values, Type expectedType)
        {
            var dataset = new DicomDataset();
            dataset.Add(tag, values);

            Assert.IsType(expectedType, dataset.First(item => item.Tag.Equals(tag)));

            var data = dataset.Get<string[]>(tag);
            Assert.Equal(values.Length, data.Length);
            Assert.Equal(values.Last(), data.Last());
        }
 public void ToJsonStringTest()
 {
     const ushort @group = 0x7FE0;
     const ushort element = 0x00FF;
     var target = new DicomTag(group, element);
     const string format = "J";
     IFormatProvider formatProvider = null;
     const string expected = "7FE000FF";
     string actual = string.Empty;
     actual = target.ToString(format, formatProvider);
     Assert.Equal(expected, actual);
 }
示例#13
0
 private static bool tryGetImageDateTime(DicomTag dateTag, DicomTag timeTag, DicomDataset dataset, 
         ref DateTime imageDate, ref DateTime imageTime)
 {
     var dateValue = dataset.Get<DateTime>(dateTag);
     var result = dateValue > DateTime.MinValue;
     if (result)
     {
         imageDate = dateValue;
         imageTime = dataset.Get<DateTime>(timeTag);
     }
     return result;
 }
示例#14
0
 public static string GetCorrectedString(this DicomDataset dataset, ServerOptions serverOptions, DicomTag dicomTag)
 {
     var result = dataset.Get<string>(dicomTag);
     if (serverOptions.Codepage > 0)
     {
         var dicomItem = dataset.FirstOrDefault(x => x.Tag == dicomTag);
         var bytes = ((DicomElement)dicomItem).Buffer.Data;
         result = Encoding.GetEncoding(serverOptions.Codepage).GetString(bytes);
         result = result.Replace('^', ' ');
     }
     return result;
 }
示例#15
0
        public static DateTime GetDateTime(this DicomDataset dataset, DicomTag date, DicomTag time)
        {
            DicomDate dd = dataset.Get<DicomDate>(date);
            DicomTime dt = dataset.Get<DicomTime>(time);

            DateTime da = DateTime.Today;
            if (dd != null && dd.Count > 0) da = dd.Get<DateTime>(0);

            DateTime tm = DateTime.Today;
            if (dt != null && dt.Count > 0) tm = dt.Get<DateTime>(0);

            return new DateTime(da.Year, da.Month, da.Day, tm.Hour, tm.Minute, tm.Second);
        }
示例#16
0
        protected virtual void ReadDicomItem
        (
            JsonTextReader reader,
            fo.DicomTag tag,
            fo.DicomDataset dataset,
            int level
        )
        {
            var vr = tag.DictionaryEntry.ValueRepresentations.FirstOrDefault( );

            while (reader.Read( ) && reader.TokenType == JsonToken.PropertyName)
            {
                string propertyValue = (string)reader.Value;

                switch (propertyValue)
                {
                case JsonConstants.VrField:
                {
                    reader.Read( );

                    vr = fo.DicomVR.Parse((string)reader.Value);
                }
                break;

                case JsonConstants.ValueField:
                {
                    ReadDefaultVr(tag, vr, reader, dataset, level);
                }
                break;

                case JsonConstants.ELEMENT_BULKDATA:
                {
                    ReadBulkData(tag, vr, reader, dataset, level);
                }
                break;

                case JsonConstants.ELEMENT_INLINEBINARY:
                {
                    ReadInlineBinary(tag, vr, reader, dataset, level);
                }
                break;

                default:
                {
                    reader.Skip( );
                }
                break;
                }
            }
        }
示例#17
0
        protected virtual void ReadDefaultVr
        (
            fo.DicomTag tag,
            fo.DicomVR vr,
            JsonTextReader reader,
            fo.DicomDataset dataset,
            int level
        )
        {
            //if VR was the first property we already read the right thing above,
            //otherwise we'll got it from the dictionary. Could it be defined after the value?
            switch (vr.Code)
            {
            case fo.DicomVRCode.SQ:
            {
                ReadVr_SQ(reader, tag, dataset, level);
            }
            break;

            case fo.DicomVRCode.PN:
            {
                ReadVr_PN(reader, tag, dataset);
            }
            break;

            default:
            {
                List <string> values = new List <string> ( );


                while (reader.Read( ) && reader.TokenType == JsonToken.StartArray)
                {
                    while (reader.Read( ) && reader.TokenType != JsonToken.EndArray)
                    {
                        values.Add(System.Convert.ToString(reader.Value));
                    }

                    break;
                }

                if (tag == fo.DicomTag.TransferSyntaxUID)
                {
                    TransferSyntaxUID = values.FirstOrDefault( );
                }

                dataset.AddOrUpdate <string> (vr, tag, values.ToArray( ));
            }
            break;
            }
        }
示例#18
0
		public DicomDictionaryEntry(DicomTag tag, string name, string keyword, DicomVM vm, bool retired, params DicomVR[] vrs) {
			Tag = tag;

			if (String.IsNullOrWhiteSpace(name))
				Name = Tag.ToString();
			else
				Name = name;

			if (String.IsNullOrWhiteSpace(keyword))
				Keyword = Name;
			else
				Keyword = keyword;

			ValueMultiplicity = vm;
			ValueRepresentations = vrs;
			IsRetired = retired;
		}
    public void EnumerateBothPublicAndPrivateEntries()
    {
      var dict = new DicomDictionary();

      var tag1 = new DicomTag(0x0010, 0x0020);
      var dictEntry1 = new DicomDictionaryEntry(tag1, "TestPublicTagName", "TestPublicTagKeyword", DicomVM.VM_1, false, DicomVR.DT);
      var privCreatorDictEntry = new DicomDictionaryEntry(new DicomTag(0x0011, 0x0010), "Private Creator", "PrivateCreator", DicomVM.VM_1, false, DicomVR.LO);
      dict.Add(privCreatorDictEntry);

      DicomPrivateCreator privateCreator = dict.GetPrivateCreator("TESTCREATOR");
      DicomDictionary privDict = dict[privateCreator];

      var dictEntry2 = new DicomDictionaryEntry(DicomMaskedTag.Parse("0011", "xx10"), "TestPrivTagName", "TestPrivTagKeyword", DicomVM.VM_1, false, DicomVR.DT);

      privDict.Add(dictEntry2);
      dict.Add(dictEntry1);

      Assert.True(dict.Contains(dictEntry1));
      Assert.True(dict.Contains(privCreatorDictEntry));
      Assert.True(dict[dictEntry2.Tag.PrivateCreator].Contains(dictEntry2));
      Assert.True(dict.PrivateCreators.Any(pc => dict[pc].Contains(dictEntry2)));
    }
示例#20
0
        protected virtual void ReadVr_PN(JsonTextReader reader, fo.DicomTag tag, fo.DicomDataset dataset)
        {
            List <string> pnNames = new List <string> ( );


            while (reader.Read( ) && reader.TokenType == JsonToken.StartArray)
            {
                PersonNameValue personName = new PersonNameValue( );


                //keep reading until reach end of array
                while (reader.Read( ) && reader.TokenType != JsonToken.EndArray)
                {
                    PersonNameReader pnReader = new PersonNameReader( );


                    while (reader.Read( ) && reader.TokenType == JsonToken.PropertyName)
                    {
                        string componentName = (string)reader.Value;
                        string component     = "";


                        if (reader.Read( ))
                        {
                            component = (string)reader.Value;
                        }

                        pnReader.Add(componentName, component);
                    }

                    personName.Add(pnReader);
                }

                dataset.AddOrUpdate <string> (tag, personName.ToString( ));

                break;
            }
        }
示例#21
0
 private fo.DicomUniqueIdentifier GetUidElement(fo.DicomTag tag, string uid)
 {
     return(new fo.DicomUniqueIdentifier(tag, uid));
 }
示例#22
0
        private void ReadElement
        (
            fo.DicomDataset ds,
            XElement element,
            fo.DicomTag tag,
            fo.DicomVR dicomVr,
            int level
        )
        {
            if (dicomVr == fo.DicomVR.PN)
            {
                string personNameValue = "";

                foreach (var personNameElementValue in element.Elements( ).OrderBy(n => n.Attribute(Constants.ATTRIBUTE_NUMBER)))
                {
                    foreach (var personNameComponent in personNameElementValue.Elements( ))
                    {
                        if (personNameComponent.Name == Utilities.PersonNameComponents.PN_COMP_ALPHABETIC ||
                            personNameComponent.Name == Utilities.PersonNameComponents.PN_COMP_IDEOGRAPHIC ||
                            personNameComponent.Name == Utilities.PersonNameComponents.PN_COMP_PHONETIC)
                        {
                            personNameValue = UpdatePersonName(personNameValue, personNameComponent, Utilities.PersonNameParts.PN_Family);
                            personNameValue = UpdatePersonName(personNameValue, personNameComponent, Utilities.PersonNameParts.PN_Given);
                            personNameValue = UpdatePersonName(personNameValue, personNameComponent, Utilities.PersonNameParts.PN_Midlle);
                            personNameValue = UpdatePersonName(personNameValue, personNameComponent, Utilities.PersonNameParts.PN_Prefix);
                            personNameValue = UpdatePersonName(personNameValue, personNameComponent, Utilities.PersonNameParts.PN_Suffix, true);

                            personNameValue = personNameValue.TrimEnd('^');    // extra cleanup

                            personNameValue += "=";
                        }
                    }

                    personNameValue = personNameValue.TrimEnd('=');

                    personNameValue += "\\";
                }

                personNameValue = personNameValue.TrimEnd('\\');
                ds.AddOrUpdate <string> (dicomVr, tag, personNameValue);
            }
            else if (Utilities.IsBinaryVR(dicomVr))
            {
                var dataElement = element.Elements( ).OfType <XElement> ( ).FirstOrDefault( );

                if (null != dataElement)
                {
                    fo.IO.Buffer.IByteBuffer data;


                    if (dataElement.Name == Constants.ELEMENT_BULKDATA)
                    {
                        string uri = dataElement.Attribute(Constants.ATTRIBUTE_BULKDATAURI).Value;


                        data = new fo.IO.Buffer.BulkDataUriByteBuffer(uri);
                    }
                    else
                    {
                        var base64 = System.Convert.FromBase64String(dataElement.Value);


                        data = new fo.IO.Buffer.MemoryByteBuffer(base64);
                    }

                    if (tag == fo.DicomTag.PixelData && level == 0)
                    {
                        ds.AddOrUpdatePixelData(dicomVr, data, TransferSyntax);
                    }
                    else
                    {
                        ds.AddOrUpdate <fo.IO.Buffer.IByteBuffer> (dicomVr, tag, data);
                    }
                }
            }
            else
            {
                var values = ReadValue(element);

                if (tag == fo.DicomTag.TransferSyntaxUID)
                {
                    TransferSyntax = fo.DicomTransferSyntax.Parse(values.FirstOrDefault( ));
                }

                ds.AddOrUpdate <string> (dicomVr, tag, values.ToArray( ));
            }
        }
 public void ToJson()
 {
     var target = new DicomTag(0x7fe0, 0x00ff);
     Console.WriteLine(JsonConvert.SerializeObject(target, Formatting.Indented));
 }
示例#24
0
 public ToLowerDicomTransformRule(DicomTag tag)
 {
     _tag = tag;
 }
示例#25
0
 public void Constructor_NoExplicitLoading_TagsNotFound(DicomTag tag)
 {
     var dict = new DicomDictionary();
     var actual = dict[tag];
     Assert.Equal(DicomDictionary.UnknownTag, actual);
 }
示例#26
0
		public TrimCharactersDicomTransformRule(DicomTag tag, DicomTrimPosition position, char[] trim) {
			_tag = tag;
			_trim = trim;
			_position = position;
		}
 public DicomMaskedTag(DicomTag tag)
 {
     Tag  = tag;
     Mask = FullMask;
 }
示例#28
0
		public TrimStringDicomTransformRule(DicomTag tag, DicomTrimPosition position, string trim) {
			_tag = tag;
			_trim = trim;
			_position = position;
		}
示例#29
0
		public TrimCharactersDicomTransformRule(DicomTag tag, DicomTrimPosition position) {
			_tag = tag;
			_trim = null;
			_position = position;
		}
示例#30
0
		public AppendDicomTransformRule(DicomTag tag, string append) {
			_tag = tag;
			_append = append;
		}
示例#31
0
        private void DoSearch(string directoryToSearch)
        {
            IEnumerable <string> filenames = new List <string>();

            try
            {
                filenames = Directory.EnumerateFiles(directoryToSearch, "*.dcm", SearchOption.AllDirectories);
            }
            catch (DirectoryNotFoundException)
            {
                string errorMsg = $"Error: directory {directoryToSearch} not found.";
                UpdateStatus(lblStatusMessage, StatusCode.Error, errorMsg);
                return;
            }

            Dicom.DicomTag tag1 = tagInput1.Get();
            Dicom.DicomTag tag2 = tagInput2.Get();
            Dicom.DicomTag tag3 = tagInput3.Get();
            foreach (string filename in filenames)
            {
                //TODO?~ Find out why some machines insist that we install .NET Core, even though this thing is published as standalone.
                // Is our reliance on fo-dicom the reason? fo-dicom is (apparently) a PCL, does that mean it's standalone?

                //TODO!~ Use OpenAsync instead of Open.
                //TODO!+ If the file is not a DICOM file, DicomFile.Open (and DicomFile.OpenAsync) throws an Exception.
                // We catch that Exception. But if we're using Async, we should add  a "finally" to deal with this.

                try
                {
                    DicomFile dicomFile       = DicomFile.Open(filename, Dicom.FileReadOption.Default); //TODO?~ Make sure we ONLY read the tags! Dicom.FileReadOption comes in here.
                    bool      noTagsSpecified = (tag1 == null && tag2 == null && tag3 == null);

                    bool tag1Present = tag1 != null && dicomFile.Dataset.Contains(tag1);
                    bool tag2Present = tag2 != null && dicomFile.Dataset.Contains(tag2);
                    bool tag3Present = tag3 != null && dicomFile.Dataset.Contains(tag3);

                    //TODO!+ Adding stuff for finding a file based on SOP Class UID - DICOM Tag (0008,0016).
                    //TODO!~ Use the Tag's Value Representation to determine the type of the returned value.
                    bool secondaryCaptureFound = false;
                    if (tag1 != null)
                    {
                        object val1 = dicomFile.Dataset.GetValue <object>(tag1, 0);

                        //For now: just go with  strings...
                        string val1str = val1.ToString();
                        if (val1str.StartsWith("1.2.840.10008.5.1.4.1.1.7"))
                        {
                            secondaryCaptureFound = true;
                        }

                        // Also for now: just go with secondary capture.

                        /*
                         * Secondary Capture Image Storage:
                         * 1.2.840.10008.5.1.4.1.1.7
                         * Secondary Capture Image for multiframes:
                         * 1.2.840.10008.5.1.4.1.1.7.1
                         * 1.2.840.10008.5.1.4.1.1.7.2
                         * 1.2.840.10008.5.1.4.1.1.7.3
                         * 1.2.840.10008.5.1.4.1.1.7.4
                         */
                    }

                    //if (noTagsSpecified || tag1Present || tag2Present || tag3Present)
                    if (tag1Present && secondaryCaptureFound)
                    {
                        tbSearchResults.Invoke((MethodInvoker) delegate
                        {
                            tbSearchResults.Text += (filename + Environment.NewLine);
                        });
                    }
                }
                catch (DicomFileException)
                {
                    string errMsg = $"Error: tried to open a file that was not a DICOM file.";
                    UpdateStatus(lblStatusMessage, StatusCode.Error, errMsg);
                }
            }
        }
示例#32
0
 public PrefixDicomTransformRule(DicomTag tag, string prefix)
 {
     _tag    = tag;
     _prefix = prefix;
 }
示例#33
0
		public IsEmptyDicomMatchRule(DicomTag tag) {
			_tag = tag;
		}
示例#34
0
		public PadStringDicomTransformRule(DicomTag tag, int totalLength, char paddingChar) {
			_tag = tag;
			_totalLength = totalLength;
			_paddingChar = paddingChar;
		}
示例#35
0
		public EndsWithDicomMatchRule(DicomTag tag, string value) {
			_tag = tag;
			_value = value;
		}
示例#36
0
		public TruncateDicomTransformRule(DicomTag tag, int length) {
			_tag = tag;
			_length = length;
		}
 public bool IsMatch(DicomTag tag)
 {
     return(Card == ((((uint)tag.Group << 16) | (uint)tag.Element) & Mask));
 }
示例#38
0
		public SplitFormatDicomTransformRule(DicomTag tag, char[] seperators, string format) {
			_tag = tag;
			_seperators = seperators;
			_format = format;
		}
示例#39
0
 public SetValueDicomTransformRule(DicomTag tag, string value)
 {
     _tag   = tag;
     _value = value;
 }
示例#40
0
 protected DicomStringElement(DicomTag tag, Encoding encoding, IByteBuffer buffer) : base(tag, buffer)
 {
     Encoding = encoding;
 }
示例#41
0
 public void Default_Item_ExistingTag_EntryFound(DicomTag tag)
 {
     var entry = DicomDictionary.Default[tag];
     Assert.NotEqual(DicomDictionary.UnknownTag, entry);
 }
示例#42
0
 public TruncateDicomTransformRule(DicomTag tag, int length)
 {
     _tag    = tag;
     _length = length;
 }
示例#43
0
 public SplitFormatDicomTransformRule(DicomTag tag, char[] seperators, string format)
 {
     _tag        = tag;
     _seperators = seperators;
     _format     = format;
 }
示例#44
0
 public PadStringDicomTransformRule(DicomTag tag, int totalLength, char paddingChar)
 {
     _tag         = tag;
     _totalLength = totalLength;
     _paddingChar = paddingChar;
 }
示例#45
0
		public GenerateUidDicomTransformRule(DicomTag tag, DicomUIDGenerator generator = null) {
			_tag = tag;
			_generator = generator ?? new DicomUIDGenerator();
		}
示例#46
0
 public AppendDicomTransformRule(DicomTag tag, string append)
 {
     _tag    = tag;
     _append = append;
 }
示例#47
0
		public WildcardDicomMatchRule(DicomTag tag, string pattern) {
			_tag = tag;
			_pattern = pattern;
		}
示例#48
0
		public OneOfDicomMatchRule(DicomTag tag, params string[] values) {
			_tag = tag;
			_values = values;
		}
示例#49
0
 public TrimCharactersDicomTransformRule(DicomTag tag, DicomTrimPosition position, char[] trim)
 {
     _tag      = tag;
     _trim     = trim;
     _position = position;
 }
示例#50
0
 public TrimCharactersDicomTransformRule(DicomTag tag, DicomTrimPosition position)
 {
     _tag      = tag;
     _trim     = null;
     _position = position;
 }
示例#51
0
		public ExistsDicomMatchRule(DicomTag tag) {
			_tag = tag;
		}
示例#52
0
 public CopyValueDicomTransformRule(DicomTag src, DicomTag dst)
 {
     _src = src;
     _dst = dst;
 }
示例#53
0
		public EqualsDicomMatchRule(DicomTag tag, string value) {
			_tag = tag;
			_value = value;
		}
示例#54
0
 public MapValueDicomTransformRule(DicomTag tag, string match, string value)
 {
     _tag   = tag;
     _match = match;
     _value = value;
 }
示例#55
0
		public ContainsDicomMatchRule(DicomTag tag, string value) {
			_tag = tag;
			_value = value;
		}
示例#56
0
 public GenerateUidDicomTransformRule(DicomTag tag, DicomUIDGenerator generator = null)
 {
     _tag       = tag;
     _generator = generator ?? new DicomUIDGenerator();
 }
示例#57
0
		public RegexDicomMatchRule(DicomTag tag, string pattern) {
			_tag = tag;
			_pattern = pattern;
			_regex = new Regex(_pattern);
		}
示例#58
0
 public RegexDicomTransformRule(DicomTag tag, string pattern, string replacement)
 {
     _tag         = tag;
     _pattern     = pattern;
     _replacement = replacement;
 }
示例#59
0
		public ToLowerDicomTransformRule(DicomTag tag) {
			_tag = tag;
		}
示例#60
0
 public TrimStringDicomTransformRule(DicomTag tag, DicomTrimPosition position, string trim)
 {
     _tag      = tag;
     _trim     = trim;
     _position = position;
 }