nabu 2024.1.1__tar.gz → 2024.1.3__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 (332) hide show
  1. {nabu-2024.1.1/nabu.egg-info → nabu-2024.1.3}/PKG-INFO +2 -2
  2. nabu-2024.1.3/doc/doc_config.py +32 -0
  3. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/__init__.py +1 -1
  4. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/app/cast_volume.py +11 -2
  5. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/app/multicor.py +24 -2
  6. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/io/cast_volume.py +3 -3
  7. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/io/utils.py +2 -2
  8. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/reconstruction/rings_cuda.py +25 -10
  9. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/stitching/tests/test_z_stitching.py +0 -1
  10. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/stitching/z_stitching.py +3 -3
  11. {nabu-2024.1.1 → nabu-2024.1.3/nabu.egg-info}/PKG-INFO +2 -2
  12. {nabu-2024.1.1 → nabu-2024.1.3}/nabu.egg-info/SOURCES.txt +33 -1
  13. {nabu-2024.1.1 → nabu-2024.1.3}/nabu.egg-info/requires.txt +1 -1
  14. {nabu-2024.1.1 → nabu-2024.1.3}/pyproject.toml +1 -1
  15. nabu-2024.1.3/sandbox/align_test.py +61 -0
  16. nabu-2024.1.3/sandbox/app.py +123 -0
  17. nabu-2024.1.3/sandbox/binning_cython.py +37 -0
  18. nabu-2024.1.3/sandbox/circ_sm.py +195 -0
  19. nabu-2024.1.3/sandbox/composite_image.py +90 -0
  20. nabu-2024.1.3/sandbox/convert_id15.py +148 -0
  21. nabu-2024.1.3/sandbox/do_test_ctf.py +40 -0
  22. nabu-2024.1.3/sandbox/esrf_envs.py +36 -0
  23. nabu-2024.1.3/sandbox/fbp_polar.py +39 -0
  24. nabu-2024.1.3/sandbox/fbp_tilt.py +340 -0
  25. nabu-2024.1.3/sandbox/interleaved.py +129 -0
  26. nabu-2024.1.3/sandbox/interp_sinos_halftomo.py +31 -0
  27. nabu-2024.1.3/sandbox/linear_interp.py +14 -0
  28. nabu-2024.1.3/sandbox/merge_recs.py +56 -0
  29. nabu-2024.1.3/sandbox/moduleutils.py +50 -0
  30. nabu-2024.1.3/sandbox/nbreconstruct.py +246 -0
  31. nabu-2024.1.3/sandbox/pag_margin.py +38 -0
  32. nabu-2024.1.3/sandbox/parse.py +132 -0
  33. nabu-2024.1.3/sandbox/plot.py +49 -0
  34. nabu-2024.1.3/sandbox/proj3D.py +75 -0
  35. nabu-2024.1.3/sandbox/rec_bm05.py +71 -0
  36. nabu-2024.1.3/sandbox/rec_thread.py +133 -0
  37. nabu-2024.1.3/sandbox/shift_bilinear2.py +42 -0
  38. nabu-2024.1.3/sandbox/sinotilt.py +181 -0
  39. nabu-2024.1.3/sandbox/sysutils.py +63 -0
  40. nabu-2024.1.3/sandbox/test_mp_queue.py +73 -0
  41. nabu-2024.1.3/sandbox/tilt.py +251 -0
  42. nabu-2024.1.3/sandbox/utils.py +54 -0
  43. nabu-2024.1.3/sandbox/vo.py +204 -0
  44. nabu-2024.1.3/sandbox/workers.py +123 -0
  45. nabu-2024.1.3/sandbox/xrdrec_pyFAI_data.py +212 -0
  46. {nabu-2024.1.1 → nabu-2024.1.3}/LICENSE +0 -0
  47. {nabu-2024.1.1 → nabu-2024.1.3}/README.md +0 -0
  48. {nabu-2024.1.1 → nabu-2024.1.3}/doc/conf.py +0 -0
  49. {nabu-2024.1.1 → nabu-2024.1.3}/doc/create_conf_doc.py +0 -0
  50. {nabu-2024.1.1 → nabu-2024.1.3}/doc/get_mathjax.py +0 -0
  51. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/app/__init__.py +0 -0
  52. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/app/bootstrap.py +0 -0
  53. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/app/bootstrap_stitching.py +0 -0
  54. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/app/cli_configs.py +0 -0
  55. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/app/compare_volumes.py +0 -0
  56. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/app/composite_cor.py +0 -0
  57. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/app/correct_rot.py +0 -0
  58. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/app/create_distortion_map_from_poly.py +0 -0
  59. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/app/diag_to_pix.py +0 -0
  60. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/app/diag_to_rot.py +0 -0
  61. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/app/double_flatfield.py +0 -0
  62. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/app/generate_header.py +0 -0
  63. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/app/histogram.py +0 -0
  64. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/app/nx_z_splitter.py +0 -0
  65. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/app/parse_reconstruction_log.py +0 -0
  66. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/app/prepare_weights_double.py +0 -0
  67. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/app/reconstruct.py +0 -0
  68. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/app/reconstruct_helical.py +0 -0
  69. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/app/reduce_dark_flat.py +0 -0
  70. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/app/rotate.py +0 -0
  71. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/app/shrink_dataset.py +0 -0
  72. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/app/stitching.py +0 -0
  73. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/app/tests/test_reduce_dark_flat.py +0 -0
  74. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/app/utils.py +0 -0
  75. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/app/validator.py +0 -0
  76. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/cuda/__init__.py +0 -0
  77. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/cuda/convolution.py +0 -0
  78. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/cuda/fft.py +0 -0
  79. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/cuda/kernel.py +0 -0
  80. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/cuda/medfilt.py +0 -0
  81. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/cuda/padding.py +0 -0
  82. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/cuda/processing.py +0 -0
  83. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/cuda/src/ElementOp.cu +0 -0
  84. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/cuda/src/backproj.cu +0 -0
  85. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/cuda/src/backproj_polar.cu +0 -0
  86. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/cuda/src/boundary.h +0 -0
  87. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/cuda/src/convolution.cu +0 -0
  88. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/cuda/src/dfi_fftshift.cu +0 -0
  89. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/cuda/src/flatfield.cu +0 -0
  90. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/cuda/src/fourier_wavelets.cu +0 -0
  91. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/cuda/src/halftomo.cu +0 -0
  92. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/cuda/src/helical_padding.cu +0 -0
  93. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/cuda/src/histogram.cu +0 -0
  94. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/cuda/src/interpolation.cu +0 -0
  95. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/cuda/src/medfilt.cu +0 -0
  96. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/cuda/src/normalization.cu +0 -0
  97. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/cuda/src/padding.cu +0 -0
  98. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/cuda/src/proj.cu +0 -0
  99. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/cuda/src/rotation.cu +0 -0
  100. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/cuda/src/transpose.cu +0 -0
  101. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/cuda/tests/__init__.py +0 -0
  102. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/cuda/utils.py +0 -0
  103. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/estimation/__init__.py +0 -0
  104. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/estimation/alignment.py +0 -0
  105. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/estimation/cor.py +0 -0
  106. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/estimation/cor_sino.py +0 -0
  107. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/estimation/distortion.py +0 -0
  108. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/estimation/focus.py +0 -0
  109. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/estimation/tests/__init__.py +0 -0
  110. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/estimation/tests/test_alignment.py +0 -0
  111. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/estimation/tests/test_cor.py +0 -0
  112. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/estimation/tests/test_focus.py +0 -0
  113. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/estimation/tests/test_tilt.py +0 -0
  114. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/estimation/tests/test_translation.py +0 -0
  115. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/estimation/tilt.py +0 -0
  116. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/estimation/translation.py +0 -0
  117. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/estimation/utils.py +0 -0
  118. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/io/__init__.py +0 -0
  119. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/io/detector_distortion.py +0 -0
  120. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/io/reader.py +0 -0
  121. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/io/reader_helical.py +0 -0
  122. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/io/tests/__init__.py +0 -0
  123. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/io/tests/test_cast_volume.py +0 -0
  124. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/io/tests/test_detector_distortion.py +0 -0
  125. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/io/tests/test_writers.py +0 -0
  126. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/io/tiffwriter_zmm.py +0 -0
  127. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/io/writer.py +0 -0
  128. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/misc/__init__.py +0 -0
  129. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/misc/binning.py +0 -0
  130. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/misc/fftshift.py +0 -0
  131. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/misc/filters.py +0 -0
  132. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/misc/fourier_filters.py +0 -0
  133. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/misc/histogram.py +0 -0
  134. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/misc/histogram_cuda.py +0 -0
  135. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/misc/kernel_base.py +0 -0
  136. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/misc/padding.py +0 -0
  137. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/misc/padding_base.py +0 -0
  138. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/misc/processing_base.py +0 -0
  139. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/misc/rotation.py +0 -0
  140. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/misc/rotation_cuda.py +0 -0
  141. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/misc/tests/__init__.py +0 -0
  142. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/misc/tests/test_binning.py +0 -0
  143. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/misc/tests/test_interpolation.py +0 -0
  144. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/misc/transpose.py +0 -0
  145. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/misc/unsharp.py +0 -0
  146. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/misc/unsharp_cuda.py +0 -0
  147. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/misc/unsharp_opencl.py +0 -0
  148. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/misc/utils.py +0 -0
  149. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/opencl/__init__.py +0 -0
  150. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/opencl/fft.py +0 -0
  151. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/opencl/kernel.py +0 -0
  152. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/opencl/memcpy.py +0 -0
  153. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/opencl/padding.py +0 -0
  154. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/opencl/processing.py +0 -0
  155. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/opencl/src/ElementOp.cl +0 -0
  156. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/opencl/src/backproj.cl +0 -0
  157. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/opencl/src/fftshift.cl +0 -0
  158. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/opencl/src/halftomo.cl +0 -0
  159. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/opencl/src/padding.cl +0 -0
  160. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/opencl/src/roll.cl +0 -0
  161. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/opencl/src/transpose.cl +0 -0
  162. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/opencl/tests/__init__.py +0 -0
  163. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/opencl/utils.py +0 -0
  164. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/pipeline/__init__.py +0 -0
  165. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/pipeline/config.py +0 -0
  166. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/pipeline/config_validators.py +0 -0
  167. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/pipeline/datadump.py +0 -0
  168. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/pipeline/dataset_validator.py +0 -0
  169. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/pipeline/detector_distortion_provider.py +0 -0
  170. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/pipeline/estimators.py +0 -0
  171. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/pipeline/fallback_utils.py +0 -0
  172. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/pipeline/fullfield/__init__.py +0 -0
  173. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/pipeline/fullfield/chunked.py +0 -0
  174. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/pipeline/fullfield/chunked_cuda.py +0 -0
  175. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/pipeline/fullfield/computations.py +0 -0
  176. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/pipeline/fullfield/dataset_validator.py +0 -0
  177. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/pipeline/fullfield/nabu_config.py +0 -0
  178. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/pipeline/fullfield/processconfig.py +0 -0
  179. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/pipeline/fullfield/reconstruction.py +0 -0
  180. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/pipeline/helical/__init__.py +0 -0
  181. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/pipeline/helical/dataset_validator.py +0 -0
  182. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/pipeline/helical/fbp.py +0 -0
  183. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/pipeline/helical/filtering.py +0 -0
  184. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/pipeline/helical/gridded_accumulator.py +0 -0
  185. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/pipeline/helical/helical_chunked_regridded.py +0 -0
  186. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/pipeline/helical/helical_chunked_regridded_cuda.py +0 -0
  187. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/pipeline/helical/helical_reconstruction.py +0 -0
  188. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/pipeline/helical/helical_utils.py +0 -0
  189. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/pipeline/helical/nabu_config.py +0 -0
  190. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/pipeline/helical/processconfig.py +0 -0
  191. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/pipeline/helical/span_strategy.py +0 -0
  192. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/pipeline/helical/tests/__init__.py +0 -0
  193. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/pipeline/helical/tests/test_accumulator.py +0 -0
  194. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/pipeline/helical/tests/test_pipeline_elements_full.py +0 -0
  195. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/pipeline/helical/tests/test_strategy.py +0 -0
  196. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/pipeline/helical/utils.py +0 -0
  197. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/pipeline/helical/weight_balancer.py +0 -0
  198. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/pipeline/params.py +0 -0
  199. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/pipeline/processconfig.py +0 -0
  200. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/pipeline/tests/test_chunk_reader.py +0 -0
  201. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/pipeline/tests/test_estimators.py +0 -0
  202. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/pipeline/utils.py +0 -0
  203. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/pipeline/writer.py +0 -0
  204. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/pipeline/xrdct/__init__.py +0 -0
  205. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/preproc/__init__.py +0 -0
  206. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/preproc/alignment.py +0 -0
  207. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/preproc/ccd.py +0 -0
  208. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/preproc/ccd_cuda.py +0 -0
  209. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/preproc/ctf.py +0 -0
  210. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/preproc/ctf_cuda.py +0 -0
  211. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/preproc/distortion.py +0 -0
  212. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/preproc/double_flatfield.py +0 -0
  213. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/preproc/double_flatfield_cuda.py +0 -0
  214. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/preproc/double_flatfield_variable_region.py +0 -0
  215. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/preproc/flatfield.py +0 -0
  216. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/preproc/flatfield_cuda.py +0 -0
  217. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/preproc/flatfield_variable_region.py +0 -0
  218. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/preproc/phase.py +0 -0
  219. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/preproc/phase_cuda.py +0 -0
  220. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/preproc/shift.py +0 -0
  221. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/preproc/shift_cuda.py +0 -0
  222. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/preproc/tests/__init__.py +0 -0
  223. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/preproc/tests/test_ccd_corr.py +0 -0
  224. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/preproc/tests/test_ctf.py +0 -0
  225. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/preproc/tests/test_double_flatfield.py +0 -0
  226. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/preproc/tests/test_flatfield.py +0 -0
  227. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/preproc/tests/test_paganin.py +0 -0
  228. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/preproc/tests/test_vshift.py +0 -0
  229. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/processing/__init__.py +0 -0
  230. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/processing/convolution_cuda.py +0 -0
  231. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/processing/fft_base.py +0 -0
  232. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/processing/fft_cuda.py +0 -0
  233. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/processing/fft_opencl.py +0 -0
  234. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/processing/fftshift.py +0 -0
  235. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/processing/histogram.py +0 -0
  236. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/processing/histogram_cuda.py +0 -0
  237. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/processing/kernel_base.py +0 -0
  238. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/processing/medfilt_cuda.py +0 -0
  239. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/processing/muladd.py +0 -0
  240. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/processing/muladd_cuda.py +0 -0
  241. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/processing/padding_base.py +0 -0
  242. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/processing/padding_cuda.py +0 -0
  243. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/processing/padding_opencl.py +0 -0
  244. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/processing/processing_base.py +0 -0
  245. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/processing/roll_opencl.py +0 -0
  246. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/processing/rotation.py +0 -0
  247. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/processing/rotation_cuda.py +0 -0
  248. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/processing/tests/__init__.py +0 -0
  249. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/processing/tests/test_fft.py +0 -0
  250. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/processing/tests/test_fftshift.py +0 -0
  251. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/processing/tests/test_histogram.py +0 -0
  252. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/processing/tests/test_medfilt.py +0 -0
  253. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/processing/tests/test_muladd.py +0 -0
  254. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/processing/tests/test_padding.py +0 -0
  255. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/processing/tests/test_roll.py +0 -0
  256. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/processing/tests/test_rotation.py +0 -0
  257. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/processing/tests/test_transpose.py +0 -0
  258. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/processing/tests/test_unsharp.py +0 -0
  259. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/processing/transpose.py +0 -0
  260. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/processing/unsharp.py +0 -0
  261. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/processing/unsharp_cuda.py +0 -0
  262. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/processing/unsharp_opencl.py +0 -0
  263. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/reconstruction/__init__.py +0 -0
  264. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/reconstruction/cone.py +0 -0
  265. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/reconstruction/fbp.py +0 -0
  266. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/reconstruction/fbp_base.py +0 -0
  267. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/reconstruction/fbp_opencl.py +0 -0
  268. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/reconstruction/filtering.py +0 -0
  269. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/reconstruction/filtering_cuda.py +0 -0
  270. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/reconstruction/filtering_opencl.py +0 -0
  271. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/reconstruction/projection.py +0 -0
  272. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/reconstruction/reconstructor.py +0 -0
  273. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/reconstruction/reconstructor_cuda.py +0 -0
  274. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/reconstruction/rings.py +0 -0
  275. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/reconstruction/sinogram.py +0 -0
  276. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/reconstruction/sinogram_cuda.py +0 -0
  277. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/reconstruction/sinogram_opencl.py +0 -0
  278. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/reconstruction/tests/__init__.py +0 -0
  279. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/reconstruction/tests/test_cone.py +0 -0
  280. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/reconstruction/tests/test_deringer.py +0 -0
  281. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/reconstruction/tests/test_fbp.py +0 -0
  282. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/reconstruction/tests/test_filtering.py +0 -0
  283. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/reconstruction/tests/test_halftomo.py +0 -0
  284. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/reconstruction/tests/test_projector.py +0 -0
  285. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/reconstruction/tests/test_reconstructor.py +0 -0
  286. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/reconstruction/tests/test_sino_normalization.py +0 -0
  287. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/resources/__init__.py +0 -0
  288. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/resources/cli/__init__.py +0 -0
  289. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/resources/cor.py +0 -0
  290. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/resources/dataset_analyzer.py +0 -0
  291. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/resources/gpu.py +0 -0
  292. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/resources/logger.py +0 -0
  293. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/resources/nxflatfield.py +0 -0
  294. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/resources/templates/__init__.py +0 -0
  295. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/resources/templates/bm05_pag.conf +0 -0
  296. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/resources/templates/id16_ctf.conf +0 -0
  297. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/resources/templates/id16_holo.conf +0 -0
  298. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/resources/templates/id19_pag.conf +0 -0
  299. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/resources/tests/__init__.py +0 -0
  300. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/resources/tests/test_nxflatfield.py +0 -0
  301. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/resources/tests/test_units.py +0 -0
  302. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/resources/utils.py +0 -0
  303. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/stitching/__init__.py +0 -0
  304. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/stitching/alignment.py +0 -0
  305. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/stitching/config.py +0 -0
  306. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/stitching/definitions.py +0 -0
  307. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/stitching/frame_composition.py +0 -0
  308. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/stitching/overlap.py +0 -0
  309. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/stitching/sample_normalization.py +0 -0
  310. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/stitching/slurm_utils.py +0 -0
  311. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/stitching/tests/__init__.py +0 -0
  312. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/stitching/tests/test_alignment.py +0 -0
  313. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/stitching/tests/test_config.py +0 -0
  314. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/stitching/tests/test_frame_composition.py +0 -0
  315. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/stitching/tests/test_overlap.py +0 -0
  316. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/stitching/tests/test_sample_normalization.py +0 -0
  317. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/stitching/tests/test_slurm_utils.py +0 -0
  318. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/stitching/tests/test_utils.py +0 -0
  319. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/stitching/utils.py +0 -0
  320. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/tests.py +0 -0
  321. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/testutils.py +0 -0
  322. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/thirdparty/__init__.py +0 -0
  323. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/thirdparty/algotom_convert_sino.py +0 -0
  324. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/thirdparty/pore3d_deringer_munch.py +0 -0
  325. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/thirdparty/tomocupy_remove_stripe.py +0 -0
  326. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/thirdparty/tomopy_phase.py +0 -0
  327. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/thirdparty/tomwer_load_flats_darks.py +0 -0
  328. {nabu-2024.1.1 → nabu-2024.1.3}/nabu/utils.py +0 -0
  329. {nabu-2024.1.1 → nabu-2024.1.3}/nabu.egg-info/dependency_links.txt +0 -0
  330. {nabu-2024.1.1 → nabu-2024.1.3}/nabu.egg-info/entry_points.txt +0 -0
  331. {nabu-2024.1.1 → nabu-2024.1.3}/nabu.egg-info/top_level.txt +0 -0
  332. {nabu-2024.1.1 → nabu-2024.1.3}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nabu
3
- Version: 2024.1.1
3
+ Version: 2024.1.3
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>
@@ -53,7 +53,7 @@ Requires-Dist: numpy>1.9.0
53
53
  Requires-Dist: scipy
54
54
  Requires-Dist: h5py>=3.0
55
55
  Requires-Dist: silx>=0.15.0
56
- Requires-Dist: tomoscan>=2.0.0a7
56
+ Requires-Dist: tomoscan>=2.0.4
57
57
  Requires-Dist: psutil
58
58
  Requires-Dist: pytest
59
59
  Requires-Dist: tifffile
@@ -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.1"
1
+ __version__ = "2024.1.3"
2
2
  __nabu_modules__ = [
3
3
  "app",
4
4
  "cuda",
@@ -228,11 +228,20 @@ def main(argv=None):
228
228
 
229
229
  # get rescale_min_percentile and rescale_min_percentile
230
230
  rescale_min_percentile = options.rescale_min_percentile
231
+
232
+ def clean_percentiles_str(percentile):
233
+ # remove ' char
234
+ percentile = percentile.rstrip("'").lstrip("'")
235
+ # remove " char
236
+ percentile = percentile.rstrip('"').lstrip('"')
237
+ # remove % char
238
+ return percentile.rstrip("%")
239
+
231
240
  if isinstance(rescale_min_percentile, str):
232
- rescale_min_percentile = float(rescale_min_percentile.rstrip("%"))
241
+ rescale_min_percentile = float(clean_percentiles_str(rescale_min_percentile))
233
242
  rescale_max_percentile = options.rescale_max_percentile
234
243
  if isinstance(rescale_min_percentile, str):
235
- rescale_max_percentile = float(rescale_max_percentile.rstrip("%"))
244
+ rescale_max_percentile = float(clean_percentiles_str(rescale_max_percentile))
236
245
  assert rescale_min_percentile is not None, "rescale_min_percentile should be an int"
237
246
  assert rescale_max_percentile is not None, "rescale_max_percentile should be an int"
238
247
 
@@ -60,12 +60,12 @@ def main():
60
60
  cors = get_user_cors(args["cor"])
61
61
 
62
62
  all_recs = []
63
+ rec_instance = pipeline.reconstruction
63
64
 
64
65
  for cor in cors:
65
66
  # Re-configure with new CoR
66
67
  pipeline.processing_options["reconstruction"]["rotation_axis_position"] = cor
67
68
  pipeline.processing_options["save"]["file_prefix"] = file_prefix + "_%.03f" % cor
68
- pipeline.reconstruction.reset_rot_center(cor)
69
69
  pipeline._init_writer(create_subfolder=False, single_output_file_initialized=False)
70
70
 
71
71
  # Get sinogram into contiguous array
@@ -73,8 +73,30 @@ def main():
73
73
  # For now: transfer to host... not optimal
74
74
  sino = pipeline._d_radios[:, pipeline._d_radios.shape[1] // 2, :].get() # pylint: disable=E1136
75
75
 
76
+ if pipeline.process_config.do_halftomo:
77
+ # re-initialize FBP object, because in half-tomography the output slice size is a function of CoR
78
+ options = pipeline.processing_options["reconstruction"]
79
+ rec_instance = pipeline.FBPClass(
80
+ sino.shape,
81
+ angles=options["angles"],
82
+ rot_center=cor,
83
+ filter_name=options["fbp_filter_type"] or "none",
84
+ halftomo=options["enable_halftomo"],
85
+ # slice_roi=self.process_config.rec_roi,
86
+ padding_mode=options["padding_type"],
87
+ extra_options={
88
+ "scale_factor": 1.0 / options["voxel_size_cm"][0],
89
+ "axis_correction": options["axis_correction"],
90
+ "centered_axis": options["centered_axis"],
91
+ "clip_outer_circle": options["clip_outer_circle"],
92
+ "filter_cutoff": options["fbp_filter_cutoff"],
93
+ },
94
+ )
95
+ else:
96
+ pipeline.reconstruction.reset_rot_center(cor)
97
+
76
98
  # Run reconstruction
77
- rec = pipeline.reconstruction.fbp(sino)
99
+ rec = rec_instance.fbp(sino)
78
100
  # if return_all_recs:
79
101
  # all_recs.append(rec)
80
102
  rec_3D = view_as_images_stack(rec) # writer wants 3D data
@@ -74,7 +74,7 @@ def get_default_output_volume(
74
74
  volume_basename=input_volume.get_volume_basename(),
75
75
  )
76
76
  else:
77
- raise NotImplementedError
77
+ raise NotImplementedError(f"output volume format {output_type} is not handled")
78
78
  elif isinstance(input_volume, (HDF5Volume, MultiTIFFVolume)):
79
79
  if output_type == "hdf5":
80
80
  data_file_parent_path, data_file_name = os.path.split(input_volume.data_url.file_path())
@@ -121,9 +121,9 @@ def get_default_output_volume(
121
121
  )
122
122
  )
123
123
  else:
124
- raise NotImplementedError
124
+ raise NotImplementedError(f"output volume format {output_type} is not handled")
125
125
  else:
126
- raise NotImplementedError
126
+ raise NotImplementedError(f"input volume format {input_volume} is not handled")
127
127
 
128
128
 
129
129
  def cast_volume(
@@ -201,7 +201,7 @@ class EntryReader(_BaseReader):
201
201
  """Context manager used to read a bliss node"""
202
202
 
203
203
  def __enter__(self):
204
- self._file_handler = HDF5File(filename=self._url.file_path(), mode="r")
204
+ self._file_handler = HDF5File(self._url.file_path(), mode="r")
205
205
  if self._url.data_path() == "":
206
206
  entry = self._file_handler
207
207
  else:
@@ -215,7 +215,7 @@ class DatasetReader(_BaseReader):
215
215
  """Context manager used to read a bliss node"""
216
216
 
217
217
  def __enter__(self):
218
- self._file_handler = HDF5File(filename=self._url.file_path(), mode="r")
218
+ self._file_handler = HDF5File(self._url.file_path(), mode="r")
219
219
  entry = self._file_handler[self._url.data_path()]
220
220
  if not isinstance(entry, h5py.Dataset):
221
221
  raise ValueError("Data path ({}) should point to a dataset (h5py.Dataset)".format(self._url.path()))
@@ -174,10 +174,15 @@ class CudaMunchDeringer(MunchDeringer):
174
174
  self._fft_plans[level].ifft(d_coeffs_f, output=d_coeffs)
175
175
 
176
176
  def _destripe_2D(self, d_sino, output):
177
+ if not (d_sino.flags.c_contiguous):
178
+ sino = self.cuda_processing.allocate_array("_d_sino", d_sino.shape, np.float32)
179
+ sino[:] = d_sino[:]
180
+ else:
181
+ sino = d_sino
177
182
  if self.padding is not None:
178
- d_sino = self.padder.pad(d_sino)
183
+ sino = self.padder.pad(sino)
179
184
  # set the "image" for DWT (memcpy D2D)
180
- self._d_sino.set(d_sino)
185
+ self._d_sino.set(sino)
181
186
  # perform forward DWT
182
187
  self.cudwt.forward()
183
188
  for i in range(self.cudwt.levels):
@@ -256,9 +261,10 @@ class CudaSinoMeanDeringer(SinoMeanDeringer):
256
261
  filename=get_cuda_srcfile("normalization.cu"),
257
262
  signature="PPiii",
258
263
  )
259
- self._mean_kernel_block = (32, 1, 32)
260
- self._mean_kernel_grid = [updiv(a, b) for a, b in zip(self.sinos_shape[::-1], self._mean_kernel_block)]
261
- self._mean_kernel_args = [self.d_sino_profile, np.int32(self.n_x), np.int32(self.n_angles), np.int32(self.n_z)]
264
+ self._mean_kernel_block = (32, 1, 1)
265
+ self._mean_kernel_grid = [updiv(self.sinos_shape[-1], self._mean_kernel_block[0]), 1, 1]
266
+ self._mean_kernel_args = [self.d_sino_profile, np.int32(self.n_x), np.int32(self.n_angles), np.int32(1)]
267
+
262
268
  self._mean_kernel_kwargs = {
263
269
  "grid": self._mean_kernel_grid,
264
270
  "block": self._mean_kernel_block,
@@ -270,9 +276,11 @@ class CudaSinoMeanDeringer(SinoMeanDeringer):
270
276
  signature="PPiii",
271
277
  options=["-DGENERIC_OP=%d" % (3 if self.mode == "divide" else 1)],
272
278
  )
273
- self._op_kernel_block = (16, 16, 4)
274
- self._op_kernel_grid = [updiv(a, b) for a, b in zip(self.sinos_shape[::-1], self._op_kernel_block)]
275
- self._op_kernel_args = [self.d_sino_profile, np.int32(self.n_x), np.int32(self.n_angles), np.int32(self.n_z)]
279
+ self._op_kernel_block = (16, 16, 1)
280
+ self._op_kernel_grid = [updiv(a, b) for a, b in zip(self.sinos_shape[1:][::-1], self._op_kernel_block[:-1])] + [
281
+ 1
282
+ ]
283
+ self._op_kernel_args = [self.d_sino_profile, np.int32(self.n_x), np.int32(self.n_angles), np.int32(1)]
276
284
  self._op_kernel_kwargs = {
277
285
  "grid": self._op_kernel_grid,
278
286
  "block": self._op_kernel_block,
@@ -312,9 +320,16 @@ class CudaSinoMeanDeringer(SinoMeanDeringer):
312
320
  if output is not None:
313
321
  raise NotImplementedError
314
322
  #
315
- self._mean_kernel(sino, *self._mean_kernel_args, **self._mean_kernel_kwargs)
323
+ if not (sino.flags.c_contiguous):
324
+ d_sino = self.processing.allocate_array("d_sino", sino.shape, np.float32)
325
+ d_sino[:] = sino[:]
326
+ else:
327
+ d_sino = sino
328
+ self._mean_kernel(d_sino, *self._mean_kernel_args, **self._mean_kernel_kwargs)
316
329
  self._apply_filter(self.d_sino_profile)
317
- self._op_kernel(sino, *self._op_kernel_args, **self._op_kernel_kwargs)
330
+ self._op_kernel(d_sino, *self._op_kernel_args, **self._op_kernel_kwargs)
331
+ if not (sino.flags.c_contiguous):
332
+ sino[:] = self.processing.d_sino[:]
318
333
  return sino
319
334
 
320
335
  def remove_rings_sinograms(self, sinograms):
@@ -726,7 +726,6 @@ def test_get_overlap_areas():
726
726
 
727
727
  def test_frame_flip(tmp_path):
728
728
  """check it with some NXtomo fliped"""
729
- pytest.skip(reason="Broken test")
730
729
  ref_frame_width = 280
731
730
  n_proj = 10
732
731
  raw_frame_width = 100
@@ -1258,7 +1258,7 @@ class PreProcessZStitcher(ZStitcher):
1258
1258
 
1259
1259
  output_dtype = get_output_data_type()
1260
1260
  # append frames ("instrument/detactor/data" dataset)
1261
- with HDF5File(filename=self.configuration.output_file_path, mode="a") as h5f:
1261
+ with HDF5File(self.configuration.output_file_path, mode="a") as h5f:
1262
1262
  # note: nx_tomo.save already handles the possible overwrite conflict by removing
1263
1263
  # self.configuration.output_file_path or raising an error
1264
1264
 
@@ -1834,7 +1834,7 @@ class PostProcessZStitcher(ZStitcher):
1834
1834
  def __enter__(self):
1835
1835
  # handle the specific case of HDF5. Goal: avoid getting the full stitched volume in memory
1836
1836
  if isinstance(self._volume, HDF5Volume):
1837
- self.__file_handler = HDF5File(filename=self._volume.data_url.file_path(), mode="a")
1837
+ self.__file_handler = HDF5File(self._volume.data_url.file_path(), mode="a")
1838
1838
  # if need to delete an existing dataset
1839
1839
  if self._volume.overwrite and self._volume.data_path in self.__file_handler:
1840
1840
  try:
@@ -1902,7 +1902,7 @@ class PostProcessZStitcher(ZStitcher):
1902
1902
  if volume.data is not None:
1903
1903
  data = volume.data
1904
1904
  elif isinstance(volume, HDF5Volume):
1905
- file_handler = HDF5File(filename=volume.data_url.file_path(), mode="r")
1905
+ file_handler = HDF5File(volume.data_url.file_path(), mode="r")
1906
1906
  dataset = file_handler[volume.data_url.data_path()]
1907
1907
  data = dataset
1908
1908
  self.__file_handlers.append(file_handler)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nabu
3
- Version: 2024.1.1
3
+ Version: 2024.1.3
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>
@@ -53,7 +53,7 @@ Requires-Dist: numpy>1.9.0
53
53
  Requires-Dist: scipy
54
54
  Requires-Dist: h5py>=3.0
55
55
  Requires-Dist: silx>=0.15.0
56
- Requires-Dist: tomoscan>=2.0.0a7
56
+ Requires-Dist: tomoscan>=2.0.4
57
57
  Requires-Dist: psutil
58
58
  Requires-Dist: pytest
59
59
  Requires-Dist: tifffile
@@ -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
@@ -295,4 +296,35 @@ nabu/thirdparty/algotom_convert_sino.py
295
296
  nabu/thirdparty/pore3d_deringer_munch.py
296
297
  nabu/thirdparty/tomocupy_remove_stripe.py
297
298
  nabu/thirdparty/tomopy_phase.py
298
- 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
@@ -2,7 +2,7 @@ numpy>1.9.0
2
2
  scipy
3
3
  h5py>=3.0
4
4
  silx>=0.15.0
5
- tomoscan>=2.0.0a7
5
+ tomoscan>=2.0.4
6
6
  psutil
7
7
  pytest
8
8
  tifffile
@@ -53,7 +53,7 @@ dependencies = [
53
53
  "scipy",
54
54
  "h5py>=3.0",
55
55
  "silx >= 0.15.0",
56
- "tomoscan >= 2.0.0a7",
56
+ "tomoscan >= 2.0.4",
57
57
  "psutil",
58
58
  "pytest",
59
59
  "tifffile",
@@ -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
+
@@ -0,0 +1,123 @@
1
+ from time import sleep
2
+ import pycuda.autoinit
3
+ import pycuda.gpuarray as garray
4
+ from nabu.resources.processconfig import ProcessConfig
5
+ from nabu.resources.tasks import build_processing_steps
6
+
7
+ from nabu.app.logger import Logger
8
+
9
+ from nabu.app.chunkreader import ChunkReaderComponent
10
+ from nabu.app.flatfield import FlatFieldComponent
11
+ from nabu.app.phase import PhaseRetrievalComponent
12
+ from nabu.app.opmap import NegativeLogComponent
13
+ from nabu.app.ccdfilter import CCDFilterComponent
14
+ from nabu.app.unsharp import UnsharpMaskComponent
15
+ from nabu.app.reconstructor import ReconstructorComponent
16
+
17
+
18
+ if __name__ == "__main__":
19
+
20
+ conf = ProcessConfig("/home/pierre/workspace/data/nabu.conf")
21
+ steps, options = build_processing_steps(conf)
22
+ dataset_infos = conf.dataset_infos
23
+ SUB_REGION = (None, None, None, 50)
24
+
25
+ logger = Logger("nabu_processing", console=True)
26
+
27
+ # Read chunk
28
+ options["read_chunk"]["sub_region"] = SUB_REGION
29
+ options["read_chunk"]["convert_float"] = True
30
+ Ch = ChunkReaderComponent(options["read_chunk"], dataset_infos, logger=logger)
31
+ Ch.execute()
32
+ radios = Ch.chunk_reader.files_data
33
+ d_radios = garray.to_gpu(radios)
34
+
35
+ # Flat-field
36
+ options["flatfield"]["sub_region"] = SUB_REGION
37
+ options["flatfield"]["use_opencl"] = False
38
+ options["flatfield"]["use_cuda"] = True
39
+ F = FlatFieldComponent(d_radios, options["flatfield"], dataset_infos, logger=logger)
40
+ F.execute()
41
+
42
+ # CCD filter
43
+ options["ccd_correction"]["use_cuda"] = True
44
+ options["ccd_correction"]["use_opencl"] = False
45
+ CCD = CCDFilterComponent(d_radios, options["ccd_correction"], dataset_infos, logger=logger)
46
+ CCD.execute()
47
+
48
+
49
+ # Phase retrieval
50
+ options["phase"]["use_cuda"] = True
51
+ options["phase"]["use_opencl"] = False
52
+ P = PhaseRetrievalComponent(radios[0].shape, options["phase"], dataset_infos, logger=logger)
53
+ P.execute(d_radios)
54
+
55
+ # Unsharp
56
+ # ~ options["unsharp_mask"]["use_cuda"] = True
57
+ # ~ options["unsharp_mask"]["use_opencl"] = False
58
+ # ~ U = UnsharpMaskComponent(radios[0].shape, options["unsharp_mask"], dataset_infos, logger=logger)
59
+ # ~ U.execute(d_radios)
60
+
61
+ # -log()
62
+ options["take_log"]["use_cuda"] = True
63
+ options["take_log"]["use_opencl"] = False
64
+ L = NegativeLogComponent(d_radios, options["take_log"], dataset_infos, logger=logger)
65
+ L.execute()
66
+
67
+
68
+ # Test
69
+ # ~ from spire.utils import ims
70
+ # ~ r = d_radios.get()
71
+ # ~ ims(r[:, 10, :])
72
+
73
+
74
+ # Reconstruction
75
+ options["reconstruction"]["use_cuda"] = True
76
+
77
+ # Test ...
78
+ if 1:
79
+ options["reconstruction"]["start_x"] = 100
80
+ options["reconstruction"]["end_x"] = -100
81
+ options["reconstruction"]["start_y"] = 100
82
+ options["reconstruction"]["end_y"] = -100
83
+ options["reconstruction"]["start_z"] = 0
84
+ options["reconstruction"]["end_z"] = SUB_REGION[-1]-1
85
+ d_rec = garray.zeros((50, 1849, 1849), "f") # y
86
+ #
87
+ else:
88
+ d_rec = garray.zeros((SUB_REGION[-1], 2048, 2048), "f")
89
+ R = ReconstructorComponent(d_radios.shape, options["reconstruction"], dataset_infos, logger=logger)
90
+ R.execute(d_radios, output=d_rec)
91
+
92
+
93
+ # Write to file
94
+ rec = d_rec.get()
95
+ import numpy as np
96
+ np.save("/home/pierre/tmp/crayon/recs_nabu_vertical.npy", rec)
97
+
98
+ """from nabu.reconstruction.reconstructor_cuda import CudaReconstructor
99
+ R = CudaReconstructor(
100
+ radios.shape,
101
+ [0, 1],
102
+ vol_type="projections",
103
+ extra_options={"padding_mode": conf.nabu_config["reconstruction"]["padding_type"]}
104
+ )
105
+ d_recs = garray.zeros((1, 2048, 2048), "f")
106
+ R.reconstruct(d_radios, output=d_recs)
107
+ recs = d_recs.get()
108
+ ims(recs[0], cmap="gray")
109
+ # save
110
+ import numpy as np
111
+ np.save("/tmp/rec0.npy", recs[0])
112
+ """
113
+
114
+
115
+ """
116
+ Notes
117
+ - If the cuda backend is used at step N, it should also be used at step N+1,
118
+
119
+
120
+ otherwise we have to get() the data
121
+
122
+ """
123
+
@@ -0,0 +1,37 @@
1
+ %%cython --compile-args=-fopenmp --link-args=-fopenmp -a
2
+ #%%cython -a
3
+ #cython: embedsignature=True, language_level=3, binding=True
4
+ #cython: boundscheck=False, wraparound=False, cdivision=True, initializedcheck=False,
5
+ ## This is for developping:
6
+ ## cython: profile=True, warn.undeclared=True, warn.unused=True, warn.unused_result=False, warn.unused_arg=True
7
+
8
+ import numpy as np
9
+ from cython.parallel import prange
10
+ """
11
+ def bin2_cython(float[:, ::1] img):
12
+ cdef:
13
+ float[:, ::1] res
14
+ int i, j, Ny, Nx
15
+
16
+ shp = img.shape
17
+ Ny, Nx = (img.shape[0]//2, img.shape[1]//2)
18
+ res = np.zeros((Ny, Nx), dtype="f")
19
+ for i in prange(Ny, nogil=True):
20
+ for j in range(Nx):
21
+ res[i, j] = 0.25 * (img[2*i, 2*j] + img[2*i+1, 2*j] + img[2*i, 2*j+1] + img[2*i+1, 2*j+1])
22
+ return np.asarray(res)
23
+ """
24
+
25
+
26
+ def bin2_cython(unsigned short[:, ::1] img):
27
+ cdef:
28
+ float[:, ::1] res
29
+ int i, j, Ny, Nx
30
+
31
+ shp = img.shape
32
+ Ny, Nx = (img.shape[0]//2, img.shape[1]//2)
33
+ res = np.zeros((Ny, Nx), dtype="f")
34
+ for i in prange(Ny, nogil=True):
35
+ for j in range(Nx):
36
+ res[i, j] = 0.25 * (img[2*i, 2*j] + img[2*i+1, 2*j] + img[2*i, 2*j+1] + img[2*i+1, 2*j+1])
37
+ return np.asarray(res)