nabu 2024.2.12__py3-none-any.whl → 2024.2.14__py3-none-any.whl

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.
nabu/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
- __version__ = "2024.2.12"
1
+ __version__ = "2024.2.14"
2
2
  __nabu_modules__ = [
3
3
  "app",
4
4
  "cuda",
nabu/io/cast_volume.py CHANGED
@@ -206,6 +206,9 @@ def cast_volume(
206
206
  data_min = data_min if data_min is not None else found_data_min
207
207
  data_max = data_max if data_max is not None else found_data_max
208
208
 
209
+ if isinstance(output_volume, JP2KVolume):
210
+ output_volume.rescale_data = False
211
+
209
212
  data = []
210
213
  for input_slice, frame_dumper in zip(
211
214
  input_volume.browse_slices(),
@@ -79,6 +79,13 @@ class CudaBackprojector(BackprojectorBase):
79
79
  self.sino_mult = CudaSinoMult(self.sino_shape, self.rot_center, ctx=self._processing.ctx)
80
80
  self._prepare_textures() # has to be done after compilation for Cuda (to bind texture to built kernel)
81
81
 
82
+ def _get_filter_init_extra_options(self):
83
+ return {
84
+ "cuda_options": {
85
+ "ctx": self._processing.ctx,
86
+ },
87
+ }
88
+
82
89
  def _transfer_to_texture(self, sino, do_checks=True):
83
90
  if do_checks and not (sino.flags.c_contiguous):
84
91
  raise ValueError("Expected C-Contiguous array")
@@ -237,14 +237,15 @@ class BackprojectorBase:
237
237
  self._axis_correction = np.zeros((1, self.n_angles), dtype=np.float32)
238
238
  self._axis_correction[0, :] = axcorr[:] # pylint: disable=E1136
239
239
 
240
+ def _get_filter_init_extra_options(self):
241
+ return {}
242
+
240
243
  def _init_filter(self, filter_name):
241
244
  self.filter_name = filter_name
242
245
  if filter_name in ["None", "none"]:
243
246
  self.sino_filter = None
244
247
  return
245
- sinofilter_other_kwargs = {}
246
- if self.backend != "numpy":
247
- sinofilter_other_kwargs["%s_options" % self.backend] = {"ctx": self._processing.ctx}
248
+ sinofilter_other_kwargs = self._get_filter_init_extra_options()
248
249
  self.sino_filter = self.SinoFilterClass(
249
250
  self.sino_shape,
250
251
  filter_name=self.filter_name,
@@ -74,5 +74,13 @@ class OpenCLBackprojector(BackprojectorBase):
74
74
  return
75
75
  return cl.enqueue_copy(self._processing.queue, self._d_sino.data, sino.data)
76
76
 
77
+ def _get_filter_init_extra_options(self):
78
+ return {
79
+ "opencl_options": {
80
+ "ctx": self._processing.ctx,
81
+ "queue": self._processing.queue, # !!!!
82
+ },
83
+ }
84
+
77
85
  def _set_kernel_slice_arg(self, d_slice):
78
86
  self.kern_proj_args[1] = d_slice
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nabu
3
- Version: 2024.2.12
3
+ Version: 2024.2.14
4
4
  Summary: Nabu - Tomography software
5
5
  Author-email: Pierre Paleo <pierre.paleo@esrf.fr>, Henri Payno <henri.payno@esrf.fr>, Alessandro Mirone <mirone@esrf.fr>, Jérôme Lesaint <jerome.lesaint@esrf.fr>
6
6
  Maintainer-email: Pierre Paleo <pierre.paleo@esrf.fr>
@@ -1,7 +1,7 @@
1
1
  doc/conf.py,sha256=3xtCarCHrXPr50GbeRDuH-o3Jzojw7mpr7vpGfZPLAE,3787
2
2
  doc/create_conf_doc.py,sha256=IVOdP70KvbW9WS_UQu3Iyd0YfS60E2fJ5IDtQ_s4cDw,1143
3
3
  doc/get_mathjax.py,sha256=VIvKRCdDuF2VoY8JD3mSey9XX13AZMmwTJBHdt1tUs4,1012
4
- nabu/__init__.py,sha256=YifF4GAurmjhWkdEHc0w9j48GNlcJSLObAKt0WNrcUo,271
4
+ nabu/__init__.py,sha256=8_mbP31FX12L0QwJXpiUISTKOgsEynDKnwTQRVjBaOc,271
5
5
  nabu/tests.py,sha256=cew9OY2uTyncHI_HM32W8CP6B1GTGKaOW65XtMEqs7o,1417
6
6
  nabu/testutils.py,sha256=VkSL9tbY0XEH49Z5OjDFFhzkSxrCv4UIuvSVFgegSUY,7632
7
7
  nabu/utils.py,sha256=V1B_sD54XGNKn5pORa2yNCATyswOzybey3sv8BuIYWY,26355
@@ -77,7 +77,7 @@ nabu/estimation/tests/test_focus.py,sha256=cMxEeTLlfVHOvG_4oGMLpp6bVI6okYz0u4aNc
77
77
  nabu/estimation/tests/test_tilt.py,sha256=PN4tnV3-XU2nNA608kQShaHugWn_-wbHzWCTnLIaCTk,1658
78
78
  nabu/estimation/tests/test_translation.py,sha256=RkOnCYgk9DZGKlIka1snqTv4wbIz_nG7-EHAxnBHsJU,2999
79
79
  nabu/io/__init__.py,sha256=AbQgj4-fCCHOKynO_PyAR9ejnFSuWKgroxxhxWVpjyQ,120
80
- nabu/io/cast_volume.py,sha256=LQkd3I_W9mpX_vIa7iAV-rcv2ZcCJ-NZ3EQuFAPYJSI,17504
80
+ nabu/io/cast_volume.py,sha256=9evViU9gRnZ4Bv3VpSQ74rKjJsyfMmu2h_IpPVlQCK0,17594
81
81
  nabu/io/detector_distortion.py,sha256=Or4icugi0fGRKWIG0I9hCuR1UZA5Cel25ZGY7cR2j4I,11744
82
82
  nabu/io/reader.py,sha256=McWg7w04zrI0mt2z-BBwUr7rryMWYjdg7aHqbNeZ45A,40518
83
83
  nabu/io/reader_helical.py,sha256=_6vZBH-US_VT7oOGJUtYXqPwFws7xZKcmdOthpwvlIQ,4477
@@ -221,9 +221,9 @@ nabu/processing/tests/test_transpose.py,sha256=hTG17wTaB5Wv6twbW3ZFhBv6BYfqJY7DT
221
221
  nabu/processing/tests/test_unsharp.py,sha256=R3ovbwDDp3ccy2A8t6CcUVELXRWkED5EnQdN2FQOfQM,4391
222
222
  nabu/reconstruction/__init__.py,sha256=EmKVvx_-FJvzJngG4ielIC7FhMCpI1Waaflg_lF44tk,163
223
223
  nabu/reconstruction/cone.py,sha256=RZj1JoxqskShvglgxUnsbYw7qbm6Rralt7hJ96eU-8c,19015
224
- nabu/reconstruction/fbp.py,sha256=uwEniGdEOn1atc9mTAHEDeF1y-ZqneifCKVr-ieHZss,5015
225
- nabu/reconstruction/fbp_base.py,sha256=DwZCilPXgGMRPV8_XfkWiaXUzWFM8rNBa8IyMdy5nno,17092
226
- nabu/reconstruction/fbp_opencl.py,sha256=coEGLq65PCuvWnhAbIyLPHACkWjMB0XOceMp9ZIDWtc,3274
224
+ nabu/reconstruction/fbp.py,sha256=iXC9M91DWq3SauZa44iWkSBcy6YIxmmjx1PyIOLFCTk,5179
225
+ nabu/reconstruction/fbp_base.py,sha256=Mh7brqiCsfPLMI2-OU4g0PafG7qq2mYR1TJYizemC_4,17059
226
+ nabu/reconstruction/fbp_opencl.py,sha256=U-XP7v1m1lJ1ulvlF8tclJfEOWmZLCT1hevIw4gsNec,3497
227
227
  nabu/reconstruction/filtering.py,sha256=fg_loze-VkiFqBAqQ7AGkKwCDz-5UskSSh27klaakD0,8659
228
228
  nabu/reconstruction/filtering_cuda.py,sha256=syKp_CHzMjM4sBSK0JI5k5Ag3xzROvM15FfOO48ssDo,4041
229
229
  nabu/reconstruction/filtering_opencl.py,sha256=B9zcvSxvt3KMxEXxoirop1vfqM0kSRP-LhvGgqDGQlA,3957
@@ -262,7 +262,6 @@ nabu/resources/templates/id16_holo.conf,sha256=sDd_rEJGZjOGVAsGub5sT2arfXDnc_sxy
262
262
  nabu/resources/templates/id16a_fluo.conf,sha256=Nz1etzO2fSwksi7CThWJ5T1kZEdyBe8rMO7puNJ93Hc,542
263
263
  nabu/resources/templates/id19_pag.conf,sha256=u4fFPEBprzOW9_5_ChkIgowQcYpLhjmA8Gwm5XgC4Jc,384
264
264
  nabu/resources/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
265
- nabu/resources/tests/test_extract.py,sha256=msYWFP96LjpEntq1ucTWgKZMhUvZcLpJ-AQB3oGOh2E,206
266
265
  nabu/resources/tests/test_nxflatfield.py,sha256=XRGbYwqJv0NYAVQnAB224TwTZP_W2Bs3-yu0zQnDzEM,4179
267
266
  nabu/resources/tests/test_units.py,sha256=F2jFTck-1UwYET1MwTtX6ntzYUosfwOJkugSencGgz8,2155
268
267
  nabu/stitching/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -310,9 +309,9 @@ nabu/thirdparty/pore3d_deringer_munch.py,sha256=o4bisnFc-wMjuohWBT8wgWmfNehPQGtC
310
309
  nabu/thirdparty/tomocupy_remove_stripe.py,sha256=Khe4zFf0kRzu65Yxnvq58gt1ljOztqJGdMDhVAiM7lM,24363
311
310
  nabu/thirdparty/tomopy_phase.py,sha256=hK4oPpkogLOhv23XzzEXQY2u3r8fJvASY_bINVs6ERE,8634
312
311
  nabu/thirdparty/tomwer_load_flats_darks.py,sha256=ZNoVAinUb_wGYbfvs_4BVnWsjsQmNxSvCh1bWhR2WWg,5611
313
- nabu-2024.2.12.dist-info/licenses/LICENSE,sha256=1eAIPSnEsnSFNUODnLtNtQTs76exG3ZxJ1DJR6zoUBA,1066
314
- nabu-2024.2.12.dist-info/METADATA,sha256=js11kdh6t1G64wHG9VEC9Pjhxb2305HB5GrmmkkPSX0,4266
315
- nabu-2024.2.12.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
316
- nabu-2024.2.12.dist-info/entry_points.txt,sha256=cJKGkBeykVL7uK3E4R0RLRqMXifTL2qdO573syPAvJc,1288
317
- nabu-2024.2.12.dist-info/top_level.txt,sha256=fsm_N3eXLRZk2QXF9OSKPNDPFXOz8FAQjHh5avT3dok,9
318
- nabu-2024.2.12.dist-info/RECORD,,
312
+ nabu-2024.2.14.dist-info/licenses/LICENSE,sha256=1eAIPSnEsnSFNUODnLtNtQTs76exG3ZxJ1DJR6zoUBA,1066
313
+ nabu-2024.2.14.dist-info/METADATA,sha256=jZjH6LPbNHttKwjr2bJ8j5NG6QrKruR9R3PdlTIKw9w,4266
314
+ nabu-2024.2.14.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
315
+ nabu-2024.2.14.dist-info/entry_points.txt,sha256=cJKGkBeykVL7uK3E4R0RLRqMXifTL2qdO573syPAvJc,1288
316
+ nabu-2024.2.14.dist-info/top_level.txt,sha256=fsm_N3eXLRZk2QXF9OSKPNDPFXOz8FAQjHh5avT3dok,9
317
+ nabu-2024.2.14.dist-info/RECORD,,
@@ -1,9 +0,0 @@
1
- from nabu.utils import list_match_queries
2
-
3
-
4
- def test_list_match_queries():
5
-
6
- # entry0000 .... entry0099
7
- avail = ["entry%04d" % i for i in range(100)]
8
- query = "entry0000"
9
- list_match_queries()