nabu 2024.1.6__tar.gz → 2024.1.8__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 (333) hide show
  1. {nabu-2024.1.6/nabu.egg-info → nabu-2024.1.8}/PKG-INFO +22 -2
  2. nabu-2024.1.8/doc/doc_config.py +32 -0
  3. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/__init__.py +1 -1
  4. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/pipeline/fullfield/chunked.py +18 -10
  5. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/pipeline/fullfield/dataset_validator.py +5 -1
  6. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/pipeline/fullfield/processconfig.py +8 -3
  7. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/pipeline/fullfield/reconstruction.py +10 -0
  8. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/pipeline/helical/tests/test_accumulator.py +2 -1
  9. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/pipeline/processconfig.py +4 -1
  10. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/processing/tests/test_fftshift.py +1 -0
  11. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/reconstruction/cone.py +22 -1
  12. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/reconstruction/tests/test_cone.py +61 -2
  13. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/reconstruction/tests/test_deringer.py +3 -3
  14. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/reconstruction/tests/test_halftomo.py +2 -1
  15. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/stitching/tests/test_z_stitching.py +0 -13
  16. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/stitching/z_stitching.py +1 -1
  17. {nabu-2024.1.6 → nabu-2024.1.8/nabu.egg-info}/PKG-INFO +22 -2
  18. {nabu-2024.1.6 → nabu-2024.1.8}/nabu.egg-info/SOURCES.txt +33 -2
  19. {nabu-2024.1.6 → nabu-2024.1.8}/nabu.egg-info/requires.txt +2 -2
  20. {nabu-2024.1.6 → nabu-2024.1.8}/nabu.egg-info/top_level.txt +1 -1
  21. {nabu-2024.1.6 → nabu-2024.1.8}/pyproject.toml +2 -2
  22. nabu-2024.1.8/sandbox/align_test.py +61 -0
  23. nabu-2024.1.8/sandbox/app.py +123 -0
  24. nabu-2024.1.8/sandbox/binning_cython.py +37 -0
  25. nabu-2024.1.8/sandbox/circ_sm.py +195 -0
  26. nabu-2024.1.8/sandbox/composite_image.py +90 -0
  27. nabu-2024.1.8/sandbox/convert_id15.py +148 -0
  28. nabu-2024.1.8/sandbox/do_test_ctf.py +40 -0
  29. nabu-2024.1.8/sandbox/esrf_envs.py +36 -0
  30. nabu-2024.1.8/sandbox/fbp_polar.py +39 -0
  31. nabu-2024.1.8/sandbox/fbp_tilt.py +340 -0
  32. nabu-2024.1.8/sandbox/interleaved.py +129 -0
  33. nabu-2024.1.8/sandbox/interp_sinos_halftomo.py +31 -0
  34. nabu-2024.1.8/sandbox/linear_interp.py +14 -0
  35. nabu-2024.1.8/sandbox/merge_recs.py +56 -0
  36. nabu-2024.1.8/sandbox/moduleutils.py +50 -0
  37. nabu-2024.1.8/sandbox/nbreconstruct.py +246 -0
  38. nabu-2024.1.8/sandbox/pag_margin.py +38 -0
  39. nabu-2024.1.8/sandbox/parse.py +132 -0
  40. nabu-2024.1.8/sandbox/plot.py +49 -0
  41. nabu-2024.1.8/sandbox/proj3D.py +75 -0
  42. nabu-2024.1.8/sandbox/rec_bm05.py +71 -0
  43. nabu-2024.1.8/sandbox/rec_thread.py +133 -0
  44. nabu-2024.1.8/sandbox/shift_bilinear2.py +42 -0
  45. nabu-2024.1.8/sandbox/sinotilt.py +181 -0
  46. nabu-2024.1.8/sandbox/sysutils.py +63 -0
  47. nabu-2024.1.8/sandbox/test_mp_queue.py +73 -0
  48. nabu-2024.1.8/sandbox/tilt.py +251 -0
  49. nabu-2024.1.8/sandbox/utils.py +54 -0
  50. nabu-2024.1.8/sandbox/vo.py +204 -0
  51. nabu-2024.1.8/sandbox/workers.py +123 -0
  52. nabu-2024.1.8/sandbox/xrdrec_pyFAI_data.py +212 -0
  53. nabu-2024.1.6/nabu/thirdparty/__init__.py +0 -0
  54. {nabu-2024.1.6 → nabu-2024.1.8}/LICENSE +0 -0
  55. {nabu-2024.1.6 → nabu-2024.1.8}/README.md +0 -0
  56. {nabu-2024.1.6 → nabu-2024.1.8}/doc/conf.py +0 -0
  57. {nabu-2024.1.6 → nabu-2024.1.8}/doc/create_conf_doc.py +0 -0
  58. {nabu-2024.1.6 → nabu-2024.1.8}/doc/get_mathjax.py +0 -0
  59. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/app/__init__.py +0 -0
  60. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/app/bootstrap.py +0 -0
  61. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/app/bootstrap_stitching.py +0 -0
  62. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/app/cast_volume.py +0 -0
  63. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/app/cli_configs.py +0 -0
  64. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/app/compare_volumes.py +0 -0
  65. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/app/composite_cor.py +0 -0
  66. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/app/correct_rot.py +0 -0
  67. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/app/create_distortion_map_from_poly.py +0 -0
  68. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/app/diag_to_pix.py +0 -0
  69. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/app/diag_to_rot.py +0 -0
  70. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/app/double_flatfield.py +0 -0
  71. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/app/generate_header.py +0 -0
  72. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/app/histogram.py +0 -0
  73. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/app/multicor.py +0 -0
  74. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/app/nx_z_splitter.py +0 -0
  75. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/app/parse_reconstruction_log.py +0 -0
  76. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/app/prepare_weights_double.py +0 -0
  77. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/app/reconstruct.py +0 -0
  78. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/app/reconstruct_helical.py +0 -0
  79. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/app/reduce_dark_flat.py +0 -0
  80. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/app/rotate.py +0 -0
  81. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/app/shrink_dataset.py +0 -0
  82. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/app/stitching.py +0 -0
  83. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/app/tests/test_reduce_dark_flat.py +0 -0
  84. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/app/utils.py +0 -0
  85. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/app/validator.py +0 -0
  86. {nabu-2024.1.6/nabu/app/tests → nabu-2024.1.8/nabu/cuda}/__init__.py +0 -0
  87. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/cuda/convolution.py +0 -0
  88. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/cuda/fft.py +0 -0
  89. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/cuda/kernel.py +0 -0
  90. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/cuda/medfilt.py +0 -0
  91. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/cuda/padding.py +0 -0
  92. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/cuda/processing.py +0 -0
  93. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/cuda/src/ElementOp.cu +0 -0
  94. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/cuda/src/backproj.cu +0 -0
  95. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/cuda/src/backproj_polar.cu +0 -0
  96. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/cuda/src/boundary.h +0 -0
  97. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/cuda/src/convolution.cu +0 -0
  98. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/cuda/src/dfi_fftshift.cu +0 -0
  99. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/cuda/src/flatfield.cu +0 -0
  100. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/cuda/src/fourier_wavelets.cu +0 -0
  101. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/cuda/src/halftomo.cu +0 -0
  102. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/cuda/src/helical_padding.cu +0 -0
  103. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/cuda/src/histogram.cu +0 -0
  104. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/cuda/src/interpolation.cu +0 -0
  105. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/cuda/src/medfilt.cu +0 -0
  106. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/cuda/src/normalization.cu +0 -0
  107. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/cuda/src/padding.cu +0 -0
  108. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/cuda/src/proj.cu +0 -0
  109. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/cuda/src/rotation.cu +0 -0
  110. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/cuda/src/transpose.cu +0 -0
  111. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/cuda/tests/__init__.py +0 -0
  112. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/cuda/utils.py +0 -0
  113. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/estimation/__init__.py +0 -0
  114. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/estimation/alignment.py +0 -0
  115. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/estimation/cor.py +0 -0
  116. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/estimation/cor_sino.py +0 -0
  117. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/estimation/distortion.py +0 -0
  118. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/estimation/focus.py +0 -0
  119. {nabu-2024.1.6/nabu/cuda → nabu-2024.1.8/nabu/estimation/tests}/__init__.py +0 -0
  120. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/estimation/tests/test_alignment.py +0 -0
  121. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/estimation/tests/test_cor.py +0 -0
  122. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/estimation/tests/test_focus.py +0 -0
  123. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/estimation/tests/test_tilt.py +0 -0
  124. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/estimation/tests/test_translation.py +0 -0
  125. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/estimation/tilt.py +0 -0
  126. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/estimation/translation.py +0 -0
  127. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/estimation/utils.py +0 -0
  128. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/io/__init__.py +0 -0
  129. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/io/cast_volume.py +0 -0
  130. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/io/detector_distortion.py +0 -0
  131. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/io/reader.py +0 -0
  132. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/io/reader_helical.py +0 -0
  133. {nabu-2024.1.6/nabu/estimation → nabu-2024.1.8/nabu/io}/tests/__init__.py +0 -0
  134. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/io/tests/test_cast_volume.py +0 -0
  135. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/io/tests/test_detector_distortion.py +0 -0
  136. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/io/tests/test_writers.py +0 -0
  137. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/io/tiffwriter_zmm.py +0 -0
  138. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/io/utils.py +0 -0
  139. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/io/writer.py +0 -0
  140. {nabu-2024.1.6/nabu/io/tests → nabu-2024.1.8/nabu/misc}/__init__.py +0 -0
  141. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/misc/binning.py +0 -0
  142. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/misc/fftshift.py +0 -0
  143. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/misc/filters.py +0 -0
  144. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/misc/fourier_filters.py +0 -0
  145. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/misc/histogram.py +0 -0
  146. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/misc/histogram_cuda.py +0 -0
  147. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/misc/kernel_base.py +0 -0
  148. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/misc/padding.py +0 -0
  149. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/misc/padding_base.py +0 -0
  150. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/misc/processing_base.py +0 -0
  151. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/misc/rotation.py +0 -0
  152. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/misc/rotation_cuda.py +0 -0
  153. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/misc/tests/__init__.py +0 -0
  154. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/misc/tests/test_binning.py +0 -0
  155. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/misc/tests/test_interpolation.py +0 -0
  156. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/misc/transpose.py +0 -0
  157. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/misc/unsharp.py +0 -0
  158. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/misc/unsharp_cuda.py +0 -0
  159. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/misc/unsharp_opencl.py +0 -0
  160. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/misc/utils.py +0 -0
  161. {nabu-2024.1.6/nabu/misc → nabu-2024.1.8/nabu/opencl}/__init__.py +0 -0
  162. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/opencl/fft.py +0 -0
  163. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/opencl/kernel.py +0 -0
  164. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/opencl/memcpy.py +0 -0
  165. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/opencl/padding.py +0 -0
  166. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/opencl/processing.py +0 -0
  167. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/opencl/src/ElementOp.cl +0 -0
  168. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/opencl/src/backproj.cl +0 -0
  169. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/opencl/src/fftshift.cl +0 -0
  170. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/opencl/src/halftomo.cl +0 -0
  171. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/opencl/src/padding.cl +0 -0
  172. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/opencl/src/roll.cl +0 -0
  173. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/opencl/src/transpose.cl +0 -0
  174. {nabu-2024.1.6/nabu/opencl → nabu-2024.1.8/nabu/opencl/tests}/__init__.py +0 -0
  175. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/opencl/utils.py +0 -0
  176. {nabu-2024.1.6/nabu/opencl/tests → nabu-2024.1.8/nabu/pipeline}/__init__.py +0 -0
  177. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/pipeline/config.py +0 -0
  178. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/pipeline/config_validators.py +0 -0
  179. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/pipeline/datadump.py +0 -0
  180. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/pipeline/dataset_validator.py +0 -0
  181. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/pipeline/detector_distortion_provider.py +0 -0
  182. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/pipeline/estimators.py +0 -0
  183. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/pipeline/fallback_utils.py +0 -0
  184. {nabu-2024.1.6/nabu/pipeline → nabu-2024.1.8/nabu/pipeline/fullfield}/__init__.py +0 -0
  185. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/pipeline/fullfield/chunked_cuda.py +0 -0
  186. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/pipeline/fullfield/computations.py +0 -0
  187. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/pipeline/fullfield/nabu_config.py +0 -0
  188. {nabu-2024.1.6/nabu/pipeline/fullfield → nabu-2024.1.8/nabu/pipeline/helical}/__init__.py +0 -0
  189. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/pipeline/helical/dataset_validator.py +0 -0
  190. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/pipeline/helical/fbp.py +0 -0
  191. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/pipeline/helical/filtering.py +0 -0
  192. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/pipeline/helical/gridded_accumulator.py +0 -0
  193. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/pipeline/helical/helical_chunked_regridded.py +0 -0
  194. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/pipeline/helical/helical_chunked_regridded_cuda.py +0 -0
  195. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/pipeline/helical/helical_reconstruction.py +0 -0
  196. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/pipeline/helical/helical_utils.py +0 -0
  197. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/pipeline/helical/nabu_config.py +0 -0
  198. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/pipeline/helical/processconfig.py +0 -0
  199. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/pipeline/helical/span_strategy.py +0 -0
  200. {nabu-2024.1.6/nabu/pipeline/helical → nabu-2024.1.8/nabu/pipeline/helical/tests}/__init__.py +0 -0
  201. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/pipeline/helical/tests/test_pipeline_elements_full.py +0 -0
  202. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/pipeline/helical/tests/test_strategy.py +0 -0
  203. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/pipeline/helical/utils.py +0 -0
  204. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/pipeline/helical/weight_balancer.py +0 -0
  205. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/pipeline/params.py +0 -0
  206. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/pipeline/tests/test_chunk_reader.py +0 -0
  207. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/pipeline/tests/test_estimators.py +0 -0
  208. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/pipeline/utils.py +0 -0
  209. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/pipeline/writer.py +0 -0
  210. {nabu-2024.1.6/nabu/pipeline/helical/tests → nabu-2024.1.8/nabu/pipeline/xrdct}/__init__.py +0 -0
  211. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/preproc/__init__.py +0 -0
  212. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/preproc/alignment.py +0 -0
  213. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/preproc/ccd.py +0 -0
  214. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/preproc/ccd_cuda.py +0 -0
  215. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/preproc/ctf.py +0 -0
  216. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/preproc/ctf_cuda.py +0 -0
  217. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/preproc/distortion.py +0 -0
  218. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/preproc/double_flatfield.py +0 -0
  219. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/preproc/double_flatfield_cuda.py +0 -0
  220. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/preproc/double_flatfield_variable_region.py +0 -0
  221. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/preproc/flatfield.py +0 -0
  222. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/preproc/flatfield_cuda.py +0 -0
  223. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/preproc/flatfield_variable_region.py +0 -0
  224. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/preproc/phase.py +0 -0
  225. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/preproc/phase_cuda.py +0 -0
  226. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/preproc/shift.py +0 -0
  227. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/preproc/shift_cuda.py +0 -0
  228. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/preproc/tests/__init__.py +0 -0
  229. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/preproc/tests/test_ccd_corr.py +0 -0
  230. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/preproc/tests/test_ctf.py +0 -0
  231. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/preproc/tests/test_double_flatfield.py +0 -0
  232. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/preproc/tests/test_flatfield.py +0 -0
  233. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/preproc/tests/test_paganin.py +0 -0
  234. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/preproc/tests/test_vshift.py +0 -0
  235. {nabu-2024.1.6/nabu/pipeline/xrdct → nabu-2024.1.8/nabu/processing}/__init__.py +0 -0
  236. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/processing/convolution_cuda.py +0 -0
  237. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/processing/fft_base.py +0 -0
  238. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/processing/fft_cuda.py +0 -0
  239. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/processing/fft_opencl.py +0 -0
  240. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/processing/fftshift.py +0 -0
  241. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/processing/histogram.py +0 -0
  242. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/processing/histogram_cuda.py +0 -0
  243. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/processing/kernel_base.py +0 -0
  244. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/processing/medfilt_cuda.py +0 -0
  245. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/processing/muladd.py +0 -0
  246. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/processing/muladd_cuda.py +0 -0
  247. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/processing/padding_base.py +0 -0
  248. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/processing/padding_cuda.py +0 -0
  249. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/processing/padding_opencl.py +0 -0
  250. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/processing/processing_base.py +0 -0
  251. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/processing/roll_opencl.py +0 -0
  252. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/processing/rotation.py +0 -0
  253. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/processing/rotation_cuda.py +0 -0
  254. {nabu-2024.1.6/nabu/processing → nabu-2024.1.8/nabu/processing/tests}/__init__.py +0 -0
  255. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/processing/tests/test_fft.py +0 -0
  256. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/processing/tests/test_histogram.py +0 -0
  257. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/processing/tests/test_medfilt.py +0 -0
  258. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/processing/tests/test_muladd.py +0 -0
  259. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/processing/tests/test_padding.py +0 -0
  260. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/processing/tests/test_roll.py +0 -0
  261. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/processing/tests/test_rotation.py +0 -0
  262. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/processing/tests/test_transpose.py +0 -0
  263. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/processing/tests/test_unsharp.py +0 -0
  264. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/processing/transpose.py +0 -0
  265. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/processing/unsharp.py +0 -0
  266. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/processing/unsharp_cuda.py +0 -0
  267. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/processing/unsharp_opencl.py +0 -0
  268. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/reconstruction/__init__.py +0 -0
  269. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/reconstruction/fbp.py +0 -0
  270. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/reconstruction/fbp_base.py +0 -0
  271. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/reconstruction/fbp_opencl.py +0 -0
  272. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/reconstruction/filtering.py +0 -0
  273. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/reconstruction/filtering_cuda.py +0 -0
  274. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/reconstruction/filtering_opencl.py +0 -0
  275. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/reconstruction/projection.py +0 -0
  276. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/reconstruction/reconstructor.py +0 -0
  277. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/reconstruction/reconstructor_cuda.py +0 -0
  278. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/reconstruction/rings.py +0 -0
  279. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/reconstruction/rings_cuda.py +0 -0
  280. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/reconstruction/sinogram.py +0 -0
  281. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/reconstruction/sinogram_cuda.py +0 -0
  282. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/reconstruction/sinogram_opencl.py +0 -0
  283. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/reconstruction/tests/__init__.py +0 -0
  284. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/reconstruction/tests/test_fbp.py +0 -0
  285. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/reconstruction/tests/test_filtering.py +0 -0
  286. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/reconstruction/tests/test_projector.py +0 -0
  287. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/reconstruction/tests/test_reconstructor.py +0 -0
  288. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/reconstruction/tests/test_sino_normalization.py +0 -0
  289. {nabu-2024.1.6/nabu/processing/tests → nabu-2024.1.8/nabu/resources}/__init__.py +0 -0
  290. {nabu-2024.1.6/nabu/resources → nabu-2024.1.8/nabu/resources/cli}/__init__.py +0 -0
  291. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/resources/cor.py +0 -0
  292. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/resources/dataset_analyzer.py +0 -0
  293. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/resources/gpu.py +0 -0
  294. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/resources/logger.py +0 -0
  295. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/resources/nxflatfield.py +0 -0
  296. {nabu-2024.1.6/nabu/resources/cli → nabu-2024.1.8/nabu/resources/templates}/__init__.py +0 -0
  297. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/resources/templates/bm05_pag.conf +0 -0
  298. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/resources/templates/id16_ctf.conf +0 -0
  299. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/resources/templates/id16_holo.conf +0 -0
  300. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/resources/templates/id19_pag.conf +0 -0
  301. {nabu-2024.1.6/nabu/resources/templates → nabu-2024.1.8/nabu/resources/tests}/__init__.py +0 -0
  302. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/resources/tests/test_nxflatfield.py +0 -0
  303. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/resources/tests/test_units.py +0 -0
  304. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/resources/utils.py +0 -0
  305. {nabu-2024.1.6/nabu/resources/tests → nabu-2024.1.8/nabu/stitching}/__init__.py +0 -0
  306. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/stitching/alignment.py +0 -0
  307. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/stitching/config.py +0 -0
  308. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/stitching/definitions.py +0 -0
  309. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/stitching/frame_composition.py +0 -0
  310. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/stitching/overlap.py +0 -0
  311. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/stitching/sample_normalization.py +0 -0
  312. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/stitching/slurm_utils.py +0 -0
  313. {nabu-2024.1.6/nabu/stitching → nabu-2024.1.8/nabu/stitching/tests}/__init__.py +0 -0
  314. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/stitching/tests/test_alignment.py +0 -0
  315. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/stitching/tests/test_config.py +0 -0
  316. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/stitching/tests/test_frame_composition.py +0 -0
  317. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/stitching/tests/test_overlap.py +0 -0
  318. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/stitching/tests/test_sample_normalization.py +0 -0
  319. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/stitching/tests/test_slurm_utils.py +0 -0
  320. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/stitching/tests/test_utils.py +0 -0
  321. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/stitching/utils.py +0 -0
  322. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/tests.py +0 -0
  323. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/testutils.py +0 -0
  324. {nabu-2024.1.6/nabu/stitching/tests → nabu-2024.1.8/nabu/thirdparty}/__init__.py +0 -0
  325. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/thirdparty/algotom_convert_sino.py +0 -0
  326. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/thirdparty/pore3d_deringer_munch.py +0 -0
  327. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/thirdparty/tomocupy_remove_stripe.py +0 -0
  328. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/thirdparty/tomopy_phase.py +0 -0
  329. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/thirdparty/tomwer_load_flats_darks.py +0 -0
  330. {nabu-2024.1.6 → nabu-2024.1.8}/nabu/utils.py +0 -0
  331. {nabu-2024.1.6 → nabu-2024.1.8}/nabu.egg-info/dependency_links.txt +0 -0
  332. {nabu-2024.1.6 → nabu-2024.1.8}/nabu.egg-info/entry_points.txt +0 -0
  333. {nabu-2024.1.6 → nabu-2024.1.8}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nabu
3
- Version: 2024.1.6
3
+ Version: 2024.1.8
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>
@@ -48,9 +48,29 @@ Classifier: Topic :: Scientific/Engineering :: Physics
48
48
  Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
49
49
  Requires-Python: >=3.7
50
50
  Description-Content-Type: text/markdown
51
+ License-File: LICENSE
52
+ Requires-Dist: numpy<2,>1.9.0
53
+ Requires-Dist: scipy
54
+ Requires-Dist: h5py>=3.0
55
+ Requires-Dist: silx>=0.15.0
56
+ Requires-Dist: tomoscan>=2.0.4
57
+ Requires-Dist: psutil
58
+ Requires-Dist: pytest
59
+ Requires-Dist: tifffile
51
60
  Provides-Extra: full
61
+ Requires-Dist: scikit-image; extra == "full"
62
+ Requires-Dist: PyWavelets; extra == "full"
63
+ Requires-Dist: glymur; extra == "full"
64
+ Requires-Dist: pycuda<2024.1.1; extra == "full"
65
+ Requires-Dist: scikit-cuda; extra == "full"
66
+ Requires-Dist: pycudwt; extra == "full"
67
+ Requires-Dist: sluurp>=0.3; extra == "full"
68
+ Requires-Dist: pyvkfft; extra == "full"
52
69
  Provides-Extra: doc
53
- License-File: LICENSE
70
+ Requires-Dist: sphinx; extra == "doc"
71
+ Requires-Dist: cloud_sptheme; extra == "doc"
72
+ Requires-Dist: myst-parser; extra == "doc"
73
+ Requires-Dist: nbsphinx; extra == "doc"
54
74
 
55
75
  # Nabu
56
76
 
@@ -0,0 +1,32 @@
1
+ #!/usr/bin/env python
2
+
3
+ from nabu.resources.nabu_config import nabu_config
4
+
5
+
6
+ def generate(file_):
7
+ def write(content):
8
+ print(content, file=file_)
9
+ for section, values in nabu_config.items():
10
+ if section == "about":
11
+ continue
12
+ write("## %s\n" % section)
13
+ for key, val in values.items():
14
+ if val["type"] == "unsupported":
15
+ continue
16
+ write(val["help"] + "\n")
17
+ write(
18
+ "```ini\n%s = %s\n```"
19
+ % (key, val["default"])
20
+ )
21
+
22
+
23
+
24
+ if __name__ == "__main__":
25
+
26
+ import sys, os
27
+ print(os.path.abspath(__file__))
28
+ exit(0)
29
+
30
+ fname = "/tmp/test.md"
31
+ with open(fname, "w") as f:
32
+ generate(f)
@@ -1,4 +1,4 @@
1
- __version__ = "2024.1.6"
1
+ __version__ = "2024.1.8"
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
@@ -577,17 +575,16 @@ class ChunkedPipeline:
577
575
  (self.radios_shape[1],) + self.sino_shape,
578
576
  source_sample_dist,
579
577
  sample_detector_dist,
580
- angles=options["angles"],
581
- # TODO one center for each angle to handle "x translations"
578
+ angles=-options["angles"],
582
579
  rot_center=options["rotation_axis_position"],
580
+ axis_correction=-options["axis_correction"],
583
581
  pixel_size=1,
582
+ scale_factor=1.0 / options["voxel_size_cm"][0],
584
583
  )
585
584
 
586
585
  self._allocate_recs(*self.process_config.rec_shape, n_slices=n_slices)
587
586
  n_a, _, n_x = self.radios_cropped_shape
588
587
  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
588
 
592
589
  @use_options("histogram", "histogram")
593
590
  def _init_histogram(self):
@@ -734,14 +731,25 @@ class ChunkedPipeline:
734
731
  """
735
732
  This reconstructs the entire sinograms stack at once
736
733
  """
737
- self.sino_builder.get_sinos(self.radios, output=self.sinos)
734
+
735
+ n_angles, n_z, n_x = self.radios.shape
736
+
737
+ # FIXME
738
+ # can't do a discontiguous single copy...
739
+ sinos_contig = self._allocate_array((n_z, n_angles, n_x), np.float32, "sinos_cone")
740
+ for i in range(n_z):
741
+ sinos_contig[i] = self.radios[:, i, :]
742
+ # ---
743
+
744
+ # In principle radios are not cropped at this stage,
745
+ # so self.sub_region[2][0] can be used instead of self.get_slice_start_index() instead of self.sub_region[2][0]
738
746
  z_min, z_max = self.sub_region_xz[2:]
739
- n_z = self.process_config.radio_shape(binning=True)[0]
747
+ n_z_tot = self.process_config.radio_shape(binning=True)[0]
740
748
 
741
749
  self.reconstruction.reconstruct( # pylint: disable=E1101
742
- self.sinos,
750
+ sinos_contig,
743
751
  output=self.recs,
744
- relative_z_position=((z_min + z_max) / self.process_config.binning_z / 2) - n_z / 2,
752
+ relative_z_position=((z_min + z_max) / self.process_config.binning_z / 2) - n_z_tot / 2,
745
753
  )
746
754
 
747
755
  @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)
@@ -517,10 +517,15 @@ class ProcessConfig(ProcessConfigBase):
517
517
  #
518
518
  # Translation movements
519
519
  #
520
+
520
521
  translations = dataset_info.translations
521
522
  if translations is not None:
522
- tasks.append("radios_movements")
523
- options["radios_movements"] = {"translation_movements": dataset_info.translations}
523
+ if np.max(np.abs(translations[:, 1])) < 1e-5:
524
+ self.logger.warning("No vertical translation greater than 1e-5 - disabling vertical shifts")
525
+ # horizontal movements are handled in backprojector
526
+ else:
527
+ tasks.append("radios_movements")
528
+ options["radios_movements"] = {"translation_movements": dataset_info.translations}
524
529
  #
525
530
  # Sinogram normalization (before half-tomo)
526
531
  #
@@ -600,7 +605,7 @@ class ProcessConfig(ProcessConfigBase):
600
605
  )
601
606
  if all([m is not None for m in mean_positions_xyz]):
602
607
  rec_options["position"] = mean_positions_xyz
603
- if rec_options["sample_detector_dist"] is None:
608
+ if rec_options["method"] == "cone" and rec_options["sample_detector_dist"] is None:
604
609
  rec_options["sample_detector_dist"] = self.dataset_info.distance # was checked to be not None earlier
605
610
 
606
611
  # New key
@@ -359,6 +359,16 @@ class FullFieldReconstructor:
359
359
 
360
360
  return (max_overlap, 0)
361
361
 
362
+ def _compute_rotation_margin(self):
363
+ if "rotate_projections" in self.process_config.processing_steps:
364
+ # Partial radios rotation yields too much error in single-slice mode
365
+ # Forcing a big margin circumvents the problem
366
+ # This is likely to trigger the 'grouped mode', but perhaps grouped mode should always be used when rotating radios
367
+ nz, nx = self.process_config.radio_shape(binning=True)
368
+ return nz // 3, nx // 3
369
+ else:
370
+ return 0, 0
371
+
362
372
  def _ensure_good_chunk_size_and_margin(self):
363
373
  """
364
374
  Check that "chunk_size" and "margin" (if any) are a multiple of binning factor.
@@ -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):
@@ -23,7 +23,9 @@ class ConebeamReconstructor:
23
23
  volume_shape=None,
24
24
  rot_center=None,
25
25
  relative_z_position=None,
26
+ axis_correction=None,
26
27
  pixel_size=None,
28
+ scale_factor=None,
27
29
  cuda_options=None,
28
30
  ):
29
31
  """
@@ -88,6 +90,7 @@ class ConebeamReconstructor:
88
90
  Optics Express. 24. 25129-25147. 10.1364/OE.24.025129.
89
91
  """
90
92
  self._init_cuda(cuda_options)
93
+ self.scale_factor = scale_factor
91
94
  self._init_geometry(
92
95
  sinos_shape,
93
96
  source_origin_dist,
@@ -97,6 +100,7 @@ class ConebeamReconstructor:
97
100
  volume_shape,
98
101
  rot_center,
99
102
  relative_z_position,
103
+ axis_correction,
100
104
  )
101
105
  self._alg_id = None
102
106
  self._vol_id = None
@@ -133,6 +137,7 @@ class ConebeamReconstructor:
133
137
  volume_shape,
134
138
  rot_center,
135
139
  relative_z_position,
140
+ axis_correction,
136
141
  ):
137
142
  self._set_sino_shape(sinos_shape)
138
143
  if angles is None:
@@ -153,6 +158,7 @@ class ConebeamReconstructor:
153
158
  if rot_center is not None:
154
159
  self._cor_shift = (self.prj_width - 1) / 2.0 - rot_center
155
160
  self._set_pixel_size(pixel_size)
161
+ self._axis_corrections = axis_correction
156
162
  self._create_astra_proj_geometry(relative_z_position)
157
163
 
158
164
  def _create_astra_proj_geometry(self, relative_z_position):
@@ -170,13 +176,26 @@ class ConebeamReconstructor:
170
176
  self.origin_detector_dist,
171
177
  )
172
178
  self.relative_z_position = relative_z_position or 0.0
179
+ # This will turn the geometry of type "cone" into a geometry of type "cone_vec"
173
180
  self.proj_geom = astra.geom_postalignment(self.proj_geom, (self._cor_shift, 0))
181
+ # (src, detector_center, u, v) = (srcX, srcY, srcZ, dX, dY, dZ, uX, uY, uZ, vX, vY, vZ)
182
+ vecs = self.proj_geom["Vectors"]
183
+
184
+ # To adapt the center of rotation:
185
+ # dX = cor_shift * cos(theta) - origin_detector_dist * sin(theta)
186
+ # dY = origin_detector_dist * cos(theta) + cor_shift * sin(theta)
187
+ if self._axis_corrections is not None:
188
+ # should we check that dX and dY match the above formulas ?
189
+ cor_shifts = self._cor_shift + self._axis_corrections
190
+ vecs[:, 3] = cor_shifts * np.cos(self.angles) - self.origin_detector_dist * np.sin(self.angles)
191
+ vecs[:, 4] = self.origin_detector_dist * np.cos(self.angles) + cor_shifts * np.sin(self.angles)
192
+
193
+ # To adapt the z position:
174
194
  # Component 2 of vecs is the z coordinate of the source, component 5 is the z component of the detector position
175
195
  # We need to re-create the same inclination of the cone beam, thus we need to keep the inclination of the two z positions.
176
196
  # The detector is centered on the rotation axis, thus moving it up or down, just moves it out of the reconstruction volume.
177
197
  # We can bring back the detector in the correct volume position, by applying a rigid translation of both the detector and the source.
178
198
  # The translation is exactly the amount that brought the detector up or down, but in the opposite direction.
179
- vecs = self.proj_geom["Vectors"]
180
199
  vecs[:, 2] = -self.relative_z_position
181
200
 
182
201
  def _set_output(self, volume):
@@ -229,6 +248,8 @@ class ConebeamReconstructor:
229
248
  result = self.cuda.get_array("output")
230
249
  if output is None:
231
250
  result = result.get()
251
+ if self.scale_factor is not None:
252
+ result *= np.float32(self.scale_factor) # in-place for pycuda
232
253
  self.cuda.recover_arrays_references(["sinos", "output"])
233
254
  return result
234
255
 
@@ -1,7 +1,7 @@
1
1
  import pytest
2
2
  import numpy as np
3
- from scipy.ndimage import gaussian_filter
4
- from nabu.utils import subdivide_into_overlapping_segment
3
+ from scipy.ndimage import gaussian_filter, shift
4
+ from nabu.utils import subdivide_into_overlapping_segment, clip_circle
5
5
 
6
6
  try:
7
7
  import astra
@@ -238,6 +238,65 @@ class TestCone:
238
238
  assert np.max(err_max_profile) < 2e-3
239
239
  assert np.max(err_median_profile) < 5e-6
240
240
 
241
+ def test_reconstruction_horizontal_translations(self):
242
+ n_z = n_y = n_x = 256
243
+ n_a = 500
244
+ src_orig_dist = 1000
245
+ orig_det_dist = 50
246
+
247
+ volume, cone_data = generate_hollow_cube_cone_sinograms(
248
+ vol_shape=(n_z, n_y, n_x),
249
+ n_angles=n_a,
250
+ src_orig_dist=src_orig_dist,
251
+ orig_det_dist=orig_det_dist,
252
+ apply_filter=False,
253
+ )
254
+
255
+ # Apply horizontal translations on projections. This could have been done directly with astra
256
+ shift_min, shift_max = -2, 5
257
+ shifts_float = (shift_max - shift_min) * np.random.rand(n_a) - shift_min
258
+ shifts_int = np.random.randint(shift_min, high=shift_max + 1, size=n_a)
259
+
260
+ reconstructor_args = [
261
+ cone_data.shape,
262
+ src_orig_dist,
263
+ orig_det_dist,
264
+ ]
265
+ reconstructor_kwargs = {
266
+ "volume_shape": volume.shape,
267
+ "cuda_options": {"ctx": self.ctx},
268
+ }
269
+ cone_reconstructor = ConebeamReconstructor(*reconstructor_args, **reconstructor_kwargs)
270
+ rec = cone_reconstructor.reconstruct(cone_data)
271
+
272
+ # Translations done with floating-point shift values give a blurring of the image that cannot be recovered.
273
+ # Error tolerance has to be higher for these shifts.
274
+ for shift_type, shifts, err_tol in [
275
+ ("integer shifts", shifts_int, 5e-3),
276
+ ("float shifts", shifts_float, 1.4e-1),
277
+ ]:
278
+ cone_data_shifted = np.zeros_like(cone_data)
279
+ [shift(cone_data[:, i, :], (0, shifts[i]), output=cone_data_shifted[:, i, :]) for i in range(n_a)]
280
+
281
+ # Reconstruct with horizontal shifts
282
+ cone_reconstructor_with_correction = ConebeamReconstructor(
283
+ *reconstructor_args,
284
+ axis_corrections=shifts,
285
+ **reconstructor_kwargs,
286
+ )
287
+
288
+ rec_with_correction = cone_reconstructor_with_correction.reconstruct(cone_data_shifted)
289
+
290
+ metric = lambda img: np.max(np.abs(clip_circle(img, radius=int(0.85 * img.shape[1] // 2))))
291
+ error_profile = np.array([metric(rec[i] - rec_with_correction[i]) for i in range(n_z)])
292
+ assert error_profile.max() < err_tol, "Max error with %s is too high" % shift_type
293
+
294
+ # import matplotlib.pyplot as plt
295
+ # plt.figure()
296
+ # plt.plot(np.arange(n_z), error_profile)
297
+ # plt.legend([shift_type])
298
+ # plt.show()
299
+
241
300
 
242
301
  def generate_hollow_cube_cone_sinograms(
243
302
  vol_shape, n_angles, src_orig_dist, orig_det_dist, prj_width=None, apply_filter=True
@@ -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
@@ -695,11 +695,6 @@ def test_DistributePostProcessZStitcher(tmp_path, configuration_dist, flip_ud):
695
695
  if complete:
696
696
  concatenate_volumes(output_volume=final_vol, volumes=tuple(reconstructed_sub_volumes), axis=1)
697
697
  final_vol.load_data(store=True)
698
- with h5py.File("debug.hdf5", mode="w") as h5f:
699
- h5f["raw_volume"] = raw_volume
700
- h5f["final_vol"] = final_vol.data
701
- h5f["volume1"] = volume_1.data
702
- h5f["volume2"] = volume_2.data
703
698
  numpy.testing.assert_almost_equal(
704
699
  raw_volume,
705
700
  final_vol.data,
@@ -925,14 +920,6 @@ def test_vol_z_stitching_with_alignment_axis_2(tmp_path, alignment_axis_2):
925
920
 
926
921
  assert output_volume.data.shape == (120, 4, 120)
927
922
 
928
- import h5py
929
-
930
- with h5py.File("input.h5", mode="w") as h5f:
931
- h5f["data"] = raw_volume
932
-
933
- with h5py.File("output.h5", mode="w") as h5f:
934
- h5f["data"] = output_volume.data
935
-
936
923
  if alignment_axis_2 == "center":
937
924
  numpy.testing.assert_array_almost_equal(raw_volume[:, :, 10:-10], output_volume.data[:, :, 10:-10])
938
925
  elif alignment_axis_2 == "left":
@@ -1975,7 +1975,7 @@ def stitch_vertically_raw_frames(
1975
1975
  | | Frame 2 | --------------
1976
1976
  | | |
1977
1977
  | --------------
1978
- \/
1978
+ |
1979
1979
 
1980
1980
  returns stitched_projection, raw_img_1, raw_img_2, computed_overlap
1981
1981
  proj_0 and pro_1 are already expected to be in a row. Having stitching_height_in_px in common. At top of proj_0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nabu
3
- Version: 2024.1.6
3
+ Version: 2024.1.8
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>
@@ -48,9 +48,29 @@ Classifier: Topic :: Scientific/Engineering :: Physics
48
48
  Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
49
49
  Requires-Python: >=3.7
50
50
  Description-Content-Type: text/markdown
51
+ License-File: LICENSE
52
+ Requires-Dist: numpy<2,>1.9.0
53
+ Requires-Dist: scipy
54
+ Requires-Dist: h5py>=3.0
55
+ Requires-Dist: silx>=0.15.0
56
+ Requires-Dist: tomoscan>=2.0.4
57
+ Requires-Dist: psutil
58
+ Requires-Dist: pytest
59
+ Requires-Dist: tifffile
51
60
  Provides-Extra: full
61
+ Requires-Dist: scikit-image; extra == "full"
62
+ Requires-Dist: PyWavelets; extra == "full"
63
+ Requires-Dist: glymur; extra == "full"
64
+ Requires-Dist: pycuda<2024.1.1; extra == "full"
65
+ Requires-Dist: scikit-cuda; extra == "full"
66
+ Requires-Dist: pycudwt; extra == "full"
67
+ Requires-Dist: sluurp>=0.3; extra == "full"
68
+ Requires-Dist: pyvkfft; extra == "full"
52
69
  Provides-Extra: doc
53
- License-File: LICENSE
70
+ Requires-Dist: sphinx; extra == "doc"
71
+ Requires-Dist: cloud_sptheme; extra == "doc"
72
+ Requires-Dist: myst-parser; extra == "doc"
73
+ Requires-Dist: nbsphinx; extra == "doc"
54
74
 
55
75
  # Nabu
56
76
 
@@ -3,6 +3,7 @@ README.md
3
3
  pyproject.toml
4
4
  doc/conf.py
5
5
  doc/create_conf_doc.py
6
+ doc/doc_config.py
6
7
  doc/get_mathjax.py
7
8
  nabu/__init__.py
8
9
  nabu/tests.py
@@ -40,7 +41,6 @@ nabu/app/shrink_dataset.py
40
41
  nabu/app/stitching.py
41
42
  nabu/app/utils.py
42
43
  nabu/app/validator.py
43
- nabu/app/tests/__init__.py
44
44
  nabu/app/tests/test_reduce_dark_flat.py
45
45
  nabu/cuda/__init__.py
46
46
  nabu/cuda/convolution.py
@@ -296,4 +296,35 @@ nabu/thirdparty/algotom_convert_sino.py
296
296
  nabu/thirdparty/pore3d_deringer_munch.py
297
297
  nabu/thirdparty/tomocupy_remove_stripe.py
298
298
  nabu/thirdparty/tomopy_phase.py
299
- nabu/thirdparty/tomwer_load_flats_darks.py
299
+ nabu/thirdparty/tomwer_load_flats_darks.py
300
+ sandbox/align_test.py
301
+ sandbox/app.py
302
+ sandbox/binning_cython.py
303
+ sandbox/circ_sm.py
304
+ sandbox/composite_image.py
305
+ sandbox/convert_id15.py
306
+ sandbox/do_test_ctf.py
307
+ sandbox/esrf_envs.py
308
+ sandbox/fbp_polar.py
309
+ sandbox/fbp_tilt.py
310
+ sandbox/interleaved.py
311
+ sandbox/interp_sinos_halftomo.py
312
+ sandbox/linear_interp.py
313
+ sandbox/merge_recs.py
314
+ sandbox/moduleutils.py
315
+ sandbox/nbreconstruct.py
316
+ sandbox/pag_margin.py
317
+ sandbox/parse.py
318
+ sandbox/plot.py
319
+ sandbox/proj3D.py
320
+ sandbox/rec_bm05.py
321
+ sandbox/rec_thread.py
322
+ sandbox/shift_bilinear2.py
323
+ sandbox/sinotilt.py
324
+ sandbox/sysutils.py
325
+ sandbox/test_mp_queue.py
326
+ sandbox/tilt.py
327
+ sandbox/utils.py
328
+ sandbox/vo.py
329
+ sandbox/workers.py
330
+ sandbox/xrdrec_pyFAI_data.py
@@ -1,4 +1,4 @@
1
- numpy>1.9.0
1
+ numpy<2,>1.9.0
2
2
  scipy
3
3
  h5py>=3.0
4
4
  silx>=0.15.0
@@ -17,7 +17,7 @@ nbsphinx
17
17
  scikit-image
18
18
  PyWavelets
19
19
  glymur
20
- pycuda
20
+ pycuda<2024.1.1
21
21
  scikit-cuda
22
22
  pycudwt
23
23
  sluurp>=0.3
@@ -1,4 +1,4 @@
1
+ build
1
2
  dist
2
3
  doc
3
4
  nabu
4
- scripts
@@ -49,7 +49,7 @@ classifiers = [
49
49
 
50
50
  ]
51
51
  dependencies = [
52
- "numpy > 1.9.0",
52
+ "numpy > 1.9.0, < 2",
53
53
  "scipy",
54
54
  "h5py>=3.0",
55
55
  "silx >= 0.15.0",
@@ -73,7 +73,7 @@ full = [
73
73
  "scikit-image",
74
74
  "PyWavelets",
75
75
  "glymur",
76
- "pycuda",
76
+ "pycuda<2024.1.1",
77
77
  "scikit-cuda",
78
78
  "pycudwt",
79
79
  "sluurp >=0.3",
@@ -0,0 +1,61 @@
1
+ import numpy as np
2
+ from nabu.estimation.translation import DetectorTranslationAlongBeam
3
+ from tomoscan.io import HDF5File
4
+
5
+
6
+ def get_data(fname, h5_paths):
7
+ with HDF5File(fname, "r") as f:
8
+ align_data = f[h5_paths["align_data"]][()]
9
+ dark = f[h5_paths["dark"]][0]
10
+ pixel_size_um = f[h5_paths["pixel_size"]][()]
11
+ positions_mm = f[h5_paths["positions"]][()]
12
+
13
+ # Dark subtraction
14
+ align_data = align_data - dark.astype("f")
15
+
16
+ return align_data, pixel_size_um, positions_mm
17
+
18
+
19
+
20
+ def get_alignment(align_data, pixel_size_um, positions_mm, plot=True):
21
+
22
+ tr_calc = DetectorTranslationAlongBeam()
23
+ if plot == True:
24
+ tr_calc.verbose=True
25
+
26
+ shifts_v, shifts_h = tr_calc.find_shift(align_data, positions_mm)
27
+
28
+ # pixel_size is in microns, motor position is in mm
29
+ tilt_v_deg = np.rad2deg(np.arctan(shifts_v * pixel_size_um / 1e3))
30
+ tilt_h_deg = np.rad2deg(np.arctan(shifts_h * pixel_size_um / 1e3))
31
+ print (f"\nVertical tilt to be applied in deg (thy): {tilt_v_deg}")
32
+ print (f"Horizontal tilt to be applied in deg (thz): {tilt_h_deg}\n")
33
+
34
+ return align_data, shifts_v, shifts_h, positions_mm
35
+
36
+
37
+
38
+
39
+
40
+
41
+ if __name__ == "__main__":
42
+ fname = "/data/id19/inhouse/id192201/id19/sample/sample_0001/sample_0001.h5"
43
+ h5_paths = {
44
+ "align_data": "11.1/measurement/pcolinux",
45
+ "dark": "12.1/measurement/pcolinux",
46
+ "pixel_size": "11.1/instrument/pcolinux/x_pixel_size",
47
+ "positions": "11.1/measurement/hrxc"
48
+ }
49
+ align_data, pixel_size_um, positions_mm = get_data(fname, h5_paths)
50
+ # align_data, shifts_v, shifts_h, positions_mm = get_alignment(align_data, pixel_size_um, positions_mm)
51
+
52
+ D = DetectorTranslationAlongBeam()
53
+ D. verbose = True
54
+ sv, sh = D.find_shift(align_data, positions_mm)
55
+ D.verbose = False
56
+ sv, sh = D.find_shift(align_data, positions_mm)
57
+ D.verbose = True
58
+ sv, sh = D.find_shift(align_data, positions_mm)
59
+
60
+
61
+