holowizard 1.1.13__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 (346) hide show
  1. holowizard-1.1.13/.github/workflows/python-publish-to-production.yml +64 -0
  2. holowizard-1.1.13/.github/workflows/python-publish-to-test.yml +68 -0
  3. holowizard-1.1.13/.gitignore +182 -0
  4. holowizard-1.1.13/.gitlab-ci.yml +79 -0
  5. holowizard-1.1.13/LICENSE +21 -0
  6. holowizard-1.1.13/PKG-INFO +261 -0
  7. holowizard-1.1.13/README.md +211 -0
  8. holowizard-1.1.13/holowizard/__init__.py +0 -0
  9. holowizard-1.1.13/holowizard/core/LICENSE +21 -0
  10. holowizard-1.1.13/holowizard/core/__init__.py +20 -0
  11. holowizard-1.1.13/holowizard/core/api/__init__.py +0 -0
  12. holowizard-1.1.13/holowizard/core/api/functions/__init__.py +0 -0
  13. holowizard-1.1.13/holowizard/core/api/functions/default_load_data_callback.py +12 -0
  14. holowizard-1.1.13/holowizard/core/api/functions/find_focus/__init__.py +0 -0
  15. holowizard-1.1.13/holowizard/core/api/functions/find_focus/find_focus.py +21 -0
  16. holowizard-1.1.13/holowizard/core/api/functions/find_focus/find_focus_flatfieldcorrection.py +39 -0
  17. holowizard-1.1.13/holowizard/core/api/functions/find_focus/find_focus_flatfieldcorrection_io.py +35 -0
  18. holowizard-1.1.13/holowizard/core/api/functions/find_focus/find_focus_z01_a0.py +35 -0
  19. holowizard-1.1.13/holowizard/core/api/functions/find_focus/find_focus_z01_a0_flatfieldcorrection.py +55 -0
  20. holowizard-1.1.13/holowizard/core/api/functions/flatfield_correction/__init__.py +0 -0
  21. holowizard-1.1.13/holowizard/core/api/functions/flatfield_correction/calc_flatfield_components_io.py +44 -0
  22. holowizard-1.1.13/holowizard/core/api/functions/flatfield_correction/calc_flatfield_components_o.py +42 -0
  23. holowizard-1.1.13/holowizard/core/api/functions/flatfield_correction/flatfield_correction_i.py +31 -0
  24. holowizard-1.1.13/holowizard/core/api/functions/flatfield_correction/get_synthetic_flatfield.py +15 -0
  25. holowizard-1.1.13/holowizard/core/api/functions/probe_retrieval/__init__.py +0 -0
  26. holowizard-1.1.13/holowizard/core/api/functions/probe_retrieval/reconstruction.py +47 -0
  27. holowizard-1.1.13/holowizard/core/api/functions/single_projection/__init__.py +0 -0
  28. holowizard-1.1.13/holowizard/core/api/functions/single_projection/reconstruction.py +41 -0
  29. holowizard-1.1.13/holowizard/core/api/functions/single_projection/reconstruction_flatfieldcorrection.py +42 -0
  30. holowizard-1.1.13/holowizard/core/api/functions/single_projection/reconstruction_flatfieldcorrection_i.py +59 -0
  31. holowizard-1.1.13/holowizard/core/api/functions/single_projection/reconstruction_flatfieldcorrection_io.py +44 -0
  32. holowizard-1.1.13/holowizard/core/api/functions/single_projection/reconstruction_io.py +42 -0
  33. holowizard-1.1.13/holowizard/core/api/parameters/__init__.py +10 -0
  34. holowizard-1.1.13/holowizard/core/api/parameters/beam_setup.py +1 -0
  35. holowizard-1.1.13/holowizard/core/api/parameters/dask_options.py +1 -0
  36. holowizard-1.1.13/holowizard/core/api/parameters/data_dimensions.py +1 -0
  37. holowizard-1.1.13/holowizard/core/api/parameters/default_parameters/__init__.py +0 -0
  38. holowizard-1.1.13/holowizard/core/api/parameters/default_parameters/example_magnesium_wire.py +75 -0
  39. holowizard-1.1.13/holowizard/core/api/parameters/default_parameters/example_spider_hair.py +74 -0
  40. holowizard-1.1.13/holowizard/core/api/parameters/default_parameters/find_focus.py +60 -0
  41. holowizard-1.1.13/holowizard/core/api/parameters/flatfield_components_params.py +1 -0
  42. holowizard-1.1.13/holowizard/core/api/parameters/flatfield_correction_params.py +1 -0
  43. holowizard-1.1.13/holowizard/core/api/parameters/measurement.py +1 -0
  44. holowizard-1.1.13/holowizard/core/api/parameters/options.py +1 -0
  45. holowizard-1.1.13/holowizard/core/api/parameters/padding.py +1 -0
  46. holowizard-1.1.13/holowizard/core/api/parameters/paths/__init__.py +3 -0
  47. holowizard-1.1.13/holowizard/core/api/parameters/paths/focus_series_paths.py +30 -0
  48. holowizard-1.1.13/holowizard/core/api/parameters/paths/paths.py +1 -0
  49. holowizard-1.1.13/holowizard/core/api/parameters/paths/project_paths.py +159 -0
  50. holowizard-1.1.13/holowizard/core/api/parameters/reco_params.py +1 -0
  51. holowizard-1.1.13/holowizard/core/api/parameters/regularization.py +1 -0
  52. holowizard-1.1.13/holowizard/core/api/viewer/__init__.py +5 -0
  53. holowizard-1.1.13/holowizard/core/api/viewer/hdf5_viewer.py +100 -0
  54. holowizard-1.1.13/holowizard/core/api/viewer/loss_viewer.py +14 -0
  55. holowizard-1.1.13/holowizard/core/api/viewer/pyplot_viewer.py +58 -0
  56. holowizard-1.1.13/holowizard/core/api/viewer/pyplot_viewer_holodemo.py +42 -0
  57. holowizard-1.1.13/holowizard/core/api/viewer/pyplot_viewer_probe_retrieval.py +73 -0
  58. holowizard-1.1.13/holowizard/core/api/viewer/zeromq_viewer.py +66 -0
  59. holowizard-1.1.13/holowizard/core/dask_utils/__init__.py +0 -0
  60. holowizard-1.1.13/holowizard/core/dask_utils/dask_controller.py +119 -0
  61. holowizard-1.1.13/holowizard/core/find_focus/__init__.py +0 -0
  62. holowizard-1.1.13/holowizard/core/find_focus/find_focus_z01.py +108 -0
  63. holowizard-1.1.13/holowizard/core/find_focus/find_focus_z01_a0.py +140 -0
  64. holowizard-1.1.13/holowizard/core/find_focus/find_focus_z01_a0_orthogonal_search.py +181 -0
  65. holowizard-1.1.13/holowizard/core/find_focus/focus_loss_metrics.py +89 -0
  66. holowizard-1.1.13/holowizard/core/logging/__init__.py +3 -0
  67. holowizard-1.1.13/holowizard/core/logging/header.py +130 -0
  68. holowizard-1.1.13/holowizard/core/logging/logger.py +246 -0
  69. holowizard-1.1.13/holowizard/core/models/__init__.py +2 -0
  70. holowizard-1.1.13/holowizard/core/models/cone_beam.py +54 -0
  71. holowizard-1.1.13/holowizard/core/models/fresnel_propagator.py +144 -0
  72. holowizard-1.1.13/holowizard/core/models/fresnel_propagator_torch.py +75 -0
  73. holowizard-1.1.13/holowizard/core/parameters/__init__.py +22 -0
  74. holowizard-1.1.13/holowizard/core/parameters/beam_setup.py +123 -0
  75. holowizard-1.1.13/holowizard/core/parameters/dask_options.py +16 -0
  76. holowizard-1.1.13/holowizard/core/parameters/data_dimensions.py +143 -0
  77. holowizard-1.1.13/holowizard/core/parameters/flatfield_components_params.py +89 -0
  78. holowizard-1.1.13/holowizard/core/parameters/flatfield_correction_params.py +62 -0
  79. holowizard-1.1.13/holowizard/core/parameters/measurement.py +111 -0
  80. holowizard-1.1.13/holowizard/core/parameters/options.py +189 -0
  81. holowizard-1.1.13/holowizard/core/parameters/padding.py +162 -0
  82. holowizard-1.1.13/holowizard/core/parameters/paths.py +63 -0
  83. holowizard-1.1.13/holowizard/core/parameters/reco_params.py +170 -0
  84. holowizard-1.1.13/holowizard/core/parameters/regularization.py +188 -0
  85. holowizard-1.1.13/holowizard/core/parameters/type_conversion/__init__.py +0 -0
  86. holowizard-1.1.13/holowizard/core/parameters/type_conversion/json_writable.py +32 -0
  87. holowizard-1.1.13/holowizard/core/parameters/type_conversion/member_value_adapter_interface.py +78 -0
  88. holowizard-1.1.13/holowizard/core/parameters/type_conversion/member_value_adapter_numpy.py +154 -0
  89. holowizard-1.1.13/holowizard/core/parameters/type_conversion/member_value_adapter_torch.py +122 -0
  90. holowizard-1.1.13/holowizard/core/phantoms/__init__.py +6 -0
  91. holowizard-1.1.13/holowizard/core/phantoms/ball.py +29 -0
  92. holowizard-1.1.13/holowizard/core/phantoms/circle.py +21 -0
  93. holowizard-1.1.13/holowizard/core/phantoms/cylinder_round_tip.py +48 -0
  94. holowizard-1.1.13/holowizard/core/phantoms/dicty_sketch.py +18 -0
  95. holowizard-1.1.13/holowizard/core/phantoms/edge.py +17 -0
  96. holowizard-1.1.13/holowizard/core/phantoms/model_wave_field.py +58 -0
  97. holowizard-1.1.13/holowizard/core/phantoms/options.py +2 -0
  98. holowizard-1.1.13/holowizard/core/phantoms/shepp_logan.py +14 -0
  99. holowizard-1.1.13/holowizard/core/phantoms/triangle.py +18 -0
  100. holowizard-1.1.13/holowizard/core/preprocessing/__init__.py +1 -0
  101. holowizard-1.1.13/holowizard/core/preprocessing/boundaries.py +32 -0
  102. holowizard-1.1.13/holowizard/core/preprocessing/calculate_flatfield_components.py +24 -0
  103. holowizard-1.1.13/holowizard/core/preprocessing/correct_flatfield.py +76 -0
  104. holowizard-1.1.13/holowizard/core/preprocessing/process_data_dimensions.py +63 -0
  105. holowizard-1.1.13/holowizard/core/preprocessing/process_image.py +174 -0
  106. holowizard-1.1.13/holowizard/core/preprocessing/process_padding_options.py +55 -0
  107. holowizard-1.1.13/holowizard/core/reconstruction/__init__.py +3 -0
  108. holowizard-1.1.13/holowizard/core/reconstruction/constraints/__init__.py +1 -0
  109. holowizard-1.1.13/holowizard/core/reconstruction/constraints/regularization.py +57 -0
  110. holowizard-1.1.13/holowizard/core/reconstruction/constraints/window_2d.py +133 -0
  111. holowizard-1.1.13/holowizard/core/reconstruction/constraints/window_functions.py +18 -0
  112. holowizard-1.1.13/holowizard/core/reconstruction/gradients/__init__.py +0 -0
  113. holowizard-1.1.13/holowizard/core/reconstruction/gradients/analytical.py +58 -0
  114. holowizard-1.1.13/holowizard/core/reconstruction/logging.py +60 -0
  115. holowizard-1.1.13/holowizard/core/reconstruction/probe_retrieval/__init__.py +0 -0
  116. holowizard-1.1.13/holowizard/core/reconstruction/probe_retrieval/basic_operations.py +128 -0
  117. holowizard-1.1.13/holowizard/core/reconstruction/probe_retrieval/host_context.py +286 -0
  118. holowizard-1.1.13/holowizard/core/reconstruction/probe_retrieval/host_reconstruction.py +103 -0
  119. holowizard-1.1.13/holowizard/core/reconstruction/probe_retrieval/worker/__init__.py +0 -0
  120. holowizard-1.1.13/holowizard/core/reconstruction/probe_retrieval/worker/worker_context.py +197 -0
  121. holowizard-1.1.13/holowizard/core/reconstruction/probe_retrieval/worker/worker_object.py +126 -0
  122. holowizard-1.1.13/holowizard/core/reconstruction/probe_retrieval/worker/worker_probe.py +38 -0
  123. holowizard-1.1.13/holowizard/core/reconstruction/single_projection/__init__.py +0 -0
  124. holowizard-1.1.13/holowizard/core/reconstruction/single_projection/context.py +251 -0
  125. holowizard-1.1.13/holowizard/core/reconstruction/single_projection/reconstruct.py +94 -0
  126. holowizard-1.1.13/holowizard/core/reconstruction/single_projection/reconstruct_multistage.py +75 -0
  127. holowizard-1.1.13/holowizard/core/reconstruction/transformation.py +40 -0
  128. holowizard-1.1.13/holowizard/core/reconstruction/utils.py +40 -0
  129. holowizard-1.1.13/holowizard/core/reconstruction/viewer/__init__.py +1 -0
  130. holowizard-1.1.13/holowizard/core/reconstruction/viewer/viewer.py +7 -0
  131. holowizard-1.1.13/holowizard/core/scripts/__init__.py +0 -0
  132. holowizard-1.1.13/holowizard/core/scripts/create_examples.py +169 -0
  133. holowizard-1.1.13/holowizard/core/scripts/examples/__init__.py +0 -0
  134. holowizard-1.1.13/holowizard/core/scripts/examples/asrm/__init__.py +0 -0
  135. holowizard-1.1.13/holowizard/core/scripts/examples/asrm/magnesium_wire.py +136 -0
  136. holowizard-1.1.13/holowizard/core/scripts/examples/asrm/spider_hair.py +136 -0
  137. holowizard-1.1.13/holowizard/core/scripts/examples/find_focus/__init__.py +0 -0
  138. holowizard-1.1.13/holowizard/core/scripts/examples/find_focus/magnesium_wire.py +145 -0
  139. holowizard-1.1.13/holowizard/core/scripts/examples/find_focus/spider_hair.py +144 -0
  140. holowizard-1.1.13/holowizard/core/scripts/examples/focus_series_multidim/__init__.py +0 -0
  141. holowizard-1.1.13/holowizard/core/scripts/examples/focus_series_multidim/create_focus_series_multidim.sbatch +26 -0
  142. holowizard-1.1.13/holowizard/core/scripts/examples/focus_series_multidim/create_focus_series_multidim.sh +10 -0
  143. holowizard-1.1.13/holowizard/core/scripts/examples/focus_series_multidim/magnesium_wire.py +166 -0
  144. holowizard-1.1.13/holowizard/core/scripts/examples/focus_series_multidim/plot_loss.py +19 -0
  145. holowizard-1.1.13/holowizard/core/scripts/examples/focus_series_multidim/spider_hair.py +168 -0
  146. holowizard-1.1.13/holowizard/core/scripts/examples/focus_series_singledim/__init__.py +0 -0
  147. holowizard-1.1.13/holowizard/core/scripts/examples/focus_series_singledim/create_focus_series_singledim.sbatch +24 -0
  148. holowizard-1.1.13/holowizard/core/scripts/examples/focus_series_singledim/create_focus_series_singledim.sh +11 -0
  149. holowizard-1.1.13/holowizard/core/scripts/examples/focus_series_singledim/magnesium_wire.py +140 -0
  150. holowizard-1.1.13/holowizard/core/scripts/examples/focus_series_singledim/plot_loss.py +16 -0
  151. holowizard-1.1.13/holowizard/core/scripts/examples/focus_series_singledim/spider_hair.py +139 -0
  152. holowizard-1.1.13/holowizard/core/scripts/examples/multidist/__init__.py +0 -0
  153. holowizard-1.1.13/holowizard/core/scripts/examples/multidist/dicty_sketch.py +119 -0
  154. holowizard-1.1.13/holowizard/core/scripts/examples/multidist/dicty_sketch_asrm.py +167 -0
  155. holowizard-1.1.13/holowizard/core/serialization/__init__.py +1 -0
  156. holowizard-1.1.13/holowizard/core/serialization/params_serializer.py +39 -0
  157. holowizard-1.1.13/holowizard/core/serialization/serializable_array.py +33 -0
  158. holowizard-1.1.13/holowizard/core/utils/__init__.py +0 -0
  159. holowizard-1.1.13/holowizard/core/utils/fileio.py +62 -0
  160. holowizard-1.1.13/holowizard/core/utils/median_pool_2d.py +50 -0
  161. holowizard-1.1.13/holowizard/core/utils/plot_loss_chart.py +249 -0
  162. holowizard-1.1.13/holowizard/core/utils/remove_outliers.py +31 -0
  163. holowizard-1.1.13/holowizard/core/utils/transform.py +34 -0
  164. holowizard-1.1.13/holowizard/core/utils/utils.py +5 -0
  165. holowizard-1.1.13/holowizard/forge/LICENSE +21 -0
  166. holowizard-1.1.13/holowizard/forge/__init__.py +14 -0
  167. holowizard-1.1.13/holowizard/forge/configs/__init__.py +16 -0
  168. holowizard-1.1.13/holowizard/forge/configs/default.json +144 -0
  169. holowizard-1.1.13/holowizard/forge/configs/parse_config.py +93 -0
  170. holowizard-1.1.13/holowizard/forge/configs/test_config.json +108 -0
  171. holowizard-1.1.13/holowizard/forge/custom/__init__.py +3 -0
  172. holowizard-1.1.13/holowizard/forge/custom/datasets/__init__.py +2 -0
  173. holowizard-1.1.13/holowizard/forge/custom/datasets/tiff_by_pattern.py +68 -0
  174. holowizard-1.1.13/holowizard/forge/custom/datasets/tiff_multi_channel.py +69 -0
  175. holowizard-1.1.13/holowizard/forge/custom/generators/__init__.py +1 -0
  176. holowizard-1.1.13/holowizard/forge/custom/generators/mutli_channel_flatfield_generator.py +35 -0
  177. holowizard-1.1.13/holowizard/forge/database/__init__.py +0 -0
  178. holowizard-1.1.13/holowizard/forge/database/delta_beta/Ag-10.501.csv +7 -0
  179. holowizard-1.1.13/holowizard/forge/database/delta_beta/Au-19.32.csv +7 -0
  180. holowizard-1.1.13/holowizard/forge/database/delta_beta/Cu-8.96.csv +7 -0
  181. holowizard-1.1.13/holowizard/forge/database/delta_beta/Fe-7.874.csv +7 -0
  182. holowizard-1.1.13/holowizard/forge/database/delta_beta/Mg-1.738.csv +7 -0
  183. holowizard-1.1.13/holowizard/forge/database/delta_beta/__init__.py +0 -0
  184. holowizard-1.1.13/holowizard/forge/database/transmission/Ag-10.501.csv +2396 -0
  185. holowizard-1.1.13/holowizard/forge/database/transmission/Au-19.32.csv +2395 -0
  186. holowizard-1.1.13/holowizard/forge/database/transmission/Cu-8.96.csv +2407 -0
  187. holowizard-1.1.13/holowizard/forge/database/transmission/Fe-7.874.csv +2407 -0
  188. holowizard-1.1.13/holowizard/forge/database/transmission/Mg-1.738.csv +2408 -0
  189. holowizard-1.1.13/holowizard/forge/database/transmission/__init__.py +0 -0
  190. holowizard-1.1.13/holowizard/forge/datasets/__init__.py +3 -0
  191. holowizard-1.1.13/holowizard/forge/datasets/base_dataset.py +73 -0
  192. holowizard-1.1.13/holowizard/forge/datasets/hdf5_dataset.py +50 -0
  193. holowizard-1.1.13/holowizard/forge/datasets/tiff_dataset.py +76 -0
  194. holowizard-1.1.13/holowizard/forge/experiment/__init__.py +16 -0
  195. holowizard-1.1.13/holowizard/forge/experiment/flatfield/__init__.py +3 -0
  196. holowizard-1.1.13/holowizard/forge/experiment/flatfield/constant_flatfield.py +20 -0
  197. holowizard-1.1.13/holowizard/forge/experiment/flatfield/flatfield.py +123 -0
  198. holowizard-1.1.13/holowizard/forge/experiment/flatfield/multi_channel_flatfield.py +66 -0
  199. holowizard-1.1.13/holowizard/forge/experiment/probe/__init__.py +4 -0
  200. holowizard-1.1.13/holowizard/forge/experiment/probe/beam_config.py +75 -0
  201. holowizard-1.1.13/holowizard/forge/experiment/probe/constant_probe.py +20 -0
  202. holowizard-1.1.13/holowizard/forge/experiment/probe/polynomial_probe.py +76 -0
  203. holowizard-1.1.13/holowizard/forge/experiment/probe/probe.py +70 -0
  204. holowizard-1.1.13/holowizard/forge/experiment/setup/__init__.py +3 -0
  205. holowizard-1.1.13/holowizard/forge/experiment/setup/nfh_constant_setup.py +81 -0
  206. holowizard-1.1.13/holowizard/forge/experiment/setup/nfh_setup.py +87 -0
  207. holowizard-1.1.13/holowizard/forge/experiment/setup/nfh_setup.py.orig +93 -0
  208. holowizard-1.1.13/holowizard/forge/experiment/setup/setup.py +66 -0
  209. holowizard-1.1.13/holowizard/forge/experiment/simulation/__init__.py +2 -0
  210. holowizard-1.1.13/holowizard/forge/experiment/simulation/nfh_simulation.py +83 -0
  211. holowizard-1.1.13/holowizard/forge/experiment/simulation/simulation.py +30 -0
  212. holowizard-1.1.13/holowizard/forge/generators/__init__.py +5 -0
  213. holowizard-1.1.13/holowizard/forge/generators/data_generator.py +112 -0
  214. holowizard-1.1.13/holowizard/forge/generators/flatfield_generator.py +57 -0
  215. holowizard-1.1.13/holowizard/forge/generators/hologram_generator.py +62 -0
  216. holowizard-1.1.13/holowizard/forge/generators/phantom_generator.py +147 -0
  217. holowizard-1.1.13/holowizard/forge/generators/probe_generator.py +45 -0
  218. holowizard-1.1.13/holowizard/forge/objects/__init__.py +0 -0
  219. holowizard-1.1.13/holowizard/forge/objects/phantom.py +192 -0
  220. holowizard-1.1.13/holowizard/forge/objects/physical_properties.py +21 -0
  221. holowizard-1.1.13/holowizard/forge/objects/placement.py +93 -0
  222. holowizard-1.1.13/holowizard/forge/objects/shape_builder.py +98 -0
  223. holowizard-1.1.13/holowizard/forge/objects/shape_sampler.py +58 -0
  224. holowizard-1.1.13/holowizard/forge/objects/shapes/__init__.py +7 -0
  225. holowizard-1.1.13/holowizard/forge/objects/shapes/ball.py +26 -0
  226. holowizard-1.1.13/holowizard/forge/objects/shapes/cylinder.py +26 -0
  227. holowizard-1.1.13/holowizard/forge/objects/shapes/cylinder_round_tip.py +31 -0
  228. holowizard-1.1.13/holowizard/forge/objects/shapes/ellipse.py +53 -0
  229. holowizard-1.1.13/holowizard/forge/objects/shapes/polygon.py +29 -0
  230. holowizard-1.1.13/holowizard/forge/objects/shapes/rectangle.py +22 -0
  231. holowizard-1.1.13/holowizard/forge/objects/shapes/shape.py +55 -0
  232. holowizard-1.1.13/holowizard/forge/scripts/__init__.py +0 -0
  233. holowizard-1.1.13/holowizard/forge/scripts/create_testconfig.py +28 -0
  234. holowizard-1.1.13/holowizard/forge/scripts/generate_data.py +63 -0
  235. holowizard-1.1.13/holowizard/forge/utils/__init__.py +1 -0
  236. holowizard-1.1.13/holowizard/forge/utils/data_format_conversion.py +58 -0
  237. holowizard-1.1.13/holowizard/forge/utils/datatypes.py +36 -0
  238. holowizard-1.1.13/holowizard/forge/utils/fileIO.py +176 -0
  239. holowizard-1.1.13/holowizard/forge/utils/labeller/__init__.py +2 -0
  240. holowizard-1.1.13/holowizard/forge/utils/labeller/hdf5_labeller.py +324 -0
  241. holowizard-1.1.13/holowizard/forge/utils/labeller/labeller.py +109 -0
  242. holowizard-1.1.13/holowizard/forge/utils/noise.py +62 -0
  243. holowizard-1.1.13/holowizard/forge/utils/random.py +85 -0
  244. holowizard-1.1.13/holowizard/forge/utils/torch_settings.py +26 -0
  245. holowizard-1.1.13/holowizard/forge/utils/transforms.py +348 -0
  246. holowizard-1.1.13/holowizard/forge/utils/unit_conversions.py +58 -0
  247. holowizard-1.1.13/holowizard/forge/utils/utilities.py +105 -0
  248. holowizard-1.1.13/holowizard/lavue/DESY/LaVue.conf +110 -0
  249. holowizard-1.1.13/holowizard/lavue/DESY/__init__.py +0 -0
  250. holowizard-1.1.13/holowizard/lavue/__init__.py +14 -0
  251. holowizard-1.1.13/holowizard/livereco/LICENSE +21 -0
  252. holowizard-1.1.13/holowizard/livereco/__init__.py +25 -0
  253. holowizard-1.1.13/holowizard/livereco/client/__init__.py +11 -0
  254. holowizard-1.1.13/holowizard/livereco/client/functions.py +51 -0
  255. holowizard-1.1.13/holowizard/livereco/client/send.py +24 -0
  256. holowizard-1.1.13/holowizard/livereco/client/socket.py +24 -0
  257. holowizard-1.1.13/holowizard/livereco/server/__init__.py +0 -0
  258. holowizard-1.1.13/holowizard/livereco/server/find_focus.py +47 -0
  259. holowizard-1.1.13/holowizard/livereco/server/flatfield_correction.py +116 -0
  260. holowizard-1.1.13/holowizard/livereco/server/main.py +102 -0
  261. holowizard-1.1.13/holowizard/livereco/server/reconstruction.py +80 -0
  262. holowizard-1.1.13/holowizard/logo.png +0 -0
  263. holowizard-1.1.13/holowizard/pipe/LICENSE +21 -0
  264. holowizard-1.1.13/holowizard/pipe/__init__.py +0 -0
  265. holowizard-1.1.13/holowizard/pipe/beamtime/P05.py +40 -0
  266. holowizard-1.1.13/holowizard/pipe/beamtime/__init__.py +2 -0
  267. holowizard-1.1.13/holowizard/pipe/beamtime/beamtime.py +164 -0
  268. holowizard-1.1.13/holowizard/pipe/citations.yaml +16 -0
  269. holowizard-1.1.13/holowizard/pipe/cluster/__init__.py +2 -0
  270. holowizard-1.1.13/holowizard/pipe/cluster/cluster.py +57 -0
  271. holowizard-1.1.13/holowizard/pipe/cluster/scheduler.py +23 -0
  272. holowizard-1.1.13/holowizard/pipe/cluster/slurm_cluster.py +175 -0
  273. holowizard-1.1.13/holowizard/pipe/gui/__init__.py +0 -0
  274. holowizard-1.1.13/holowizard/pipe/gui/gui_utils/__init__.py +0 -0
  275. holowizard-1.1.13/holowizard/pipe/gui/gui_utils/find_focus_thread.py +37 -0
  276. holowizard-1.1.13/holowizard/pipe/gui/gui_utils/logging_editor.py +45 -0
  277. holowizard-1.1.13/holowizard/pipe/gui/gui_utils/phase_retrieval_thread.py +37 -0
  278. holowizard-1.1.13/holowizard/pipe/gui/gui_utils/widgets_utils.py +11 -0
  279. holowizard-1.1.13/holowizard/pipe/gui/main_gui.py +37 -0
  280. holowizard-1.1.13/holowizard/pipe/gui/resources/__init__.py +0 -0
  281. holowizard-1.1.13/holowizard/pipe/gui/resources/splash.png +0 -0
  282. holowizard-1.1.13/holowizard/pipe/gui/windows/__init__.py +0 -0
  283. holowizard-1.1.13/holowizard/pipe/gui/windows/main_window.py +1210 -0
  284. holowizard-1.1.13/holowizard/pipe/gui/windows/popup_windows/__init__.py +0 -0
  285. holowizard-1.1.13/holowizard/pipe/gui/windows/popup_windows/advanced_json_editor.py +90 -0
  286. holowizard-1.1.13/holowizard/pipe/gui/windows/popup_windows/completion_dialog.py +35 -0
  287. holowizard-1.1.13/holowizard/pipe/gui/windows/popup_windows/scan_config_dialog.py +96 -0
  288. holowizard-1.1.13/holowizard/pipe/gui/windows/splash_screen.py +35 -0
  289. holowizard-1.1.13/holowizard/pipe/scan/__init__.py +2 -0
  290. holowizard-1.1.13/holowizard/pipe/scan/p05_scan.py +213 -0
  291. holowizard-1.1.13/holowizard/pipe/scan/scan.py +225 -0
  292. holowizard-1.1.13/holowizard/pipe/scripts/__init__.py +0 -0
  293. holowizard-1.1.13/holowizard/pipe/scripts/config/__init__.py +0 -0
  294. holowizard-1.1.13/holowizard/pipe/scripts/config/beamtime.yaml +5 -0
  295. holowizard-1.1.13/holowizard/pipe/scripts/config/cluster.yaml +11 -0
  296. holowizard-1.1.13/holowizard/pipe/scripts/config/defaults.yaml +13 -0
  297. holowizard-1.1.13/holowizard/pipe/scripts/config/find_focus/spider.yaml +75 -0
  298. holowizard-1.1.13/holowizard/pipe/scripts/config/find_focus/wire.yaml +72 -0
  299. holowizard-1.1.13/holowizard/pipe/scripts/config/flatfield.yaml +3 -0
  300. holowizard-1.1.13/holowizard/pipe/scripts/config/paths.yaml +10 -0
  301. holowizard-1.1.13/holowizard/pipe/scripts/config/reconstruction/spider.yaml +95 -0
  302. holowizard-1.1.13/holowizard/pipe/scripts/config/reconstruction/wire.yaml +92 -0
  303. holowizard-1.1.13/holowizard/pipe/scripts/config/scan.yaml +23 -0
  304. holowizard-1.1.13/holowizard/pipe/scripts/config/tomography.yaml +2 -0
  305. holowizard-1.1.13/holowizard/pipe/scripts/holopipe.py +29 -0
  306. holowizard-1.1.13/holowizard/pipe/scripts/reco.py +97 -0
  307. holowizard-1.1.13/holowizard/pipe/server/__init__.py +0 -0
  308. holowizard-1.1.13/holowizard/pipe/server/app.py +377 -0
  309. holowizard-1.1.13/holowizard/pipe/server/websocket_viewer.py +80 -0
  310. holowizard-1.1.13/holowizard/pipe/tasks/__init__.py +4 -0
  311. holowizard-1.1.13/holowizard/pipe/tasks/find_focus.py +80 -0
  312. holowizard-1.1.13/holowizard/pipe/tasks/flat_field_correction.py +49 -0
  313. holowizard-1.1.13/holowizard/pipe/tasks/phase_retrieval.py +100 -0
  314. holowizard-1.1.13/holowizard/pipe/tasks/tomography.py +70 -0
  315. holowizard-1.1.13/holowizard/pipe/templates/__init__.py +0 -0
  316. holowizard-1.1.13/holowizard/pipe/templates/dashboard.html +154 -0
  317. holowizard-1.1.13/holowizard/pipe/templates/parameter.html +292 -0
  318. holowizard-1.1.13/holowizard/pipe/templates/parameter_form.html +8 -0
  319. holowizard-1.1.13/holowizard/pipe/templates/scan.html +89 -0
  320. holowizard-1.1.13/holowizard/pipe/templates/static/__init__.py +0 -0
  321. holowizard-1.1.13/holowizard/pipe/templates/static/loading.css +14 -0
  322. holowizard-1.1.13/holowizard/pipe/utils/__init__.py +0 -0
  323. holowizard-1.1.13/holowizard/pipe/utils/clean_yaml.py +37 -0
  324. holowizard-1.1.13/holowizard/pipe/utils/reco_params.py +62 -0
  325. holowizard-1.1.13/holowizard/pipe/utils/submit_and_handle.py +18 -0
  326. holowizard-1.1.13/holowizard.egg-info/PKG-INFO +261 -0
  327. holowizard-1.1.13/holowizard.egg-info/SOURCES.txt +344 -0
  328. holowizard-1.1.13/holowizard.egg-info/dependency_links.txt +1 -0
  329. holowizard-1.1.13/holowizard.egg-info/entry_points.txt +7 -0
  330. holowizard-1.1.13/holowizard.egg-info/requires.txt +30 -0
  331. holowizard-1.1.13/holowizard.egg-info/top_level.txt +3 -0
  332. holowizard-1.1.13/pyproject.toml +64 -0
  333. holowizard-1.1.13/requirements.txt +30 -0
  334. holowizard-1.1.13/setup.cfg +4 -0
  335. holowizard-1.1.13/tests/core/data/spider_hair.tiff +0 -0
  336. holowizard-1.1.13/tests/core/reconstruction/constraints/test_regularization.py +194 -0
  337. holowizard-1.1.13/tests/core/reference_results/absorption.tiff +0 -0
  338. holowizard-1.1.13/tests/core/reference_results/phaseshift.tiff +0 -0
  339. holowizard-1.1.13/tests/core/test_api_parameter_imports.py +26 -0
  340. holowizard-1.1.13/tests/core/test_fileio.py +16 -0
  341. holowizard-1.1.13/tests/core/test_overall_results.py +101 -0
  342. holowizard-1.1.13/tests/forge/data_generator_test.py +42 -0
  343. holowizard-1.1.13/tests/forge/load_phantom_test.py +30 -0
  344. holowizard-1.1.13/tests/forge/plot_shapes_test.py +54 -0
  345. holowizard-1.1.13/tests/pytest.sbatch +16 -0
  346. holowizard-1.1.13/tests/test_run.sh +18 -0
@@ -0,0 +1,64 @@
1
+ # This workflow will upload a Python Package to PyPI when a release is created
2
+ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3
+
4
+ # This workflow uses actions that are not certified by GitHub.
5
+ # They are provided by a third-party and are governed by
6
+ # separate terms of service, privacy policy, and support
7
+ # documentation.
8
+
9
+ name: Upload Python Package
10
+
11
+ on:
12
+ release:
13
+ types: [published]
14
+
15
+ permissions:
16
+ contents: read
17
+
18
+ jobs:
19
+ release-build:
20
+ runs-on: ubuntu-latest
21
+
22
+ steps:
23
+ - uses: actions/checkout@v4
24
+
25
+ - uses: actions/setup-python@v5
26
+ with:
27
+ python-version: "3.11"
28
+
29
+ - name: Build release distributions
30
+ run: |
31
+ # NOTE: put your own distribution build steps here.
32
+ python -m pip install build
33
+ python -m build
34
+
35
+ - name: Upload distributions
36
+ uses: actions/upload-artifact@v4
37
+ with:
38
+ name: release-dists
39
+ path: dist/
40
+
41
+ pypi-publish:
42
+ #if: startsWith(github.ref, 'refs/tags/')
43
+ runs-on: ubuntu-latest
44
+ needs:
45
+ - release-build
46
+ permissions:
47
+ # IMPORTANT: this permission is mandatory for trusted publishing
48
+ id-token: write
49
+
50
+ # Dedicated environments with protections for publishing are strongly recommended.
51
+ # For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules
52
+ environment:
53
+ name: pypi
54
+ url: https://pypi.org/p/holowizard
55
+
56
+ steps:
57
+ - name: Retrieve release distributions
58
+ uses: actions/download-artifact@v4
59
+ with:
60
+ name: release-dists
61
+ path: dist/
62
+
63
+ - name: Publish release distributions to PyPI
64
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,68 @@
1
+ # This workflow will upload a Python Package to PyPI when a release is created
2
+ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3
+
4
+ # This workflow uses actions that are not certified by GitHub.
5
+ # They are provided by a third-party and are governed by
6
+ # separate terms of service, privacy policy, and support
7
+ # documentation.
8
+
9
+ name: Upload Python Package
10
+
11
+ on:
12
+ push:
13
+ # Pattern matched against refs/tags
14
+ tags:
15
+ - '**' # Push events to every tag including hierarchical tags like v1.0/beta
16
+
17
+ permissions:
18
+ contents: read
19
+
20
+ jobs:
21
+ release-build:
22
+ runs-on: ubuntu-latest
23
+
24
+ steps:
25
+ - uses: actions/checkout@v4
26
+
27
+ - uses: actions/setup-python@v5
28
+ with:
29
+ python-version: "3.11"
30
+
31
+ - name: Build release distributions
32
+ run: |
33
+ # NOTE: put your own distribution build steps here.
34
+ python -m pip install build
35
+ python -m build
36
+
37
+ - name: Upload distributions
38
+ uses: actions/upload-artifact@v4
39
+ with:
40
+ name: release-dists
41
+ path: dist/
42
+
43
+ pypi-publish:
44
+ #if: startsWith(github.ref, 'refs/tags/')
45
+ runs-on: ubuntu-latest
46
+ needs:
47
+ - release-build
48
+ permissions:
49
+ # IMPORTANT: this permission is mandatory for trusted publishing
50
+ id-token: write
51
+
52
+ # Dedicated environments with protections for publishing are strongly recommended.
53
+ # For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules
54
+ environment:
55
+ name: testpypi
56
+ url: https://test.pypi.org/p/holowizard
57
+
58
+ steps:
59
+ - name: Retrieve release distributions
60
+ uses: actions/download-artifact@v4
61
+ with:
62
+ name: release-dists
63
+ path: dist/
64
+
65
+ - name: Publish release distributions to PyPI
66
+ uses: pypa/gh-action-pypi-publish@release/v1
67
+ with:
68
+ repository-url: https://test.pypi.org/legacy/
@@ -0,0 +1,182 @@
1
+ # Created by https://www.toptal.com/developers/gitignore/api/python
2
+ # Edit at https://www.toptal.com/developers/gitignore?templates=python
3
+
4
+ ### Python ###
5
+ # Byte-compiled / optimized / DLL files
6
+ __pycache__/
7
+ *.py[cod]
8
+ *$py.class
9
+
10
+ # C extensions
11
+ *.so
12
+
13
+ # Distribution / packaging
14
+ .Python
15
+ build/
16
+ develop-eggs/
17
+ dist/
18
+ downloads/
19
+ eggs/
20
+ .eggs/
21
+ lib/
22
+ lib64/
23
+ parts/
24
+ sdist/
25
+ var/
26
+ wheels/
27
+ share/python-wheels/
28
+ *.egg-info/
29
+ .installed.cfg
30
+ *.egg
31
+ MANIFEST
32
+
33
+ # PyInstaller
34
+ # Usually these files are written by a python script from a template
35
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
36
+ *.manifest
37
+ *.spec
38
+
39
+ # Installer logs
40
+ pip-log.txt
41
+ pip-delete-this-directory.txt
42
+
43
+ # Unit test / coverage reports
44
+ htmlcov/
45
+ .tox/
46
+ .nox/
47
+ .coverage
48
+ .coverage.*
49
+ .cache
50
+ nosetests.xml
51
+ coverage.xml
52
+ *.cover
53
+ *.py,cover
54
+ .hypothesis/
55
+ .pytest_cache/
56
+ cover/
57
+
58
+ # Translations
59
+ *.mo
60
+ *.pot
61
+
62
+ # Django stuff:
63
+ *.log
64
+ local_settings.py
65
+ db.sqlite3
66
+ db.sqlite3-journal
67
+
68
+ # Flask stuff:
69
+ instance/
70
+ .webassets-cache
71
+
72
+ # Scrapy stuff:
73
+ .scrapy
74
+
75
+ # Sphinx documentation
76
+ docs/_build/
77
+
78
+ # PyBuilder
79
+ .pybuilder/
80
+ target/
81
+
82
+ # Jupyter Notebook
83
+ .ipynb_checkpoints
84
+
85
+ # IPython
86
+ profile_default/
87
+ ipython_config.py
88
+
89
+ # pyenv
90
+ # For a library or package, you might want to ignore these files since the code is
91
+ # intended to run in multiple environments; otherwise, check them in:
92
+ # .python-version
93
+
94
+ # pipenv
95
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
96
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
97
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
98
+ # install all needed dependencies.
99
+ #Pipfile.lock
100
+
101
+ # poetry
102
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
103
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
104
+ # commonly ignored for libraries.
105
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
106
+ #poetry.lock
107
+
108
+ # pdm
109
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
110
+ #pdm.lock
111
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
112
+ # in version control.
113
+ # https://pdm.fming.dev/#use-with-ide
114
+ .pdm.toml
115
+
116
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
117
+ __pypackages__/
118
+
119
+ # Celery stuff
120
+ celerybeat-schedule
121
+ celerybeat.pid
122
+
123
+ # SageMath parsed files
124
+ *.sage.py
125
+
126
+ # Environments
127
+ .env
128
+ .venv
129
+ env/
130
+ venv/
131
+ ENV/
132
+ env.bak/
133
+ venv.bak/
134
+
135
+ # Spyder project settings
136
+ .spyderproject
137
+ .spyproject
138
+
139
+ # Rope project settings
140
+ .ropeproject
141
+
142
+ # mkdocs documentation
143
+ /site
144
+
145
+ # mypy
146
+ .mypy_cache/
147
+ .dmypy.json
148
+ dmypy.json
149
+
150
+ # Pyre type checker
151
+ .pyre/
152
+
153
+ # pytype static type analyzer
154
+ .pytype/
155
+
156
+ # Cython debug symbols
157
+ cython_debug/
158
+
159
+ # PyCharm
160
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
161
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
162
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
163
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
164
+ .idea/
165
+
166
+ ### Python Patch ###
167
+ # Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration
168
+ poetry.toml
169
+
170
+ # ruff
171
+ .ruff_cache/
172
+
173
+ # LSP config files
174
+ pyrightconfig.json
175
+
176
+ # End of https://www.toptal.com/developers/gitignore/api/python
177
+
178
+ *.tiff
179
+ holowizard/core/scripts/Examples/logs/*
180
+
181
+ data_generation_test
182
+ logs
@@ -0,0 +1,79 @@
1
+ default:
2
+ image: python:3.11
3
+ cache:
4
+ paths:
5
+ - .pip-cache/
6
+ before_script:
7
+ - python --version
8
+ - pip install --upgrade pip
9
+ - pip install build twine
10
+
11
+ stages:
12
+ - build
13
+ - test
14
+ - deploy
15
+
16
+ build:
17
+ stage: build
18
+ script:
19
+ - python -m build
20
+ artifacts:
21
+ paths:
22
+ - dist/
23
+
24
+ run-gpu-tests:
25
+ stage: test
26
+ image: ubuntu:22.04
27
+ tags:
28
+ - DESY-intern
29
+ rules:
30
+ # runs when you push a commit with "ci!" in the message or when a merge request is created
31
+ - if: '$CI_COMMIT_MESSAGE =~ /ci!/ || $CI_MERGE_REQUEST_ID'
32
+ # runs when you push a commit to the versions branch or main branch
33
+ - if: '$CI_COMMIT_BRANCH =~ /versions\/[0-9]+\.[0-9]+\.[0-9]+$/'
34
+ - if: $CI_COMMIT_BRANCH == "main"
35
+ script:
36
+ - apt-get update && apt-get install -y openssh-client rsync
37
+ - mkdir -p ~/.ssh
38
+ - echo "-----BEGIN OPENSSH PRIVATE KEY-----" > ~/.ssh/gitlab-ci
39
+ - FORMATTED_BODY=$(echo "$SSH_PRIVATE_KEY" | fold -w 70)
40
+ - echo "${FORMATTED_BODY[@]}" >> ~/.ssh/gitlab-ci
41
+ - echo "-----END OPENSSH PRIVATE KEY-----" >> ~/.ssh/gitlab-ci
42
+ - chmod 600 ~/.ssh/gitlab-ci
43
+ - export SSH_OPTS="-o StrictHostKeyChecking=no -i ~/.ssh/gitlab-ci"
44
+ # Generate a unique remote folder
45
+ - ssh $SSH_OPTS gruenjoh@max-display.desy.de "
46
+ mkdir ~/jgruen/ci-package/
47
+ "
48
+ - export REMOTE_CI_DIR="/home/gruenjoh/jgruen/ci-package/ci_${CI_JOB_ID}"
49
+ - echo "Using remote folder" + "$REMOTE_CI_DIR"
50
+ - rsync -az -e "ssh $SSH_OPTS" . gruenjoh@max-display.desy.de:$REMOTE_CI_DIR/
51
+ # Setup environment, run tests and clean up
52
+ - ssh $SSH_OPTS gruenjoh@max-display.desy.de "
53
+ export CI_JOB_ID=${CI_JOB_ID} &&
54
+ ml maxwell mamba &&
55
+ . mamba-init &&
56
+ mamba create -y -p /home/gruenjoh/jgruen/ci-package/ci_${CI_JOB_ID}_env python=3.11 &&
57
+ mamba run -p /home/gruenjoh/jgruen/ci-package/ci_${CI_JOB_ID}_env bash -c '
58
+ pip install -r /home/gruenjoh/jgruen/ci-package/ci_${CI_JOB_ID}/requirements.txt --no-cache-dir &&
59
+ pip install /home/gruenjoh/jgruen/ci-package/ci_${CI_JOB_ID} --no-cache-dir
60
+ ' &&
61
+ bash /home/gruenjoh/jgruen/ci-package/ci_${CI_JOB_ID}/tests/test_run.sh
62
+ "
63
+ after_script:
64
+ - apt-get update && apt-get install -y openssh-client rsync
65
+ - mkdir -p ~/.ssh
66
+ - echo "-----BEGIN OPENSSH PRIVATE KEY-----" > ~/.ssh/gitlab-ci
67
+ - FORMATTED_BODY=$(echo "$SSH_PRIVATE_KEY" | fold -w 70)
68
+ - echo "${FORMATTED_BODY[@]}" >> ~/.ssh/gitlab-ci
69
+ - echo "-----END OPENSSH PRIVATE KEY-----" >> ~/.ssh/gitlab-ci
70
+ - chmod 600 ~/.ssh/gitlab-ci
71
+ - export SSH_OPTS="-o StrictHostKeyChecking=no -i ~/.ssh/gitlab-ci"
72
+ # Cleanup
73
+ - ssh $SSH_OPTS gruenjoh@max-display.desy.de "
74
+ ml maxwell mamba &&
75
+ . mamba-init &&
76
+ mamba deactivate &&
77
+ mamba remove -y -n ci-env --all &&
78
+ rm -rf ~/jgruen/ci-package/*
79
+ "
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Johannes Dora
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,261 @@
1
+ Metadata-Version: 2.4
2
+ Name: holowizard
3
+ Version: 1.1.13
4
+ Author-email: Johannes Dora <johannes.dora@desy.de>, Johannes Hagemann <johannes.hagemann@desy.de>, André Lopes <andre.lopes@hereon.de>, Johannes Hagemann <johannes.hagemann@desy.de>, Silja Flenner <silja.flenner@hereon.de>, Johannes Grün <johannes.gruen@desy.de>, Sebastian Eberle <sebastian.eberle@desy.de>, Cem Cinar <cem.cinar@tuhh.de>
5
+ Maintainer-email: Johannes Dora <johannes.dora@desy.de>, André Lopes <andre.lopes@hereon.de>, Johannes Grün <johannes.gruen@desy.de>, Sebastian Eberle <sebastian.eberle@desy.de>, Johannes Hagemann <johannes.hagemann@desy.de>
6
+ License-Expression: MIT
7
+ Project-URL: Repository, https://github.com/DESY-FS-PETRA/holowizard
8
+ Project-URL: Paper_ASRM, https://doi.org/10.1364/OE.514641
9
+ Project-URL: Paper_Autofocus, https://doi.org/10.1364/OE.544573
10
+ Project-URL: Zenodo, https://doi.org/10.5281/zenodo.8349364
11
+ Keywords: near-field holography,phase retrieval,tomography
12
+ Classifier: Programming Language :: Python
13
+ Requires-Python: <3.12,>=3.11
14
+ Description-Content-Type: text/markdown
15
+ License-File: LICENSE
16
+ License-File: holowizard/forge/LICENSE
17
+ License-File: holowizard/core/LICENSE
18
+ License-File: holowizard/pipe/LICENSE
19
+ Requires-Dist: tqdm
20
+ Requires-Dist: numpy==1.26.4
21
+ Requires-Dist: torch
22
+ Requires-Dist: torchvision
23
+ Requires-Dist: matplotlib
24
+ Requires-Dist: pandas
25
+ Requires-Dist: h5py
26
+ Requires-Dist: hdf5plugin
27
+ Requires-Dist: selenium
28
+ Requires-Dist: bs4
29
+ Requires-Dist: requests
30
+ Requires-Dist: xraylib
31
+ Requires-Dist: cupy-cuda12x
32
+ Requires-Dist: pyzmq
33
+ Requires-Dist: pyqt5-tools
34
+ Requires-Dist: scikit-learn
35
+ Requires-Dist: scikit-image
36
+ Requires-Dist: GitPython
37
+ Requires-Dist: dask
38
+ Requires-Dist: dask_jobqueue
39
+ Requires-Dist: pytest
40
+ Requires-Dist: bokeh
41
+ Requires-Dist: scipy
42
+ Requires-Dist: astra-toolbox
43
+ Requires-Dist: pyqtgraph
44
+ Requires-Dist: uvicorn
45
+ Requires-Dist: hydra-core
46
+ Requires-Dist: fastapi[standard]
47
+ Requires-Dist: markdown
48
+ Requires-Dist: plotly
49
+ Dynamic: license-file
50
+
51
+ <img src="https://connect.helmholtz-imaging.de/media/solution/Holowizard_logo.png" width="200"/>
52
+
53
+
54
+ # Table of Contents
55
+ 1. [General Information](#general-information)
56
+ 2. [Installation](#installation)
57
+ 3. [HoloWizard Core](#holowizard-core)
58
+ 4. [HoloWizard Pipe](#holowizard-pipe)
59
+ 5. [HoloWizard Forge](#holowizard-forge)
60
+ 6. [Please Cite](#citations)
61
+
62
+ ## General Information
63
+ - Repository: https://github.com/DESY-FS-PETRA/holowizard
64
+ - Zenodo: https://doi.org/10.5281/zenodo.8349364
65
+
66
+ ### Further links
67
+ https://helmholtz.software/software/holowizard \
68
+ https://connect.helmholtz-imaging.de/solution/71 \
69
+ https://connect.helmholtz-imaging.de/blog_gallery/blogpost/10
70
+
71
+ ## Installation
72
+ ### Python Environment
73
+ Create a new environment with python 3.11., i.e. with mamba
74
+ ```bash
75
+ $ mamba create -p <path_to_env> python=3.11
76
+ ```
77
+
78
+ Activate enviroment
79
+ ```bash
80
+ $ mamba activate <path_to_env>
81
+ ```
82
+
83
+ ### Install package
84
+ ```bash
85
+ $ pip install holowizard
86
+ ```
87
+
88
+ # HoloWizard Core
89
+
90
+ To create examples, open a terminal and run
91
+
92
+ ```{bash}
93
+ $ holowizard_core_create_examples <directory>
94
+ ```
95
+
96
+ # HoloWizard Pipe
97
+
98
+ ## Setting Up an Instance
99
+
100
+ We provide a CLI command to initialize everything:
101
+
102
+ ```bash
103
+ holopipe beamtime.name=YOUR_BEAMTIME_NAME beamtime.year=YEAR_OF_BEAMTIME
104
+ ```
105
+
106
+ This command sets up the pipeline. You can override any other configuration value using Hydra’s override syntax:
107
+ 👉 [Hydra Override Syntax Documentation](https://hydra.cc/docs/advanced/override_grammar/basic/)
108
+
109
+ If the startup is successful, you’ll see output like:
110
+
111
+ ```
112
+ INFO: Uvicorn running on http://MY_IP_ADDRESS:MY_PORT (Press CTRL+C to quit)
113
+ ```
114
+
115
+ Click the address to open a browser window showing that `holopipe` is running.
116
+ Visit: `http://MY_IP_ADDRESS:MY_PORT/dashboard` for useful runtime information.
117
+
118
+
119
+ ---
120
+
121
+ ## Usage
122
+
123
+ ### Add a scan with default parameters.
124
+
125
+ You can submit scans using a simple `curl` POST request:
126
+
127
+ ```bash
128
+ curl -X POST \
129
+ -H "Content-Type: application/json" \
130
+ -d '{ "a0": 1.0,
131
+ "scan-name": "nano145014_s7_1_tum",
132
+ "holder": 220,
133
+ "base_dir": "holopipe",
134
+ "reconstruction": "wire",
135
+ "find_focus": "wire",
136
+ "energy": 17.0
137
+ }' \
138
+ http://MY_IP_ADDRESS:MY_PORT/api/submit_scan
139
+ ```
140
+
141
+ If you are on the same machine as the server is running you can use the python script:
142
+ ```bash
143
+ recontruct-scan --help # will tell you all important parameters
144
+ ```
145
+
146
+ #### Required Parameters
147
+
148
+ - `name`: Folder name of the current scan
149
+ - `holder`: Height of the holder
150
+ - `energy`: Scan energy in keV
151
+
152
+ #### Optional Parameters
153
+
154
+ - `a0`: Optional numeric parameter; if not provided, it will be computed automatically
155
+ - `reconstruction`: Instruction set for reconstruction — `wire` (default) or `spider`
156
+ - `find_focus`: Instruction set to find focus — `wire` (default) or `spider`
157
+ - `base_dir`: Root directory for output files (default: `holopipe`)
158
+
159
+ ### Parameter Optimization
160
+
161
+ To performe parameter optimization go to `http://MY_IP_ADDRESS:MY_PORT/parameter`. Here you can set all parameter for all stages. To test them click `Reconstruct`. If the parameters work well, you can save them to the current beamtime folder using the `Save as` at the lower left.
162
+ If you want to reconstruct the whole scan you can click `Submit All` after chosing the Options. If you select `Custom` it will take the parameters from the left.
163
+
164
+ ### Other changes during beamtime
165
+
166
+ If you change the detector or anything else like removing tasks adapt parameters the full config files are located in the `beamtime/processed/holowizard_config/`folder. Changes here will reflect onto future curl requests!
167
+
168
+ # HoloWizard Forge
169
+
170
+ This framework can be used to generate large datasets of simulated holograms of randomly sampled objects.
171
+
172
+ ## Create New Dataset
173
+
174
+ Open a terminal and create a new config file with
175
+
176
+ ```{bash}
177
+ $ holowziard_forge_create_testconfig <args>
178
+ ```
179
+
180
+ | Argument | Description | Position |
181
+ |-----------------|-----------------------------------------------------------|----------|
182
+ | `name` | Name of the new config file (without file name extension) | 1 |
183
+ | `--output_dir` | Output directory | optional |
184
+ | `--override` | Overrides existing configuration file | optional |
185
+
186
+
187
+ The config file can then be customized and used to create a new dataset with
188
+
189
+ ```{bash}
190
+ $ holowizard_forge_generate_data <args>
191
+ ```
192
+
193
+ | Argument | Description | Position |
194
+ |---------------|------------------------------------------------------|----------|
195
+ | `config` | Path to the custom configuration file. | 1 |
196
+ | `output_dir` | Output directory where the generated data is stored. | 2 |
197
+ | `num_samples` | Number of data samples that should be generated. | 3 |
198
+ | `--override` | Override the output folder if it already exists. | optional |
199
+
200
+ ## Output Structure
201
+ ```
202
+ output/
203
+ └── train.hdf5
204
+ └── train.json
205
+ ```
206
+
207
+ The file train.hdf5 contains the training data
208
+ The file `train.json` contains the config parameters which have been used for the training data creation.
209
+
210
+ ## Developer Info
211
+
212
+ ### Add new Parameters
213
+ To add a new parameter, add it to the default configuration `holowizard/forge/configs/default.json`.
214
+
215
+ # Citations
216
+ ### Artifact-suppressing reconstruction method:
217
+ - URL: https://opg.optica.org/oe/fulltext.cfm?uri=oe-32-7-10801&id=547807###
218
+ - DOI: 10.1364/OE.514641
219
+
220
+ ```{bibtex}
221
+ @article{Dora:24,
222
+ author = {Johannes Dora and Martin M\"{o}ddel and Silja Flenner and Christian G. Schroer and Tobias Knopp and Johannes Hagemann},
223
+ journal = {Opt. Express},
224
+ keywords = {Free electron lasers; Holographic microscopy; Imaging techniques; Phase shift; X-ray imaging; Zone plates},
225
+ number = {7},
226
+ pages = {10801--10828},
227
+ publisher = {Optica Publishing Group},
228
+ title = {{Artifact-suppressing reconstruction of strongly interacting objects in X-ray near-field holography without a spatial support constraint}},
229
+ volume = {32},
230
+ month = {Mar},
231
+ year = {2024},
232
+ url = {https://opg.optica.org/oe/abstract.cfm?URI=oe-32-7-10801},
233
+ doi = {10.1364/OE.514641},
234
+ abstract = {The phase problem is a well known ill-posed reconstruction problem of coherent lens-less microscopic imaging, where only the squared magnitude of a complex wavefront is measured by a detector while the phase information of the wave field is lost. To retrieve the lost information, common algorithms rely either on multiple data acquisitions under varying measurement conditions or on the application of strong constraints such as a spatial support. In X-ray near-field holography, however, these methods are rendered impractical in the setting of time sensitive in situ and operando measurements. In this paper, we will forego the spatial support constraint and propose a projected gradient descent (PGD) based reconstruction scheme in combination with proper preprocessing and regularization that significantly reduces artifacts for refractive reconstructions from only a single acquired hologram without a spatial support constraint. We demonstrate the feasibility and robustness of our approach on different data sets obtained at the nano imaging endstation of P05 at PETRA III (DESY, Hamburg) operated by Helmholtz-Zentrum Hereon.},
235
+ }
236
+ ```
237
+
238
+ ### Model-based autofocus:
239
+ - URL: https://opg.optica.org/oe/abstract.cfm?doi=10.1364/OE.544573
240
+ - DOI: 10.1364/OE.544573
241
+
242
+ ```{bibtex}
243
+ @article{Dora:25,
244
+ author = {Johannes Dora and Martin M\"{o}ddel and Silja Flenner and Jan Reimers and Berit Zeller-Plumhoff and Christian G. Schroer and Tobias Knopp and Johannes Hagemann},
245
+ journal = {Opt. Express},
246
+ keywords = {Image analysis; Image metrics; Imaging systems; Phase retrieval; X-ray imaging; Zone plates},
247
+ number = {4},
248
+ pages = {6641--6657},
249
+ publisher = {Optica Publishing Group},
250
+ title = {Model-based autofocus for near-field phase retrieval},
251
+ volume = {33},
252
+ month = {Feb},
253
+ year = {2025},
254
+ url = {https://opg.optica.org/oe/abstract.cfm?URI=oe-33-4-6641},
255
+ doi = {10.1364/OE.544573},
256
+ }
257
+ ```
258
+
259
+ ### Python Repository on Zenodo
260
+ - URL: https://zenodo.org/records/14024980
261
+ - DOI: 10.5281/zenodo.8349364