The replacement of the var val = Get(tag, defaultvalue) is now var val = TryGetSingleValue(tag, out T dummy) ? dummy : defaultvalue ? any better idea, this seems to be more complicated now to me. What about another method GetDicomItem(DicomTag tag)? Shall we either change GetSingleValue so that it checks the Type T before if checks the VM? Or what I would prefer: GetSingleValue suggests only to return the value while the Get return the whole DicomItem structure and not only the value. But this method GetSingleValue throws if the VM is > 1. This has to be translated to GetSingleValue(tag). So I would like to return it a full string representation for any kind of VR. If the user has to know that the DicomTag has to be a string, why shouldn't he just use GetValues or GetSingleVaue? I would expect this method to be usable for any DicomTag for logging or serialization or just some other string-processing. The method GetStringValue() currently returns only values if the VR is a string type. By that I have until now found 3 questions, that I would like to discuss: Merged the commit into branch GH-491 and try to replace the existing calls to. If the tag exists but is empty, string.Empty is returned. Same as previous, but returns defaultValue if tag does not exist. Throws if the tag does not exist in the dataset. Applicable when Value Representation is any character string VR, such as CS, IS and DS. Use GetValue(DicomTag, 0, T defaultValue) to return defaultValue when tag is empty.įor obtaining the raw, potentially multi-valued, string with backslashes separating the individual items. Throws if tag is empty or contains multi-valued data. GetSingleValue(DicomTag, T default value) Throws if the tag does not exist, is empty or multi-valued. If tag exists but is empty, an empty T array is returned.įor obtaining the single value associated with the tag. Same as previous, but returns defaultValues if tag does not exist. GetValues(DicomTag, params T defaultValues) Throws if the tag does not exist, returns empty array if the tag exists but is empty. Same as previous, but returns defaultValue if tag does not exist in dataset, is empty or if n is greater than or equal to the value count.įor obtaining a full array T of values for the tag. GetValue(DicomTag, int n, T defaultValue) If tag does not exist, is empty or if n is greater than or equal to the value count, method throws. n should be non-negative, -1 is not a valid option. (n is not optional) for obtaining single-value data at index n in a single- or multivalued item. Throws if tag does not exist in the dataset. Returns the number of values in the tag item. New API with the following methods and functionality:. To overcome much of the confusion around this and similar issues, I am planning on modifying the DicomDataset API, like this:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |