nabu 2024.1.6__py3-none-any.whl → 2024.1.7__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.1.6"
1
+ __version__ = "2024.1.7"
2
2
  __nabu_modules__ = [
3
3
  "app",
4
4
  "cuda",
@@ -548,7 +548,6 @@ class ChunkedPipeline:
548
548
 
549
549
  if options["method"] == "FBP":
550
550
  n_slices = self.n_slices
551
- radios_shape_for_sino_builder = self.radios_cropped_shape
552
551
  self.reconstruction = self.FBPClass(
553
552
  self.sinos_shape[1:],
554
553
  angles=options["angles"],
@@ -567,7 +566,6 @@ class ChunkedPipeline:
567
566
  )
568
567
 
569
568
  if options["method"] == "cone":
570
- radios_shape_for_sino_builder = self.radios_shape
571
569
  n_slices = self.n_slices + sum(self.margin[0])
572
570
  # For numerical stability, normalize all lengths with respect to detector pixel size
573
571
  pixel_size_m = self.dataset_info.pixel_size * 1e-6
@@ -586,8 +584,6 @@ class ChunkedPipeline:
586
584
  self._allocate_recs(*self.process_config.rec_shape, n_slices=n_slices)
587
585
  n_a, _, n_x = self.radios_cropped_shape
588
586
  self._tmp_sino = self._allocate_array((n_a, n_x), "f", name="tmp_sino")
589
- if options["method"] == "cone":
590
- self.sinos = self._allocate_array(self.sino_builder.output_shape, "f", name="sinos")
591
587
 
592
588
  @use_options("histogram", "histogram")
593
589
  def _init_histogram(self):
@@ -734,14 +730,21 @@ class ChunkedPipeline:
734
730
  """
735
731
  This reconstructs the entire sinograms stack at once
736
732
  """
737
- self.sino_builder.get_sinos(self.radios, output=self.sinos)
733
+
734
+ n_angles, n_z, n_x = self.radios.shape
735
+ # can't do a discontiguous single copy...
736
+ sinos_contig = self._allocate_array((n_z, n_angles, n_x), np.float32, "sinos_cone")
737
+ for i in range(n_z):
738
+ sinos_contig[i] = self.radios[:, i, :]
739
+ #
740
+
738
741
  z_min, z_max = self.sub_region_xz[2:]
739
- n_z = self.process_config.radio_shape(binning=True)[0]
742
+ n_z_tot = self.process_config.radio_shape(binning=True)[0]
740
743
 
741
744
  self.reconstruction.reconstruct( # pylint: disable=E1101
742
- self.sinos,
745
+ sinos_contig,
743
746
  output=self.recs,
744
- relative_z_position=((z_min + z_max) / self.process_config.binning_z / 2) - n_z / 2,
747
+ relative_z_position=((z_min + z_max) / self.process_config.binning_z / 2) - n_z_tot / 2,
745
748
  )
746
749
 
747
750
  @pipeline_step("histogram", "Computing histogram")
@@ -29,7 +29,7 @@ class FullFieldDatasetValidator(DatasetValidatorBase):
29
29
  def _check_slice_indices(self):
30
30
  nx, nz = self.dataset_info.radio_dims
31
31
  rec_params = self.rec_params
32
- if rec_params["enable_halftomo"]:
32
+ if self.is_halftomo:
33
33
  ny, nx = self._get_nx_ny()
34
34
  what = (("start_x", "end_x", nx), ("start_y", "end_y", nx), ("start_z", "end_z", nz))
35
35
  for start_name, end_name, numels in what:
@@ -61,3 +61,7 @@ class FullFieldDatasetValidator(DatasetValidatorBase):
61
61
  self.logger.warning(
62
62
  "Cone-beam reconstruction: 'sample_detector_dist' not provided, will use the one in dataset metadata"
63
63
  )
64
+ if self.is_halftomo:
65
+ err_msg = "Cone-beam reconstruction with half-acquisition is not supported yet"
66
+ self.logger.fatal(err_msg)
67
+ raise NotImplementedError(err_msg)
@@ -600,7 +600,7 @@ class ProcessConfig(ProcessConfigBase):
600
600
  )
601
601
  if all([m is not None for m in mean_positions_xyz]):
602
602
  rec_options["position"] = mean_positions_xyz
603
- if rec_options["sample_detector_dist"] is None:
603
+ if rec_options["method"] == "cone" and rec_options["sample_detector_dist"] is None:
604
604
  rec_options["sample_detector_dist"] = self.dataset_info.distance # was checked to be not None earlier
605
605
 
606
606
  # New key
@@ -1,5 +1,5 @@
1
1
  from nabu.pipeline.helical import gridded_accumulator, span_strategy
2
- from nabu.testutils import get_data
2
+ from nabu.testutils import get_data, __do_long_tests__
3
3
 
4
4
  import pytest
5
5
  import numpy as np
@@ -49,6 +49,7 @@ def bootstrap(request):
49
49
  cls.rtol_regridded = 1.0e-6
50
50
 
51
51
 
52
+ @pytest.mark.skipif(not (__do_long_tests__), reason="need environment variable NABU_LONG_TESTS=1")
52
53
  @pytest.mark.usefixtures("bootstrap")
53
54
  class TestGriddedAccumulator:
54
55
  """
@@ -181,7 +181,10 @@ class ProcessConfigBase:
181
181
  #
182
182
  if isinstance(tilt, str): # auto-tilt
183
183
  self.tilt_estimator = DetectorTiltEstimator(
184
- self.dataset_info, logger=self.logger, autotilt_options=self.nabu_config["preproc"]["autotilt_options"]
184
+ self.dataset_info,
185
+ do_flatfield=self.nabu_config["preproc"]["flatfield"],
186
+ logger=self.logger,
187
+ autotilt_options=self.nabu_config["preproc"]["autotilt_options"],
185
188
  )
186
189
  tilt = self.tilt_estimator.find_tilt(tilt_method=tilt)
187
190
  self.dataset_info.detector_tilt = tilt
@@ -31,6 +31,7 @@ def bootstrap(request):
31
31
  cls.cu_ctx.pop()
32
32
 
33
33
 
34
+ @pytest.mark.skip(reason="OpenCL fftshift is a prototype")
34
35
  @pytest.mark.usefixtures("bootstrap")
35
36
  class TestFFTshift:
36
37
  def _do_test_fftshift(self, config, fftshift_cls):
@@ -1,7 +1,7 @@
1
1
  import numpy as np
2
2
  import pytest
3
3
  from nabu.reconstruction.rings_cuda import CudaSinoMeanDeringer
4
- from nabu.testutils import compare_arrays, get_data, generate_tests_scenarios, __do_long_tests__
4
+ from nabu.testutils import compare_arrays, get_data, generate_tests_scenarios, __do_long_tests__, __do_large_mem_tests__
5
5
  from nabu.reconstruction.rings import MunchDeringer, SinoMeanDeringer, VoDeringer, __has_algotom__
6
6
  from nabu.thirdparty.pore3d_deringer_munch import munchetal_filter
7
7
  from nabu.cuda.utils import __has_pycuda__, get_cuda_context
@@ -144,8 +144,8 @@ class TestMunchDeringer:
144
144
  # TODO check result. The generated test sinogram is "too synthetic" for this kind of deringer
145
145
 
146
146
  @pytest.mark.skipif(
147
- not (__have_tomocupy_deringer__),
148
- reason="Need cupy for this test",
147
+ not (__have_tomocupy_deringer__ and __do_large_mem_tests__),
148
+ reason="Need cupy for this test, and use NABU_LARGE_MEM_TESTS",
149
149
  )
150
150
  def test_cuda_vo_deringer(self):
151
151
  # Beware, this deringer seems to be buggy for "too-small" sinograms
@@ -3,10 +3,11 @@ import pytest
3
3
  from nabu.testutils import get_data, generate_tests_scenarios, compare_shifted_images
4
4
  from nabu.cuda.utils import get_cuda_context, __has_pycuda__, __has_cufft__
5
5
  from nabu.opencl.utils import get_opencl_context, __has_pyopencl__
6
+ from nabu.processing.fft_opencl import has_vkfft as has_vkfft_cl
6
7
  from nabu.thirdparty.algotom_convert_sino import extend_sinogram
7
8
 
8
9
  __has_pycuda__ = __has_pycuda__ and __has_cufft__ # need both for using Cuda backprojector
9
-
10
+ __has_pyopencl__ = __has_pyopencl__ and has_vkfft_cl()
10
11
 
11
12
  if __has_pycuda__:
12
13
  from nabu.reconstruction.fbp import CudaBackprojector
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nabu
3
- Version: 2024.1.6
3
+ Version: 2024.1.7
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=R001g25kFvEVDDeajbatTdAG1ufFI08DldAcf4ADwF4,270
4
+ nabu/__init__.py,sha256=syNuJVNxIJSDQ2NM6gqCh37LvuExshXotfyhoQEwQhc,270
5
5
  nabu/tests.py,sha256=cew9OY2uTyncHI_HM32W8CP6B1GTGKaOW65XtMEqs7o,1417
6
6
  nabu/testutils.py,sha256=qqtGgkIhpOpXhgeoXlqCb91Rx-JlI4ALaDF6nt8YRRk,13298
7
7
  nabu/utils.py,sha256=w-xfRb6TFQpS-tao6nlvfmr962pmeec-WH1GltSUCrk,23767
@@ -132,16 +132,16 @@ nabu/pipeline/detector_distortion_provider.py,sha256=ru1AxbcuO-FA8FYooPBWgp1lzdS
132
132
  nabu/pipeline/estimators.py,sha256=4V5pwl5vUFMJDanWnmw7POnSsa9lKyKtUzvq9GLcJwc,41374
133
133
  nabu/pipeline/fallback_utils.py,sha256=7ccrKYE-rp3fydb72VA6W0_eKcEoqYBEAPlmij_lyEc,6086
134
134
  nabu/pipeline/params.py,sha256=VdrekcxOnbrMzvvLcwEWINiMM0uVKmPxJJBwp3lhHBg,3479
135
- nabu/pipeline/processconfig.py,sha256=3wCobeC_gI9OTO7v0Hk-IeEJUdKoavK-OzKLd1da5Dg,8216
135
+ nabu/pipeline/processconfig.py,sha256=O0phgvfWtL9bg3_GE3cw9MZXS8PUy8z2rzhpoqP9U84,8320
136
136
  nabu/pipeline/utils.py,sha256=NONAgBfTfUYvBNfoTqD33MAYaPZyCJL10SnR6B0lLec,3462
137
137
  nabu/pipeline/writer.py,sha256=0ts40VNN3RiRURvZ2gNqsigsAJuwcjnYF4RJ15qaMpI,7558
138
138
  nabu/pipeline/fullfield/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
139
- nabu/pipeline/fullfield/chunked.py,sha256=qGE9gpww2zPbtPeM1Fe0RPRhl3onqxs8fr3HRug-x6I,36919
139
+ nabu/pipeline/fullfield/chunked.py,sha256=DdmSXI9BnWPrXG99MbzqQdJrh0DHlkuM8Dnv5xWkcM0,36873
140
140
  nabu/pipeline/fullfield/chunked_cuda.py,sha256=aGzjY8MX6OL8auEj6Y0RfOGCmFnczsdfj6-8Net5AbQ,5645
141
141
  nabu/pipeline/fullfield/computations.py,sha256=VpIURVXh8EpNSfait_AIFM4Ci-GK_546Wkb-Wn9r31Y,9935
142
- nabu/pipeline/fullfield/dataset_validator.py,sha256=sRgUECUc8aOjFbwrW-dHjvIf7K3T40YPSIgt3cInKAc,3055
142
+ nabu/pipeline/fullfield/dataset_validator.py,sha256=8B2lB9j7elF_NmOOOyr8UADVfC15Oofzy2AyWoPufQM,3265
143
143
  nabu/pipeline/fullfield/nabu_config.py,sha256=a0mMoLkvlvHgX6RmUS1m1UhJS-XB3O6wBCnkNoI90Cs,30358
144
- nabu/pipeline/fullfield/processconfig.py,sha256=ad2lmo-cCkzfDJqMd__FhbfIInndTxQsLdgH9Ec9Tzc,36107
144
+ nabu/pipeline/fullfield/processconfig.py,sha256=TKQeHyImp5blhP4_lve8g5voDjSKAMNv7kelyB3e698,36143
145
145
  nabu/pipeline/fullfield/reconstruction.py,sha256=Km_ZDtoiDQdX3TdTh6E9bzS5hoMC0jYU5eZWodaLbIg,36627
146
146
  nabu/pipeline/helical/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
147
147
  nabu/pipeline/helical/dataset_validator.py,sha256=0YQc0hdYdpaXznFaKmlj9SIu7mNs0xXMejcRkhOZHaI,640
@@ -158,7 +158,7 @@ nabu/pipeline/helical/span_strategy.py,sha256=7zV_Oo_liFiuv6m70o08XyoEIo_7QYs7MV
158
158
  nabu/pipeline/helical/utils.py,sha256=51Qbh8db6-DX0iB9B9Kb07uwIG6_upAJg_8nhyzbB7o,1555
159
159
  nabu/pipeline/helical/weight_balancer.py,sha256=j0TGe50tbbsilQvml9CgMxeSy83CNaifHj-xuMGl8uE,3981
160
160
  nabu/pipeline/helical/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
161
- nabu/pipeline/helical/tests/test_accumulator.py,sha256=nNHwqUgSyUpdZVYNVyxqekj0SoThCF8s-8o3NfSw6vI,6416
161
+ nabu/pipeline/helical/tests/test_accumulator.py,sha256=DCwTAWQLdUNJBJpjhHT8o1gLbznpuj_zqbQOfQnrShw,6534
162
162
  nabu/pipeline/helical/tests/test_pipeline_elements_full.py,sha256=zeR9SaeD0mnhtKU7qo4Qrn_lg1I1Vhg4dqzj6jy8tpg,14569
163
163
  nabu/pipeline/helical/tests/test_strategy.py,sha256=rt8SsUHBMMcVFl48kRGcOyf1y4bYqaA2xDznQxE7wFs,2721
164
164
  nabu/pipeline/tests/test_chunk_reader.py,sha256=OB279hSvgmVhWv_OauZNWTJeaaiheETayGYK79Op10Q,3410
@@ -213,7 +213,7 @@ nabu/processing/unsharp_cuda.py,sha256=tbgw3selI4x4qsSxyQJ8Q4HUxdEBbZOJtSys-0yzj
213
213
  nabu/processing/unsharp_opencl.py,sha256=ikmZhQB-kji3UFrvFzHJNvDUpaVSpzcCJRX_bqSQeGQ,2637
214
214
  nabu/processing/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
215
215
  nabu/processing/tests/test_fft.py,sha256=zDGDTXZjHBVbiVFiQfkrkYFFMyotJRFU-KgoNm1FGms,9827
216
- nabu/processing/tests/test_fftshift.py,sha256=90QlNO62pN9P_oY54JYrPX5pLjzO5SSC4ZEyr5F__hQ,2559
216
+ nabu/processing/tests/test_fftshift.py,sha256=-XgJUm0eF3D-rMTlI9u3jaWYIlPFZEpM0PwW3SMDLG0,2618
217
217
  nabu/processing/tests/test_histogram.py,sha256=25CLs1WZpLF9xZ2DR82x4_YokA5Z76Qsnn6zY8YdJj8,2283
218
218
  nabu/processing/tests/test_medfilt.py,sha256=lVfLWIxWiLfODFc14WYbq1W02rgQDtCnrSgXnWgU6yU,2722
219
219
  nabu/processing/tests/test_muladd.py,sha256=cRhAC5hgmRV0BAwPA4o4M-kcx-UDniLK7sSyiN0F3kE,1927
@@ -240,10 +240,10 @@ nabu/reconstruction/sinogram_cuda.py,sha256=wS84AIy3T00d1kTtuJOQmA3hktbDVs4ybwB9
240
240
  nabu/reconstruction/sinogram_opencl.py,sha256=p793N26VknU8KIZLtDgFY6HNx0TylemZ1YL4WKD3fHs,1403
241
241
  nabu/reconstruction/tests/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
242
242
  nabu/reconstruction/tests/test_cone.py,sha256=R9Q-o9jz5ZBRwpGRRDwWr4owrrI3bJow5f_x_toq_lw,11813
243
- nabu/reconstruction/tests/test_deringer.py,sha256=u7HTMKH0DiZ1JAs68svi7eOCQt_sgxpXH6RQ12rDaVE,8299
243
+ nabu/reconstruction/tests/test_deringer.py,sha256=C5wj6RNzmpt_Cry4fonC8KXWvgPpcXfRbG8Bex_30S4,8380
244
244
  nabu/reconstruction/tests/test_fbp.py,sha256=p80zPCZkgJpERpqG5HHfbtbHBeqJUT8WY-q6FXOJJ7M,10053
245
245
  nabu/reconstruction/tests/test_filtering.py,sha256=PFJLQMDBQo-UuS_CfKrWZ_DdHarmVlcbsiZ_kmToWXY,4782
246
- nabu/reconstruction/tests/test_halftomo.py,sha256=rdPY4oL8JTJqDzpn-pdqjDp72pN39-5DipKqBTyyBxo,4171
246
+ nabu/reconstruction/tests/test_halftomo.py,sha256=j-vq9Oyxl7dYGuAMMO2G-Y7EcryD1RGEyXqmycc0o_8,4290
247
247
  nabu/reconstruction/tests/test_projector.py,sha256=W4zntShzL47HjMGQG11zIYzMXwX0KfMN4BVIAapdy_I,6033
248
248
  nabu/reconstruction/tests/test_reconstructor.py,sha256=dEGqlQHfFwX_V2Ybnq5AAM5tprXn_2OuCSrC6cW4S0A,3221
249
249
  nabu/reconstruction/tests/test_sino_normalization.py,sha256=fGv5Dlidxgm8ZC70Nk6oqVgpY2jzOW9NJaGlo44IJOo,3692
@@ -288,9 +288,9 @@ nabu/thirdparty/pore3d_deringer_munch.py,sha256=o4bisnFc-wMjuohWBT8wgWmfNehPQGtC
288
288
  nabu/thirdparty/tomocupy_remove_stripe.py,sha256=VgXHr2tzTAAGZix5pwhFfbPxj4tt3yXBcjCPNQSLPAg,22810
289
289
  nabu/thirdparty/tomopy_phase.py,sha256=hK4oPpkogLOhv23XzzEXQY2u3r8fJvASY_bINVs6ERE,8634
290
290
  nabu/thirdparty/tomwer_load_flats_darks.py,sha256=ZNoVAinUb_wGYbfvs_4BVnWsjsQmNxSvCh1bWhR2WWg,5611
291
- nabu-2024.1.6.dist-info/LICENSE,sha256=1eAIPSnEsnSFNUODnLtNtQTs76exG3ZxJ1DJR6zoUBA,1066
292
- nabu-2024.1.6.dist-info/METADATA,sha256=ogaBqKAavm40N8GeX3XPDsRTwKm12-BgSfbB3HuR7ag,5224
293
- nabu-2024.1.6.dist-info/WHEEL,sha256=5sUXSg9e4bi7lTLOHcm6QEYwO5TIF1TNbTSVFVjcJcc,92
294
- nabu-2024.1.6.dist-info/entry_points.txt,sha256=cJKGkBeykVL7uK3E4R0RLRqMXifTL2qdO573syPAvJc,1288
295
- nabu-2024.1.6.dist-info/top_level.txt,sha256=fsm_N3eXLRZk2QXF9OSKPNDPFXOz8FAQjHh5avT3dok,9
296
- nabu-2024.1.6.dist-info/RECORD,,
291
+ nabu-2024.1.7.dist-info/LICENSE,sha256=1eAIPSnEsnSFNUODnLtNtQTs76exG3ZxJ1DJR6zoUBA,1066
292
+ nabu-2024.1.7.dist-info/METADATA,sha256=_Bv8vjCsYa3a926AT-jJHgEkvMprSL5LYjRNDbhzpiA,5224
293
+ nabu-2024.1.7.dist-info/WHEEL,sha256=5sUXSg9e4bi7lTLOHcm6QEYwO5TIF1TNbTSVFVjcJcc,92
294
+ nabu-2024.1.7.dist-info/entry_points.txt,sha256=cJKGkBeykVL7uK3E4R0RLRqMXifTL2qdO573syPAvJc,1288
295
+ nabu-2024.1.7.dist-info/top_level.txt,sha256=fsm_N3eXLRZk2QXF9OSKPNDPFXOz8FAQjHh5avT3dok,9
296
+ nabu-2024.1.7.dist-info/RECORD,,