Comments (9)
I would prefer that variant, that is dicom-conform but also makes sure that the generated data can be processed correctly.
If you generate a file with only the dot as a DS value and then open this file in other tools/applications, are they then able to parse this value, or would it cause issues. I will give it a try.
from fo-dicom.
I think you are right - I could not find any mention that this is not allowed, and any regex that checks for floating point numbers I could find allows for leading zeros.
Quite easy to fix...
from fo-dicom.
Well, I also agree, that this seems to be a valid DS.
from fo-dicom.
I will move comment from the PR to this issue:
The definition of DS says "A fixed point number shall contain only the characters 0-9 with an optional leading "+" or "-" and an optional "." to mark the decimal point". it does not say that it shall contain at least one character 0-9. So would the text "." be a valid DS?
from fo-dicom.
That is a good question. I would say no by gut feeling, but still couldn't find an official definition. Unofficially, there are several regexes that do not allow this, for example this one which has a good explanation in the comments.
Our own regex is more permissive and allows that, but I would tend to change that...
from fo-dicom.
After more reading and thinking, I actually changed my mind.
I'm now inclined to remain more permissive. There seems to be no real standard in the textual representation of floating point numbers, at least concerning the presence of digits around the dot. The representation I linked does not allow for something like 123.
, which I would consider valid. Given that all these strings (including a single dot) unambiguously define numbers, and the DICOM standard says nothing about it, I think we can leave the regex as permissive as it is now.
from fo-dicom.
@gofal: I suggest to either leave the regex as is in the PR, or change the first part from "^[+-]?((\d*)([.]\d*)?|[.]\d+)
to something like "^[+-]?((\d+(\.\d*)?)|(\.\d+))
, which would not allow a single dot, but would allow a leading or trailing dot. What do you think?
from fo-dicom.
I tried Orthanc, ClearCanvas and MicroDicom, they all three do not parse "." as a valid DS number.
e.g. if I set a value to "0.0" or "0." or ".0", then the value is displayed as "0". but if I set the value to ".", then microdicom only shows "."
Orthanc refuses to process a file where I set the WindowCenter to "." and want to upload it via OrthancExplorer.
And ClearCanvas ignores the WindowCenter "." and estimates the Windowing from histrogram.
I stop evaluating now, and I would recommand, to throw a validation exception, if a user wants to add "." as a DS value.
from fo-dicom.
Ok, thanks - I will change the regex as proposed above.
from fo-dicom.
Related Issues (20)
- Code in fo-dicom to apply window width and center on an image HOT 1
- TCP listener stuck while processing TLS handshake HOT 4
- HTJ2K Throwing exception HOT 2
- The SCU client transmits images to the fo-dicom c-store-scp, and the speed decreases sequentially after each task is transmitted
- Korean Hangul characters incorrectly read from dicom file HOT 2
- fo-dicom v5 Dependency Injection Documentation HOT 4
- DicomServer performance regression HOT 6
- Microsoft Code Analysis HOT 2
- Creating a TCP connection using `DicomClient.SendAsync()` does not take `AssociationRequestTimeoutInMs` into account HOT 4
- DicomValidation for VR PN HOT 17
- dataset AddOrUpdate not find Encod args HOT 4
- Support proper encoding of strings with multi-valued encodings HOT 9
- DicomJsonConverter throws for non-DicomElements HOT 7
- Service stopped When Changing DICOM File Compression HOT 13
- Incorrect conversion between C# decimal and DICOM Decimal String HOT 1
- ISO 2022 IR 58 Encoded Strings Cannot Be Decoded Correctly HOT 3
- Performance impact in DicomDataset comparing HOT 5
- What is the plan for supporting .NET 8? HOT 3
- Ability to cancel the store request in C-Get HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fo-dicom.