nabu 2024.1.2__tar.gz → 2024.1.4__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.2/nabu.egg-info → nabu-2024.1.4}/PKG-INFO +22 -2
  2. nabu-2024.1.4/doc/doc_config.py +32 -0
  3. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/__init__.py +1 -1
  4. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/pipeline/dataset_validator.py +2 -1
  5. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/pipeline/fullfield/processconfig.py +17 -8
  6. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/pipeline/tests/test_chunk_reader.py +0 -4
  7. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/reconstruction/rings_cuda.py +25 -10
  8. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/utils.py +0 -13
  9. {nabu-2024.1.2 → nabu-2024.1.4/nabu.egg-info}/PKG-INFO +22 -2
  10. {nabu-2024.1.2 → nabu-2024.1.4}/nabu.egg-info/SOURCES.txt +33 -2
  11. {nabu-2024.1.2 → nabu-2024.1.4}/nabu.egg-info/top_level.txt +0 -2
  12. nabu-2024.1.4/sandbox/align_test.py +61 -0
  13. nabu-2024.1.4/sandbox/app.py +123 -0
  14. nabu-2024.1.4/sandbox/binning_cython.py +37 -0
  15. nabu-2024.1.4/sandbox/circ_sm.py +195 -0
  16. nabu-2024.1.4/sandbox/composite_image.py +90 -0
  17. nabu-2024.1.4/sandbox/convert_id15.py +148 -0
  18. nabu-2024.1.4/sandbox/do_test_ctf.py +40 -0
  19. nabu-2024.1.4/sandbox/esrf_envs.py +36 -0
  20. nabu-2024.1.4/sandbox/fbp_polar.py +39 -0
  21. nabu-2024.1.4/sandbox/fbp_tilt.py +340 -0
  22. nabu-2024.1.4/sandbox/interleaved.py +129 -0
  23. nabu-2024.1.4/sandbox/interp_sinos_halftomo.py +31 -0
  24. nabu-2024.1.4/sandbox/linear_interp.py +14 -0
  25. nabu-2024.1.4/sandbox/merge_recs.py +56 -0
  26. nabu-2024.1.4/sandbox/moduleutils.py +50 -0
  27. nabu-2024.1.4/sandbox/nbreconstruct.py +246 -0
  28. nabu-2024.1.4/sandbox/pag_margin.py +38 -0
  29. nabu-2024.1.4/sandbox/parse.py +132 -0
  30. nabu-2024.1.4/sandbox/plot.py +49 -0
  31. nabu-2024.1.4/sandbox/proj3D.py +75 -0
  32. nabu-2024.1.4/sandbox/rec_bm05.py +71 -0
  33. nabu-2024.1.4/sandbox/rec_thread.py +133 -0
  34. nabu-2024.1.4/sandbox/shift_bilinear2.py +42 -0
  35. nabu-2024.1.4/sandbox/sinotilt.py +181 -0
  36. nabu-2024.1.4/sandbox/sysutils.py +63 -0
  37. nabu-2024.1.4/sandbox/test_mp_queue.py +73 -0
  38. nabu-2024.1.4/sandbox/tilt.py +251 -0
  39. nabu-2024.1.4/sandbox/utils.py +54 -0
  40. nabu-2024.1.4/sandbox/vo.py +204 -0
  41. nabu-2024.1.4/sandbox/workers.py +123 -0
  42. nabu-2024.1.4/sandbox/xrdrec_pyFAI_data.py +212 -0
  43. nabu-2024.1.2/nabu/thirdparty/__init__.py +0 -0
  44. {nabu-2024.1.2 → nabu-2024.1.4}/LICENSE +0 -0
  45. {nabu-2024.1.2 → nabu-2024.1.4}/README.md +0 -0
  46. {nabu-2024.1.2 → nabu-2024.1.4}/doc/conf.py +0 -0
  47. {nabu-2024.1.2 → nabu-2024.1.4}/doc/create_conf_doc.py +0 -0
  48. {nabu-2024.1.2 → nabu-2024.1.4}/doc/get_mathjax.py +0 -0
  49. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/app/__init__.py +0 -0
  50. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/app/bootstrap.py +0 -0
  51. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/app/bootstrap_stitching.py +0 -0
  52. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/app/cast_volume.py +0 -0
  53. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/app/cli_configs.py +0 -0
  54. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/app/compare_volumes.py +0 -0
  55. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/app/composite_cor.py +0 -0
  56. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/app/correct_rot.py +0 -0
  57. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/app/create_distortion_map_from_poly.py +0 -0
  58. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/app/diag_to_pix.py +0 -0
  59. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/app/diag_to_rot.py +0 -0
  60. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/app/double_flatfield.py +0 -0
  61. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/app/generate_header.py +0 -0
  62. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/app/histogram.py +0 -0
  63. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/app/multicor.py +0 -0
  64. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/app/nx_z_splitter.py +0 -0
  65. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/app/parse_reconstruction_log.py +0 -0
  66. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/app/prepare_weights_double.py +0 -0
  67. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/app/reconstruct.py +0 -0
  68. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/app/reconstruct_helical.py +0 -0
  69. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/app/reduce_dark_flat.py +0 -0
  70. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/app/rotate.py +0 -0
  71. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/app/shrink_dataset.py +0 -0
  72. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/app/stitching.py +0 -0
  73. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/app/tests/test_reduce_dark_flat.py +0 -0
  74. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/app/utils.py +0 -0
  75. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/app/validator.py +0 -0
  76. {nabu-2024.1.2/nabu/app/tests → nabu-2024.1.4/nabu/cuda}/__init__.py +0 -0
  77. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/cuda/convolution.py +0 -0
  78. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/cuda/fft.py +0 -0
  79. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/cuda/kernel.py +0 -0
  80. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/cuda/medfilt.py +0 -0
  81. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/cuda/padding.py +0 -0
  82. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/cuda/processing.py +0 -0
  83. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/cuda/src/ElementOp.cu +0 -0
  84. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/cuda/src/backproj.cu +0 -0
  85. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/cuda/src/backproj_polar.cu +0 -0
  86. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/cuda/src/boundary.h +0 -0
  87. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/cuda/src/convolution.cu +0 -0
  88. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/cuda/src/dfi_fftshift.cu +0 -0
  89. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/cuda/src/flatfield.cu +0 -0
  90. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/cuda/src/fourier_wavelets.cu +0 -0
  91. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/cuda/src/halftomo.cu +0 -0
  92. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/cuda/src/helical_padding.cu +0 -0
  93. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/cuda/src/histogram.cu +0 -0
  94. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/cuda/src/interpolation.cu +0 -0
  95. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/cuda/src/medfilt.cu +0 -0
  96. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/cuda/src/normalization.cu +0 -0
  97. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/cuda/src/padding.cu +0 -0
  98. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/cuda/src/proj.cu +0 -0
  99. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/cuda/src/rotation.cu +0 -0
  100. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/cuda/src/transpose.cu +0 -0
  101. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/cuda/tests/__init__.py +0 -0
  102. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/cuda/utils.py +0 -0
  103. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/estimation/__init__.py +0 -0
  104. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/estimation/alignment.py +0 -0
  105. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/estimation/cor.py +0 -0
  106. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/estimation/cor_sino.py +0 -0
  107. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/estimation/distortion.py +0 -0
  108. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/estimation/focus.py +0 -0
  109. {nabu-2024.1.2/nabu/cuda → nabu-2024.1.4/nabu/estimation/tests}/__init__.py +0 -0
  110. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/estimation/tests/test_alignment.py +0 -0
  111. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/estimation/tests/test_cor.py +0 -0
  112. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/estimation/tests/test_focus.py +0 -0
  113. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/estimation/tests/test_tilt.py +0 -0
  114. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/estimation/tests/test_translation.py +0 -0
  115. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/estimation/tilt.py +0 -0
  116. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/estimation/translation.py +0 -0
  117. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/estimation/utils.py +0 -0
  118. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/io/__init__.py +0 -0
  119. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/io/cast_volume.py +0 -0
  120. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/io/detector_distortion.py +0 -0
  121. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/io/reader.py +0 -0
  122. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/io/reader_helical.py +0 -0
  123. {nabu-2024.1.2/nabu/estimation → nabu-2024.1.4/nabu/io}/tests/__init__.py +0 -0
  124. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/io/tests/test_cast_volume.py +0 -0
  125. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/io/tests/test_detector_distortion.py +0 -0
  126. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/io/tests/test_writers.py +0 -0
  127. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/io/tiffwriter_zmm.py +0 -0
  128. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/io/utils.py +0 -0
  129. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/io/writer.py +0 -0
  130. {nabu-2024.1.2/nabu/io/tests → nabu-2024.1.4/nabu/misc}/__init__.py +0 -0
  131. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/misc/binning.py +0 -0
  132. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/misc/fftshift.py +0 -0
  133. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/misc/filters.py +0 -0
  134. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/misc/fourier_filters.py +0 -0
  135. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/misc/histogram.py +0 -0
  136. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/misc/histogram_cuda.py +0 -0
  137. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/misc/kernel_base.py +0 -0
  138. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/misc/padding.py +0 -0
  139. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/misc/padding_base.py +0 -0
  140. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/misc/processing_base.py +0 -0
  141. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/misc/rotation.py +0 -0
  142. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/misc/rotation_cuda.py +0 -0
  143. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/misc/tests/__init__.py +0 -0
  144. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/misc/tests/test_binning.py +0 -0
  145. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/misc/tests/test_interpolation.py +0 -0
  146. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/misc/transpose.py +0 -0
  147. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/misc/unsharp.py +0 -0
  148. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/misc/unsharp_cuda.py +0 -0
  149. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/misc/unsharp_opencl.py +0 -0
  150. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/misc/utils.py +0 -0
  151. {nabu-2024.1.2/nabu/misc → nabu-2024.1.4/nabu/opencl}/__init__.py +0 -0
  152. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/opencl/fft.py +0 -0
  153. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/opencl/kernel.py +0 -0
  154. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/opencl/memcpy.py +0 -0
  155. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/opencl/padding.py +0 -0
  156. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/opencl/processing.py +0 -0
  157. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/opencl/src/ElementOp.cl +0 -0
  158. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/opencl/src/backproj.cl +0 -0
  159. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/opencl/src/fftshift.cl +0 -0
  160. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/opencl/src/halftomo.cl +0 -0
  161. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/opencl/src/padding.cl +0 -0
  162. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/opencl/src/roll.cl +0 -0
  163. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/opencl/src/transpose.cl +0 -0
  164. {nabu-2024.1.2/nabu/opencl → nabu-2024.1.4/nabu/opencl/tests}/__init__.py +0 -0
  165. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/opencl/utils.py +0 -0
  166. {nabu-2024.1.2/nabu/opencl/tests → nabu-2024.1.4/nabu/pipeline}/__init__.py +0 -0
  167. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/pipeline/config.py +0 -0
  168. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/pipeline/config_validators.py +0 -0
  169. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/pipeline/datadump.py +0 -0
  170. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/pipeline/detector_distortion_provider.py +0 -0
  171. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/pipeline/estimators.py +0 -0
  172. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/pipeline/fallback_utils.py +0 -0
  173. {nabu-2024.1.2/nabu/pipeline → nabu-2024.1.4/nabu/pipeline/fullfield}/__init__.py +0 -0
  174. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/pipeline/fullfield/chunked.py +0 -0
  175. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/pipeline/fullfield/chunked_cuda.py +0 -0
  176. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/pipeline/fullfield/computations.py +0 -0
  177. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/pipeline/fullfield/dataset_validator.py +0 -0
  178. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/pipeline/fullfield/nabu_config.py +0 -0
  179. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/pipeline/fullfield/reconstruction.py +0 -0
  180. {nabu-2024.1.2/nabu/pipeline/fullfield → nabu-2024.1.4/nabu/pipeline/helical}/__init__.py +0 -0
  181. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/pipeline/helical/dataset_validator.py +0 -0
  182. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/pipeline/helical/fbp.py +0 -0
  183. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/pipeline/helical/filtering.py +0 -0
  184. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/pipeline/helical/gridded_accumulator.py +0 -0
  185. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/pipeline/helical/helical_chunked_regridded.py +0 -0
  186. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/pipeline/helical/helical_chunked_regridded_cuda.py +0 -0
  187. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/pipeline/helical/helical_reconstruction.py +0 -0
  188. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/pipeline/helical/helical_utils.py +0 -0
  189. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/pipeline/helical/nabu_config.py +0 -0
  190. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/pipeline/helical/processconfig.py +0 -0
  191. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/pipeline/helical/span_strategy.py +0 -0
  192. {nabu-2024.1.2/nabu/pipeline/helical → nabu-2024.1.4/nabu/pipeline/helical/tests}/__init__.py +0 -0
  193. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/pipeline/helical/tests/test_accumulator.py +0 -0
  194. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/pipeline/helical/tests/test_pipeline_elements_full.py +0 -0
  195. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/pipeline/helical/tests/test_strategy.py +0 -0
  196. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/pipeline/helical/utils.py +0 -0
  197. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/pipeline/helical/weight_balancer.py +0 -0
  198. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/pipeline/params.py +0 -0
  199. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/pipeline/processconfig.py +0 -0
  200. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/pipeline/tests/test_estimators.py +0 -0
  201. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/pipeline/utils.py +0 -0
  202. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/pipeline/writer.py +0 -0
  203. {nabu-2024.1.2/nabu/pipeline/helical/tests → nabu-2024.1.4/nabu/pipeline/xrdct}/__init__.py +0 -0
  204. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/preproc/__init__.py +0 -0
  205. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/preproc/alignment.py +0 -0
  206. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/preproc/ccd.py +0 -0
  207. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/preproc/ccd_cuda.py +0 -0
  208. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/preproc/ctf.py +0 -0
  209. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/preproc/ctf_cuda.py +0 -0
  210. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/preproc/distortion.py +0 -0
  211. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/preproc/double_flatfield.py +0 -0
  212. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/preproc/double_flatfield_cuda.py +0 -0
  213. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/preproc/double_flatfield_variable_region.py +0 -0
  214. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/preproc/flatfield.py +0 -0
  215. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/preproc/flatfield_cuda.py +0 -0
  216. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/preproc/flatfield_variable_region.py +0 -0
  217. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/preproc/phase.py +0 -0
  218. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/preproc/phase_cuda.py +0 -0
  219. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/preproc/shift.py +0 -0
  220. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/preproc/shift_cuda.py +0 -0
  221. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/preproc/tests/__init__.py +0 -0
  222. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/preproc/tests/test_ccd_corr.py +0 -0
  223. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/preproc/tests/test_ctf.py +0 -0
  224. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/preproc/tests/test_double_flatfield.py +0 -0
  225. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/preproc/tests/test_flatfield.py +0 -0
  226. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/preproc/tests/test_paganin.py +0 -0
  227. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/preproc/tests/test_vshift.py +0 -0
  228. {nabu-2024.1.2/nabu/pipeline/xrdct → nabu-2024.1.4/nabu/processing}/__init__.py +0 -0
  229. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/processing/convolution_cuda.py +0 -0
  230. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/processing/fft_base.py +0 -0
  231. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/processing/fft_cuda.py +0 -0
  232. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/processing/fft_opencl.py +0 -0
  233. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/processing/fftshift.py +0 -0
  234. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/processing/histogram.py +0 -0
  235. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/processing/histogram_cuda.py +0 -0
  236. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/processing/kernel_base.py +0 -0
  237. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/processing/medfilt_cuda.py +0 -0
  238. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/processing/muladd.py +0 -0
  239. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/processing/muladd_cuda.py +0 -0
  240. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/processing/padding_base.py +0 -0
  241. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/processing/padding_cuda.py +0 -0
  242. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/processing/padding_opencl.py +0 -0
  243. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/processing/processing_base.py +0 -0
  244. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/processing/roll_opencl.py +0 -0
  245. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/processing/rotation.py +0 -0
  246. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/processing/rotation_cuda.py +0 -0
  247. {nabu-2024.1.2/nabu/processing → nabu-2024.1.4/nabu/processing/tests}/__init__.py +0 -0
  248. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/processing/tests/test_fft.py +0 -0
  249. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/processing/tests/test_fftshift.py +0 -0
  250. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/processing/tests/test_histogram.py +0 -0
  251. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/processing/tests/test_medfilt.py +0 -0
  252. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/processing/tests/test_muladd.py +0 -0
  253. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/processing/tests/test_padding.py +0 -0
  254. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/processing/tests/test_roll.py +0 -0
  255. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/processing/tests/test_rotation.py +0 -0
  256. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/processing/tests/test_transpose.py +0 -0
  257. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/processing/tests/test_unsharp.py +0 -0
  258. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/processing/transpose.py +0 -0
  259. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/processing/unsharp.py +0 -0
  260. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/processing/unsharp_cuda.py +0 -0
  261. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/processing/unsharp_opencl.py +0 -0
  262. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/reconstruction/__init__.py +0 -0
  263. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/reconstruction/cone.py +0 -0
  264. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/reconstruction/fbp.py +0 -0
  265. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/reconstruction/fbp_base.py +0 -0
  266. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/reconstruction/fbp_opencl.py +0 -0
  267. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/reconstruction/filtering.py +0 -0
  268. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/reconstruction/filtering_cuda.py +0 -0
  269. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/reconstruction/filtering_opencl.py +0 -0
  270. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/reconstruction/projection.py +0 -0
  271. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/reconstruction/reconstructor.py +0 -0
  272. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/reconstruction/reconstructor_cuda.py +0 -0
  273. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/reconstruction/rings.py +0 -0
  274. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/reconstruction/sinogram.py +0 -0
  275. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/reconstruction/sinogram_cuda.py +0 -0
  276. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/reconstruction/sinogram_opencl.py +0 -0
  277. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/reconstruction/tests/__init__.py +0 -0
  278. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/reconstruction/tests/test_cone.py +0 -0
  279. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/reconstruction/tests/test_deringer.py +0 -0
  280. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/reconstruction/tests/test_fbp.py +0 -0
  281. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/reconstruction/tests/test_filtering.py +0 -0
  282. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/reconstruction/tests/test_halftomo.py +0 -0
  283. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/reconstruction/tests/test_projector.py +0 -0
  284. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/reconstruction/tests/test_reconstructor.py +0 -0
  285. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/reconstruction/tests/test_sino_normalization.py +0 -0
  286. {nabu-2024.1.2/nabu/processing/tests → nabu-2024.1.4/nabu/resources}/__init__.py +0 -0
  287. {nabu-2024.1.2/nabu/resources → nabu-2024.1.4/nabu/resources/cli}/__init__.py +0 -0
  288. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/resources/cor.py +0 -0
  289. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/resources/dataset_analyzer.py +0 -0
  290. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/resources/gpu.py +0 -0
  291. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/resources/logger.py +0 -0
  292. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/resources/nxflatfield.py +0 -0
  293. {nabu-2024.1.2/nabu/resources/cli → nabu-2024.1.4/nabu/resources/templates}/__init__.py +0 -0
  294. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/resources/templates/bm05_pag.conf +0 -0
  295. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/resources/templates/id16_ctf.conf +0 -0
  296. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/resources/templates/id16_holo.conf +0 -0
  297. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/resources/templates/id19_pag.conf +0 -0
  298. {nabu-2024.1.2/nabu/resources/templates → nabu-2024.1.4/nabu/resources/tests}/__init__.py +0 -0
  299. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/resources/tests/test_nxflatfield.py +0 -0
  300. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/resources/tests/test_units.py +0 -0
  301. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/resources/utils.py +0 -0
  302. {nabu-2024.1.2/nabu/resources/tests → nabu-2024.1.4/nabu/stitching}/__init__.py +0 -0
  303. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/stitching/alignment.py +0 -0
  304. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/stitching/config.py +0 -0
  305. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/stitching/definitions.py +0 -0
  306. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/stitching/frame_composition.py +0 -0
  307. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/stitching/overlap.py +0 -0
  308. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/stitching/sample_normalization.py +0 -0
  309. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/stitching/slurm_utils.py +0 -0
  310. {nabu-2024.1.2/nabu/stitching → nabu-2024.1.4/nabu/stitching/tests}/__init__.py +0 -0
  311. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/stitching/tests/test_alignment.py +0 -0
  312. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/stitching/tests/test_config.py +0 -0
  313. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/stitching/tests/test_frame_composition.py +0 -0
  314. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/stitching/tests/test_overlap.py +0 -0
  315. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/stitching/tests/test_sample_normalization.py +0 -0
  316. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/stitching/tests/test_slurm_utils.py +0 -0
  317. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/stitching/tests/test_utils.py +0 -0
  318. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/stitching/tests/test_z_stitching.py +0 -0
  319. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/stitching/utils.py +0 -0
  320. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/stitching/z_stitching.py +0 -0
  321. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/tests.py +0 -0
  322. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/testutils.py +0 -0
  323. {nabu-2024.1.2/nabu/stitching/tests → nabu-2024.1.4/nabu/thirdparty}/__init__.py +0 -0
  324. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/thirdparty/algotom_convert_sino.py +0 -0
  325. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/thirdparty/pore3d_deringer_munch.py +0 -0
  326. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/thirdparty/tomocupy_remove_stripe.py +0 -0
  327. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/thirdparty/tomopy_phase.py +0 -0
  328. {nabu-2024.1.2 → nabu-2024.1.4}/nabu/thirdparty/tomwer_load_flats_darks.py +0 -0
  329. {nabu-2024.1.2 → nabu-2024.1.4}/nabu.egg-info/dependency_links.txt +0 -0
  330. {nabu-2024.1.2 → nabu-2024.1.4}/nabu.egg-info/entry_points.txt +0 -0
  331. {nabu-2024.1.2 → nabu-2024.1.4}/nabu.egg-info/requires.txt +0 -0
  332. {nabu-2024.1.2 → nabu-2024.1.4}/pyproject.toml +0 -0
  333. {nabu-2024.1.2 → nabu-2024.1.4}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nabu
3
- Version: 2024.1.2
3
+ Version: 2024.1.4
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>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; 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.2"
1
+ __version__ = "2024.1.4"
2
2
  __nabu_modules__ = [
3
3
  "app",
4
4
  "cuda",
@@ -157,8 +157,9 @@ class DatasetValidatorBase:
157
157
  """
158
158
  dataset_cfg = self.nabu_config["dataset"]
159
159
  self.binning = (dataset_cfg["binning"], dataset_cfg["binning_z"])
160
- subsampling_factor, subsampling_begin = dataset_cfg["projections_subsampling"]
160
+ subsampling_factor, subsampling_start = dataset_cfg["projections_subsampling"]
161
161
  self.subsampling_factor = subsampling_factor or 1
162
+ self.subsampling_start = subsampling_start or 0
162
163
 
163
164
  if self.binning != (1, 1):
164
165
  bin_x, bin_z = self.binning
@@ -83,6 +83,10 @@ class ProcessConfig(ProcessConfigBase):
83
83
  )
84
84
  self.rec_params = self.nabu_config["reconstruction"]
85
85
 
86
+ subsampling_factor, subsampling_start = self.nabu_config["dataset"]["projections_subsampling"]
87
+ self.subsampling_factor = subsampling_factor or 1
88
+ self.subsampling_start = subsampling_start or 0
89
+
86
90
  self._update_dataset_with_user_overwrites()
87
91
  self._get_rotation_axis_position()
88
92
  self._update_rotation_angles()
@@ -118,8 +122,9 @@ class ProcessConfig(ProcessConfigBase):
118
122
  if transl_file is not None and "://" not in transl_file:
119
123
  try:
120
124
  translations = get_values_from_file(
121
- transl_file, shape=(self.dataset_info.n_angles, last_dim), any_size=True
125
+ transl_file, shape=(self.n_angles(subsampling=False), last_dim), any_size=True
122
126
  ).astype(np.float32)
127
+ translations = translations[self.subsampling_start :: self.subsampling_factor]
123
128
  except ValueError:
124
129
  print("Something wrong with translation_movements_file %s" % transl_file)
125
130
  raise
@@ -145,9 +150,10 @@ class ProcessConfig(ProcessConfigBase):
145
150
  try:
146
151
  axis_correction = get_values_from_file(
147
152
  axis_correction_file,
148
- n_values=self.dataset_info.n_angles,
153
+ n_values=self.n_angles(subsampling=False),
149
154
  any_size=True,
150
155
  ).astype(np.float32)
156
+ axis_correction = axis_correction[self.subsampling_start :: self.subsampling_factor]
151
157
  except ValueError:
152
158
  print("Something wrong with axis correction file %s" % axis_correction_file)
153
159
  raise
@@ -225,7 +231,7 @@ class ProcessConfig(ProcessConfigBase):
225
231
  self.logger.debug("Doing coupled validation")
226
232
  self._dataset_validator = FullFieldDatasetValidator(self.nabu_config, self.dataset_info)
227
233
  # Not so ideal to propagate fields like this
228
- for what in ["rec_params", "rec_region", "binning", "subsampling_factor"]:
234
+ for what in ["rec_params", "rec_region", "binning"]:
229
235
  setattr(self, what, getattr(self._dataset_validator, what))
230
236
 
231
237
  #
@@ -255,7 +261,7 @@ class ProcessConfig(ProcessConfigBase):
255
261
  def n_angles(self, subsampling=False):
256
262
  rot_angles = self.dataset_info.rotation_angles
257
263
  if subsampling:
258
- rot_angles = rot_angles[:: (self.subsampling or 1)]
264
+ rot_angles = rot_angles[self.subsampling_start :: self.subsampling_factor]
259
265
  return len(rot_angles)
260
266
 
261
267
  def radios_shape(self, binning=False, subsampling=False):
@@ -300,10 +306,12 @@ class ProcessConfig(ProcessConfigBase):
300
306
  return sorted(self.dataset_info.projections.keys())[::step]
301
307
 
302
308
  def rotation_angles(self, subsampling=False):
309
+ start = 0
303
310
  step = 1
304
311
  if subsampling:
305
- step = self.subsampling or 1
306
- return self.dataset_info.rotation_angles[::step]
312
+ start = self.subsampling_start
313
+ step = self.subsampling_factor
314
+ return self.dataset_info.rotation_angles[start::step]
307
315
 
308
316
  @property
309
317
  def rec_roi(self):
@@ -512,7 +520,7 @@ class ProcessConfig(ProcessConfigBase):
512
520
  translations = dataset_info.translations
513
521
  if translations is not None:
514
522
  tasks.append("radios_movements")
515
- options["radios_movements"] = {"translation_movements": dataset_info.translations[:: self.binning_z]}
523
+ options["radios_movements"] = {"translation_movements": dataset_info.translations}
516
524
  #
517
525
  # Sinogram normalization (before half-tomo)
518
526
  #
@@ -562,7 +570,8 @@ class ProcessConfig(ProcessConfigBase):
562
570
  rec_options["enable_halftomo"] = self.do_halftomo
563
571
  rec_options["axis_correction"] = dataset_info.axis_correction
564
572
  if dataset_info.axis_correction is not None:
565
- rec_options["axis_correction"] = rec_options["axis_correction"][:: self.subsampling_factor]
573
+ rec_options["axis_correction"] = rec_options["axis_correction"]
574
+
566
575
  rec_options["angles"] = np.array(self.rotation_angles(subsampling=True))
567
576
  rec_options["angles"] += np.deg2rad(nabu_config["reconstruction"]["angle_offset"])
568
577
  voxel_size = dataset_info.pixel_size * 1e-4
@@ -55,10 +55,6 @@ class TestChunkReader:
55
55
  first_sino_odd = reader.data[:, 0, :].copy()
56
56
  compacted_dataslices_odd = get_compacted_dataslices_as_sorted_tuples(reader)
57
57
 
58
- # from spire.utils import ims
59
- # ims([first_sino_all[::2], first_sino_even, first_sino_all[::2]*1. - first_sino_even])
60
- # ims([first_sino_all[::2], first_sino_even, first_sino_all[1::2]*1. - first_sino_odd])
61
-
62
58
  # Check that the compacted data slices are correct
63
59
  assert len(compacted_dataslices_all) == len(compacted_dataslices_even) == len(compacted_dataslices_odd)
64
60
  for data_slice_all, data_slice_even, data_slice_odd in zip(
@@ -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):
@@ -422,19 +422,6 @@ def copy_dict_items(dict_, keys):
422
422
  return res
423
423
 
424
424
 
425
- def remove_first_dict_items(dict_, n_items, sort_func=None, inplace=True):
426
- """
427
- Remove the first items of a dictionary. The keys have to be sortable
428
- """
429
- sorted_keys = sorted(dict_.keys(), key=sort_func)
430
- if inplace:
431
- for key in sorted_keys[:n_items]:
432
- dict_.pop(key)
433
- return dict_
434
- else:
435
- return copy_dict_items(dict_, sorted_keys[n_items:])
436
-
437
-
438
425
  def recursive_copy_dict(dict_):
439
426
  """
440
427
  Perform a shallow copy of a dictionary of dictionaries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nabu
3
- Version: 2024.1.2
3
+ Version: 2024.1.4
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>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; 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,5 +1,3 @@
1
- build
2
1
  dist
3
2
  doc
4
3
  nabu
5
- scripts
@@ -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)