-
Notifications
You must be signed in to change notification settings - Fork 645
Supporting DateOnly values if VR is DA #1866
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Great enhancement, but this will not be implemented in version 4 any more. |
Of course, please go ahead. |
@gofal |
Thank you, @jaime-olivares! Sorry for my silly question; I am not familiar with the sources. Do you suggest rewriting fo-dicom to support |
@iberisoft |
did some runtime tests. fo-dicom is just a library calling .net api-methods. So the performance mainly depends on the executing application, that decides, which framework is loaded. so the golden rule is, to compile at the lowest .net version in which your code compiles, so that you can support as many applications as possible. You only gain the advantages of newer frameworks in libraries, if you acutally are using new classes or features of the new frameworks. This will very likely be in fo-dicom version 6. the issue here is, that there is only one method, and then at runtime there have to be lot of checks to convert the value into a format that fits to the VR of the dicomtag. This is, why only exactly these types can be passed as parameter, which then later are checked in code. |
@gofal if I get you right, you would like to compile fo-dicom still under .NET Standard 2.0 but then the |
I would choose |
@jaime-olivares thanks for explaining. Then you should put the code specific to .NET 8, e.g. working with the I completely agree that now everyone should use .NET 8 at least due to a lack of maintenance of any older version except for .NET Framework. |
yes, I proposed to use an Apart from the performance improvements in certain classes, JIT compile, and garbage collection, there may be additional benefits of using new classes conditionally, like FrozenDictionary |
There already was a discussion about dropping .netstandard2 support and to compile only in .net6/8/9 etc. I expect most benefits of Span, AsyncEnumerables, Generic Math, Pipes, etc. |
But for the issue here with DateOnly. Have you seen the method in DicomDataset.DoAdd, where there is one single generic method that takes all objects of any type T and then there are a lot of runtime tests if the type T is assignable from that type or from the other type etc. Sure we could add here an other line of code for DateOnly (maybe compiler conditional). and this all leads to weaker runtime performance. Or do you consider this issue here with DateOnly as urgent so that just DateOnly should be added to the huge DicomDataset.DoAdd method? |
@gofal thanks for sharing your thoughts! Of course, the new approach will implement this issue in the best way. I do not see it really urgent, our software may convert a
|
Describe the bug
DateOnly
is a new type to store dates w/o the time part however it is not supported like theDateTime
type.To Reproduce
Call
AddOrUpdate
for the Patient's Birth Date (0010,0030) tag and aDateOnly
value.Expected behavior
If VR is
DA
, theAddOrUpdate
method must work for bothDateTime
andDateOnly
values.Environment
Fellow Oak DICOM version: 4.0.8
OS: Windows 10 x64
Platform: .NET 6.0
The text was updated successfully, but these errors were encountered: