pyMapVBVD 0.5.6__tar.gz → 0.6.0__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.
Files changed (25) hide show
  1. {pyMapVBVD-0.5.6 → pymapvbvd-0.6.0}/CHANGELOG.md +11 -0
  2. {pyMapVBVD-0.5.6/pyMapVBVD.egg-info → pymapvbvd-0.6.0}/PKG-INFO +5 -5
  3. {pyMapVBVD-0.5.6 → pymapvbvd-0.6.0}/mapvbvd/_version.py +3 -3
  4. {pyMapVBVD-0.5.6 → pymapvbvd-0.6.0}/mapvbvd/mapVBVD.py +5 -7
  5. {pyMapVBVD-0.5.6 → pymapvbvd-0.6.0}/mapvbvd/read_twix_hdr.py +2 -2
  6. {pyMapVBVD-0.5.6 → pymapvbvd-0.6.0}/mapvbvd/twix_map_obj.py +12 -2
  7. {pyMapVBVD-0.5.6 → pymapvbvd-0.6.0/pyMapVBVD.egg-info}/PKG-INFO +5 -5
  8. {pyMapVBVD-0.5.6 → pymapvbvd-0.6.0}/pyMapVBVD.egg-info/requires.txt +2 -2
  9. {pyMapVBVD-0.5.6 → pymapvbvd-0.6.0}/requirements.yml +2 -2
  10. {pyMapVBVD-0.5.6 → pymapvbvd-0.6.0}/setup.py +2 -2
  11. {pyMapVBVD-0.5.6 → pymapvbvd-0.6.0}/LICENSE +0 -0
  12. {pyMapVBVD-0.5.6 → pymapvbvd-0.6.0}/MANIFEST.in +0 -0
  13. {pyMapVBVD-0.5.6 → pymapvbvd-0.6.0}/README.md +0 -0
  14. {pyMapVBVD-0.5.6 → pymapvbvd-0.6.0}/mapvbvd/__init__.py +0 -0
  15. {pyMapVBVD-0.5.6 → pymapvbvd-0.6.0}/mapvbvd/_attrdict.py +0 -0
  16. {pyMapVBVD-0.5.6 → pymapvbvd-0.6.0}/pyMapVBVD.egg-info/SOURCES.txt +0 -0
  17. {pyMapVBVD-0.5.6 → pymapvbvd-0.6.0}/pyMapVBVD.egg-info/dependency_links.txt +0 -0
  18. {pyMapVBVD-0.5.6 → pymapvbvd-0.6.0}/pyMapVBVD.egg-info/top_level.txt +0 -0
  19. {pyMapVBVD-0.5.6 → pymapvbvd-0.6.0}/pyproject.toml +0 -0
  20. {pyMapVBVD-0.5.6 → pymapvbvd-0.6.0}/setup.cfg +0 -0
  21. {pyMapVBVD-0.5.6 → pymapvbvd-0.6.0}/tests/test_flags.py +0 -0
  22. {pyMapVBVD-0.5.6 → pymapvbvd-0.6.0}/tests/test_read.py +0 -0
  23. {pyMapVBVD-0.5.6 → pymapvbvd-0.6.0}/tests/test_slicing.py +0 -0
  24. {pyMapVBVD-0.5.6 → pymapvbvd-0.6.0}/tests/test_svs.py +0 -0
  25. {pyMapVBVD-0.5.6 → pymapvbvd-0.6.0}/versioneer.py +0 -0
@@ -1,5 +1,16 @@
1
1
  This document contains the pymapvbvd release history in reverse chronological order.
2
2
 
3
+ 0.6.0 (Friday 28th June 2024)
4
+ -----------------------------
5
+ - Dropped support for Python 3.8
6
+ - Testing for Python 3.12
7
+ - Compatibility with Numpy version 2
8
+
9
+ 0.5.7 (Wednesday 31st January 2024)
10
+ -----------------------------------
11
+ - Added flag to disable line reflection. Thanks to FrankZijlstra for contributing.
12
+ - Fixed depreciation warning (Issue 42). Thanks to MusicInMyBrain for reporting.
13
+
3
14
  0.5.6 (Wednesday 11th October 2023)
4
15
  -----------------------------------
5
16
  - Fixed issue with large files on Windows. Thanks to FrankZijlstra for reporting.
@@ -1,23 +1,23 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyMapVBVD
3
- Version: 0.5.6
3
+ Version: 0.6.0
4
4
  Summary: Python twix file reader
5
5
  Home-page: https://github.com/wtclarke/pymapvbvd
6
6
  Author: Will Clarke
7
7
  Author-email: william.clarke@ndcn.ox.ac.uk
8
8
  Classifier: Programming Language :: Python :: 3
9
- Classifier: Programming Language :: Python :: 3.8
10
9
  Classifier: Programming Language :: Python :: 3.9
11
10
  Classifier: Programming Language :: Python :: 3.10
12
11
  Classifier: Programming Language :: Python :: 3.11
12
+ Classifier: Programming Language :: Python :: 3.12
13
13
  Classifier: License :: OSI Approved :: MIT License
14
14
  Classifier: Operating System :: OS Independent
15
- Requires-Python: >=3.8
15
+ Requires-Python: >=3.9
16
16
  Description-Content-Type: text/markdown
17
17
  License-File: LICENSE
18
- Requires-Dist: numpy
18
+ Requires-Dist: numpy>=1.26
19
19
  Requires-Dist: tqdm
20
- Requires-Dist: scipy
20
+ Requires-Dist: scipy==1.13.*
21
21
  Requires-Dist: matplotlib
22
22
  Requires-Dist: h5py
23
23
  Requires-Dist: six
@@ -8,11 +8,11 @@ import json
8
8
 
9
9
  version_json = '''
10
10
  {
11
- "date": "2023-10-11T11:46:40+0100",
11
+ "date": "2024-06-28T18:18:24+0100",
12
12
  "dirty": false,
13
13
  "error": null,
14
- "full-revisionid": "d5a034974529cbe263fcacfd6e269b6830d3f7e6",
15
- "version": "0.5.6"
14
+ "full-revisionid": "d4a4ec98f970a140ffe9984fafe6fd5f793fbfca",
15
+ "version": "0.6.0"
16
16
  }
17
17
  ''' # END VERSION_JSON
18
18
 
@@ -108,7 +108,7 @@ def loop_mdh_read(fid, version, Nscans, scan, measOffset, measLength, print_prog
108
108
  data_u8[3] = get_bit(data_u8[3], 0) # ubit24: keep only 1 bit from the 4th byte
109
109
  tmp = data_u8[0:4]
110
110
  tmp.dtype = np.uint32
111
- ulDMALength = float(tmp)
111
+ ulDMALength = tmp.item()
112
112
 
113
113
  if (ulDMALength == 0) or (bitMask & bit_0):
114
114
  cPos = cPos + ulDMALength
@@ -122,7 +122,7 @@ def loop_mdh_read(fid, version, Nscans, scan, measOffset, measLength, print_prog
122
122
  data_u8[3] = get_bit(data_u8[3], 0) # ubit24: keep only 1 bit from the 4th byte
123
123
  tmp = data_u8[0:4]
124
124
  tmp.dtype = np.uint32
125
- ulDMALength = float(tmp)
125
+ ulDMALength = tmp.item()
126
126
  cPos = cPos + ulDMALength
127
127
  continue
128
128
 
@@ -132,9 +132,7 @@ def loop_mdh_read(fid, version, Nscans, scan, measOffset, measLength, print_prog
132
132
  # the "DMA length"
133
133
  # if mdh.ulPackBit
134
134
  # it seems that the packbit is not always set correctly
135
- tmp = data_u8[dmaIdx]
136
- tmp.dtype = np.uint16
137
- NCol_NCha = tmp # was float [ushSamplesInScan ushUsedChannels]
135
+ NCol_NCha = data_u8[dmaIdx].view(np.uint16).astype(int)
138
136
  ulDMALength = dmaOff + (8 * NCol_NCha[0] + dmaSkip) * NCol_NCha[1]
139
137
 
140
138
  n_acq = n_acq + 1
@@ -340,8 +338,8 @@ def mapVBVD(filename, quiet=False, **kwargs):
340
338
  measOffset = np.zeros(NScans, dtype=np.uint64)
341
339
  measLength = np.zeros(NScans, dtype=np.uint64)
342
340
  for k in range(NScans):
343
- measOffset[k] = np.fromfile(fid, dtype=np.uint64, count=1, offset=0)
344
- measLength[k] = np.fromfile(fid, dtype=np.uint64, count=1, offset=0)
341
+ measOffset[k] = np.fromfile(fid, dtype=np.uint64, count=1, offset=0).item()
342
+ measLength[k] = np.fromfile(fid, dtype=np.uint64, count=1, offset=0).item()
345
343
  fid.seek(152 - 16, 1)
346
344
 
347
345
  else:
@@ -1,6 +1,6 @@
1
1
  import re
2
2
  import numpy as np
3
- from scipy.integrate import cumtrapz
3
+ from scipy.integrate import cumulative_trapezoid
4
4
 
5
5
  from mapvbvd._attrdict import AttrDict
6
6
 
@@ -231,7 +231,7 @@ def read_twix_hdr(fid, prot):
231
231
 
232
232
  # make sure that gr_adc is always positive (rstraj needs to be strictly monotonic)
233
233
  gr_adc = np.maximum(gr_adc, 1e-4)
234
- rstraj = (np.append(0, cumtrapz(gr_adc)) - ncol / 2) / np.sum(gr_adc)
234
+ rstraj = (np.append(0, cumulative_trapezoid(gr_adc)) - ncol / 2) / np.sum(gr_adc)
235
235
  rstraj -= np.mean(rstraj[int(ncol / 2) - 1:int(ncol / 2) + 1])
236
236
  # scale rstraj by kmax (only works if all slices have same FoV!!!)
237
237
  # TODO: these are examples of the keys not arranged correctly
@@ -153,6 +153,14 @@ class twix_map_obj:
153
153
  raise Exception('No trajectory for regridding available')
154
154
  self.regrid = bval
155
155
 
156
+ @property
157
+ def flagDisableReflect(self):
158
+ return self.disableReflect
159
+
160
+ @flagDisableReflect.setter
161
+ def flagDisableReflect(self, val):
162
+ self.disableReflect = val
163
+
156
164
  # TODO: flagDoRawDataCorrect
157
165
  @property
158
166
  def flagDoRawDataCorrect(self):
@@ -181,6 +189,7 @@ class twix_map_obj:
181
189
  self.averageSets = kwargs.get('averageSets', False)
182
190
  self.ignoreSeg = kwargs.get('ignoreSeg', False)
183
191
  self.squeeze = kwargs.get('squeeze', False)
192
+ self.disableReflect = kwargs.get('disableReflect', False)
184
193
 
185
194
  self.dType = dataType.lower()
186
195
  self.fname = fname
@@ -806,8 +815,9 @@ class twix_map_obj:
806
815
  # if bDoRawDataCorrect && bIsRawDataCorrect(k): WTC: not implemented yet
807
816
 
808
817
  # reflect fids when necessary
809
- isRefl = np.where(bIsReflected[ix])[0]
810
- block[:, :, isRefl] = block[-1::-1, :, isRefl]
818
+ if not self.disableReflect:
819
+ isRefl = np.where(bIsReflected[ix])[0]
820
+ block[:, :, isRefl] = block[-1::-1, :, isRefl]
811
821
 
812
822
  if bRegrid:
813
823
  # correct for readout shifts
@@ -1,23 +1,23 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyMapVBVD
3
- Version: 0.5.6
3
+ Version: 0.6.0
4
4
  Summary: Python twix file reader
5
5
  Home-page: https://github.com/wtclarke/pymapvbvd
6
6
  Author: Will Clarke
7
7
  Author-email: william.clarke@ndcn.ox.ac.uk
8
8
  Classifier: Programming Language :: Python :: 3
9
- Classifier: Programming Language :: Python :: 3.8
10
9
  Classifier: Programming Language :: Python :: 3.9
11
10
  Classifier: Programming Language :: Python :: 3.10
12
11
  Classifier: Programming Language :: Python :: 3.11
12
+ Classifier: Programming Language :: Python :: 3.12
13
13
  Classifier: License :: OSI Approved :: MIT License
14
14
  Classifier: Operating System :: OS Independent
15
- Requires-Python: >=3.8
15
+ Requires-Python: >=3.9
16
16
  Description-Content-Type: text/markdown
17
17
  License-File: LICENSE
18
- Requires-Dist: numpy
18
+ Requires-Dist: numpy>=1.26
19
19
  Requires-Dist: tqdm
20
- Requires-Dist: scipy
20
+ Requires-Dist: scipy==1.13.*
21
21
  Requires-Dist: matplotlib
22
22
  Requires-Dist: h5py
23
23
  Requires-Dist: six
@@ -1,6 +1,6 @@
1
- numpy
1
+ numpy>=1.26
2
2
  tqdm
3
- scipy
3
+ scipy==1.13.*
4
4
  matplotlib
5
5
  h5py
6
6
  six
@@ -1,7 +1,7 @@
1
1
  dependencies:
2
- - numpy
2
+ - numpy>=1.26
3
3
  - tqdm
4
- - scipy
4
+ - scipy==1.13.*
5
5
  - matplotlib
6
6
  - h5py
7
7
  - six
@@ -31,10 +31,10 @@ setuptools.setup(
31
31
  license_file='LICENSE',
32
32
  classifiers=[
33
33
  "Programming Language :: Python :: 3",
34
- "Programming Language :: Python :: 3.8",
35
34
  "Programming Language :: Python :: 3.9",
36
35
  "Programming Language :: Python :: 3.10",
37
36
  "Programming Language :: Python :: 3.11",
37
+ "Programming Language :: Python :: 3.12",
38
38
  "License :: OSI Approved :: MIT License",
39
39
  "Operating System :: OS Independent", ],
40
- python_requires='>=3.8')
40
+ python_requires='>=3.9')
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