jdata 0.9.4__tar.gz → 0.9.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {jdata-0.9.4/jdata.egg-info → jdata-0.9.5}/PKG-INFO +2 -2
- {jdata-0.9.4 → jdata-0.9.5}/README.md +1 -1
- {jdata-0.9.4 → jdata-0.9.5}/jdata/__init__.py +1 -1
- {jdata-0.9.4 → jdata-0.9.5}/jdata/jfile.py +1 -1
- {jdata-0.9.4 → jdata-0.9.5}/jdata/jnifti.py +8 -18
- {jdata-0.9.4 → jdata-0.9.5/jdata.egg-info}/PKG-INFO +2 -2
- {jdata-0.9.4 → jdata-0.9.5}/pyproject.toml +1 -1
- {jdata-0.9.4 → jdata-0.9.5}/setup.py +1 -1
- {jdata-0.9.4 → jdata-0.9.5}/LICENSE.txt +0 -0
- {jdata-0.9.4 → jdata-0.9.5}/MANIFEST.in +0 -0
- {jdata-0.9.4 → jdata-0.9.5}/jdata/__main__.py +0 -0
- {jdata-0.9.4 → jdata-0.9.5}/jdata/csvtsv.py +0 -0
- {jdata-0.9.4 → jdata-0.9.5}/jdata/h5.py +0 -0
- {jdata-0.9.4 → jdata-0.9.5}/jdata/jdata.py +0 -0
- {jdata-0.9.4 → jdata-0.9.5}/jdata/jdictionary.py +0 -0
- {jdata-0.9.4 → jdata-0.9.5}/jdata/jgifti.py +0 -0
- {jdata-0.9.4 → jdata-0.9.5}/jdata/jpath.py +0 -0
- {jdata-0.9.4 → jdata-0.9.5}/jdata/jschema.py +0 -0
- {jdata-0.9.4 → jdata-0.9.5}/jdata/neurojson.py +0 -0
- {jdata-0.9.4 → jdata-0.9.5}/jdata/njprep.py +0 -0
- {jdata-0.9.4 → jdata-0.9.5}/jdata.egg-info/SOURCES.txt +0 -0
- {jdata-0.9.4 → jdata-0.9.5}/jdata.egg-info/dependency_links.txt +0 -0
- {jdata-0.9.4 → jdata-0.9.5}/jdata.egg-info/requires.txt +0 -0
- {jdata-0.9.4 → jdata-0.9.5}/jdata.egg-info/top_level.txt +0 -0
- {jdata-0.9.4 → jdata-0.9.5}/setup.cfg +0 -0
- {jdata-0.9.4 → jdata-0.9.5}/test/test_comprehensive.py +0 -0
- {jdata-0.9.4 → jdata-0.9.5}/test/testgifti.py +0 -0
- {jdata-0.9.4 → jdata-0.9.5}/test/testjd.py +0 -0
- {jdata-0.9.4 → jdata-0.9.5}/test/testjdict.py +0 -0
- {jdata-0.9.4 → jdata-0.9.5}/test/testneuroj.py +0 -0
- {jdata-0.9.4 → jdata-0.9.5}/test/testnifti.py +0 -0
- {jdata-0.9.4 → jdata-0.9.5}/test/testsnirf.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: jdata
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.5
|
|
4
4
|
Summary: JSON/binary JSON formats for exchanging Python and Numpy data
|
|
5
5
|
Home-page: https://github.com/NeuroJSON/pyjdata
|
|
6
6
|
Author: Qianqian Fang
|
|
@@ -74,7 +74,7 @@ Dynamic: platform
|
|
|
74
74
|
|
|
75
75
|
- Copyright: (C) Qianqian Fang (2019-2026) <q.fang at neu.edu>
|
|
76
76
|
- License: Apache License, Version 2.0
|
|
77
|
-
- Version: 0.9.
|
|
77
|
+
- Version: 0.9.4
|
|
78
78
|
- URL: https://github.com/NeuroJSON/pyjdata
|
|
79
79
|
- Acknowledgement: This project is supported by US National Institute of Health (NIH)
|
|
80
80
|
grant [U24-NS124027](https://reporter.nih.gov/project-details/10308329)
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
- Copyright: (C) Qianqian Fang (2019-2026) <q.fang at neu.edu>
|
|
6
6
|
- License: Apache License, Version 2.0
|
|
7
|
-
- Version: 0.9.
|
|
7
|
+
- Version: 0.9.4
|
|
8
8
|
- URL: https://github.com/NeuroJSON/pyjdata
|
|
9
9
|
- Acknowledgement: This project is supported by US National Institute of Health (NIH)
|
|
10
10
|
grant [U24-NS124027](https://reporter.nih.gov/project-details/10308329)
|
|
@@ -103,7 +103,7 @@ def load(fname, opt=None, **kwargs):
|
|
|
103
103
|
if re.match("^https*://", fname):
|
|
104
104
|
newdata, fname, _ = downloadlink(fname, opt, **kwargs)
|
|
105
105
|
if newdata:
|
|
106
|
-
return newdata
|
|
106
|
+
return newdata
|
|
107
107
|
|
|
108
108
|
spl = os.path.splitext(fname)
|
|
109
109
|
ext = spl[1].lower()
|
|
@@ -71,13 +71,9 @@ def nii2jnii(filename, format="jnii", *varargin, **kwargs):
|
|
|
71
71
|
fileinfo = os.stat(hdrfile)
|
|
72
72
|
if fileinfo.st_size == 0:
|
|
73
73
|
raise ValueError("specified file does not exist")
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
access=mmap.ACCESS_READ,
|
|
78
|
-
format=niftiheader[: (fileinfo.st_size < 352)],
|
|
79
|
-
)
|
|
80
|
-
nii = {"hdr": header[0]}
|
|
74
|
+
with open(hdrfile, "rb") as finput:
|
|
75
|
+
hdrbytes = finput.read()
|
|
76
|
+
nii = {"hdr": memmapstream(hdrbytes, niftiheader)}
|
|
81
77
|
|
|
82
78
|
dataendian = sys.byteorder
|
|
83
79
|
|
|
@@ -92,13 +88,7 @@ def nii2jnii(filename, format="jnii", *varargin, **kwargs):
|
|
|
92
88
|
if "gzdata" in locals():
|
|
93
89
|
nii["hdr"] = memmapstream(gzdata, niftiheader)
|
|
94
90
|
else:
|
|
95
|
-
|
|
96
|
-
hdrfile,
|
|
97
|
-
0,
|
|
98
|
-
access=mmap.ACCESS_READ,
|
|
99
|
-
format=niftiheader[: (fileinfo.st_size < 352)],
|
|
100
|
-
)
|
|
101
|
-
nii["hdr"] = header[0]
|
|
91
|
+
nii["hdr"] = memmapstream(hdrbytes, niftiheader)
|
|
102
92
|
|
|
103
93
|
if nii["hdr"]["dim"][0] > 7:
|
|
104
94
|
names = list(nii["hdr"].keys())
|
|
@@ -186,7 +176,7 @@ def nii2jnii(filename, format="jnii", *varargin, **kwargs):
|
|
|
186
176
|
if re.search(r"\.[Hh][Dd][Rr](\.[Gg][Zz])*$", filename):
|
|
187
177
|
filename = re.sub(r"\.[Hh][Dd][Rr](\.[Gg][Zz])*$", ".img\g<1>", filename)
|
|
188
178
|
|
|
189
|
-
imgbytenum = np.prod(nii["hdr"]["dim"][1 : nii["hdr"]["dim"][0] + 1]) * nii["voxelbyte"]
|
|
179
|
+
imgbytenum = int(np.prod(nii["hdr"]["dim"][1 : nii["hdr"]["dim"][0] + 1]) * nii["voxelbyte"])
|
|
190
180
|
|
|
191
181
|
if isnii == 0 and re.search(r"\.[Gg][Zz]$", filename):
|
|
192
182
|
with open(filename, "rb") as finput:
|
|
@@ -1301,13 +1291,13 @@ def loadjnifti(filename, *args, **kwargs):
|
|
|
1301
1291
|
jnii['NIFTIData'] - the main image data array
|
|
1302
1292
|
jnii['NIFTIExtension'] - a list containing the extension data buffers
|
|
1303
1293
|
"""
|
|
1304
|
-
if not filename.endswith((".nii", ".jnii", ".bnii")):
|
|
1294
|
+
if not filename.endswith((".nii", ".nii.gz", ".jnii", ".bnii")):
|
|
1305
1295
|
raise ValueError(
|
|
1306
1296
|
"File suffix must be .jnii for text JNIfTI, .bnii for binary JNIfTI or .nii for NIFTI-1/2 files"
|
|
1307
1297
|
)
|
|
1308
1298
|
|
|
1309
|
-
if filename.endswith(".nii"):
|
|
1310
|
-
|
|
1299
|
+
if filename.endswith((".nii", ".nii.gz")):
|
|
1300
|
+
jnii = loadnifti(filename, **kwargs)
|
|
1311
1301
|
elif filename.endswith(".jnii"):
|
|
1312
1302
|
# Assuming loadjson is available from JSONLab
|
|
1313
1303
|
jnii = jd.load(filename, *args, **kwargs)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: jdata
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.5
|
|
4
4
|
Summary: JSON/binary JSON formats for exchanging Python and Numpy data
|
|
5
5
|
Home-page: https://github.com/NeuroJSON/pyjdata
|
|
6
6
|
Author: Qianqian Fang
|
|
@@ -74,7 +74,7 @@ Dynamic: platform
|
|
|
74
74
|
|
|
75
75
|
- Copyright: (C) Qianqian Fang (2019-2026) <q.fang at neu.edu>
|
|
76
76
|
- License: Apache License, Version 2.0
|
|
77
|
-
- Version: 0.9.
|
|
77
|
+
- Version: 0.9.4
|
|
78
78
|
- URL: https://github.com/NeuroJSON/pyjdata
|
|
79
79
|
- Acknowledgement: This project is supported by US National Institute of Health (NIH)
|
|
80
80
|
grant [U24-NS124027](https://reporter.nih.gov/project-details/10308329)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|