Skip to content
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

Output not JSON-compliant #152

Open
mih opened this issue May 8, 2019 · 0 comments
Open

Output not JSON-compliant #152

mih opened this issue May 8, 2019 · 0 comments

Comments

@mih
Copy link
Contributor

mih commented May 8, 2019

From https://www.ietf.org/rfc/rfc4627.txt

2.4. Numbers
[...]
Numeric values that cannot be represented as sequences of digits
(such as Infinity and NaN) are not permitted.

but I do get:

        {
          "@id": "niiri:69b8b19c-4935-49db-84f9-af5c861cd18b",
          "@type": [
            "nidm_StatisticMap",
            "prov:Entity"
          ],
          "crypto:sha512": "6e716b6d6b0f506e35733bcae079ce4ad05df1fc213959bcef4774dbe48c568200a088eef874b694b23ededfdfe228c4ec668a9a9571b4d70302cc23b5bf6b87",
          "dct:format": "image/nifti",
          "nfo:fileName": "ZStatistic.nii.gz",
          "nidm_contrastName": "group mean",
          "nidm_effectDegreesOfFreedom": 1.0,
          "nidm_errorDegreesOfFreedom": Infinity,
          "nidm_inCoordinateSpace": {
            "@id": "niiri:795dccdb-9b92-4b4d-ac43-51a4a5a50e73"
          },

This breaks JSON toolchains.

From https://stackoverflow.com/a/14627638

One solution is to encode +inf as +1e9999 as that will naturally overflow to +inf in most decoders, and same with -inf as -1e9999.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant