nabu 2023.1.0a1__py3-none-any.whl → 2023.1.0a2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
nabu/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
- __version__ = "2023.1.0-alpha1"
1
+ __version__ = "2023.1.0-alpha2"
2
2
  __nabu_modules__ = [
3
3
  "app",
4
4
  "cuda",
nabu/app/cast_volume.py CHANGED
@@ -101,6 +101,11 @@ def main(argv=None):
101
101
 
102
102
  if os.path.exists(options.input_volume):
103
103
  volumes = guess_volumes(options.input_volume)
104
+
105
+ def is_not_histogram(vol_identifier):
106
+ return not (hasattr(vol_identifier, "data_path") and vol_identifier.data_path.endswith("histogram"))
107
+
108
+ volumes = tuple(filter(is_not_histogram, volumes))
104
109
  if len(volumes) == 0:
105
110
  _logger.error(f"no valid volume found in {options.input_volume}")
106
111
  exit(1)
nabu/io/cast_volume.py CHANGED
@@ -276,7 +276,16 @@ def find_histogram(volume: VolumeBase, scan: Optional[TomoScanBase] = None) -> O
276
276
  elif isinstance(volume, HDF5Volume):
277
277
  histogram_file = volume.data_url.file_path()
278
278
  if volume.url is not None:
279
- data_path = "/".join((volume.url.data_path(), "histogram/results/data"))
279
+ data_path = volume.url.data_path()
280
+ if data_path.endswith("reconstruction"):
281
+ data_path = "/".join(
282
+ [
283
+ *data_path.split("/")[:-1],
284
+ "histogram/results/data",
285
+ ]
286
+ )
287
+ else:
288
+ data_path = "/".join((volume.url.data_path(), "histogram/results/data"))
280
289
  else:
281
290
  # TODO: FIXME: in some case (if the users provides the full data_url and if the 'DATA_DATASET_NAME' is not used we
282
291
  # will endup with an invalid data_path. Hope this case will not happen. Anyway this is a case that we can't handle.)
nabu/pipeline/datadump.py CHANGED
@@ -94,7 +94,7 @@ class DataDumpManager:
94
94
  "processing_options": self.processing_options, # slow!
95
95
  "nabu_config": self.process_config.nabu_config,
96
96
  },
97
- "entry": getattr(self.dataset_info.dataset_scanner, "entry", None),
97
+ "entry": getattr(self.dataset_info.dataset_scanner, "entry", "entry"),
98
98
  },
99
99
  )
100
100
 
@@ -368,6 +368,10 @@ class ChunkedPipeline:
368
368
  # Use chunk_reader.files instead of process_config.projs_indices(subsampling=True), because
369
369
  # chunk_reader might read only a subset of the files (in "grouped mode")
370
370
  self._ff_options["projs_indices"] = list(self.chunk_reader.files_subsampled.keys())
371
+ if self._ff_options.get("normalize_srcurrent", False):
372
+ a_start_idx, a_end_idx = self.sub_region[0]
373
+ subs = self.process_config.subsampling_factor
374
+ self._ff_options["radios_srcurrent"] = self._ff_options["radios_srcurrent"][a_start_idx:a_end_idx:subs]
371
375
 
372
376
  distortion_correction = None
373
377
  if self._ff_options["do_flat_distortion"]:
@@ -588,7 +592,7 @@ class ChunkedPipeline:
588
592
  # "processing_options": self.processing_options,
589
593
  #
590
594
  "nabu_config": self.process_config.nabu_config,
591
- "entry": getattr(self.dataset_info.dataset_scanner, "entry", None),
595
+ "entry": getattr(self.dataset_info.dataset_scanner, "entry", "entry"),
592
596
  }
593
597
  writer_extra_options = {
594
598
  "jpeg2000_compression_ratio": options["jpeg2000_compression_ratio"],
@@ -409,11 +409,7 @@ class HelicalReconstructorRegridded:
409
409
  self.logger.info(f"Creating SpanStrategy object for helical in {duration} seconds")
410
410
  if self.dry_run:
411
411
  info_string = self._span_info.get_informative_string()
412
- print(" SPAN_INFO informations ")
413
- print(info_string)
414
-
415
- info_string = self._span_info.get_informative_string()
416
- print(" SPAN_INFO informations ")
412
+ print(" Informations about the doable vertical span")
417
413
  print(info_string)
418
414
  return
419
415
 
@@ -108,13 +108,13 @@ nabu_config["reconstruction"].update(
108
108
  "type": "optional",
109
109
  },
110
110
  "start_z": {
111
- "default": "",
111
+ "default": "0",
112
112
  "help": "the first slice of the reconstructed range. Numbered going in the direction of the scan and starting with number zero for the first doable slice",
113
113
  "validator": slice_num_validator,
114
114
  "type": "optional",
115
115
  },
116
116
  "end_z": {
117
- "default": "",
117
+ "default": "-1",
118
118
  "help": "the "
119
119
  "end"
120
120
  " slice of the reconstructed range. Numbered going in the direction of the scan and starting with number zero for the first doable slice",
@@ -26,7 +26,7 @@ class SpanStrategy:
26
26
  ----------
27
27
  z_pix_per_proj : array of floats
28
28
  an array of floats with one entry per projection, in pixel units. The values are the vertical displacements of the detector.
29
- An increasing z means that the rotation axis is following the positive direction of the detector vertical axis, which is pointing toward the ground.
29
+ An decreasing z means that the rotation axis is following the positive direction of the detector vertical axis, which is pointing toward the ground.
30
30
  In the experimental setup, the vertical detector axis is pointing toward the ground. Moreover the values are offsetted so that the
31
31
  first value is zero. The offset value, in millimiters is z_offset_mm and it is the vertical position of the sample stage relatively
32
32
  to the center of the detector. A negative z_offset_mm means that the sample stage is below the detector for the first projection, and this is almost
@@ -186,9 +186,18 @@ class SpanStrategy:
186
186
 
187
187
  def get_informative_string(self):
188
188
  doable_span_v = self.get_doable_span()
189
+ if self.z_pix_per_proj[-1] > self.z_pix_per_proj[-1]:
190
+ direction = "ascending"
191
+ else:
192
+ direction = "descending"
193
+
189
194
  s = f"""
190
195
  Doable vertical span
191
196
  --------------------
197
+ The scan has been performed with an {direction} vertical translation of the rotation axis.
198
+
199
+ The detector vertical axis is up side down.
200
+
192
201
  Detector reference system at iproj=0:
193
202
  from vertical view height ... {doable_span_v.view_heights_minmax[0]}
194
203
  up to (included) ... {doable_span_v.view_heights_minmax[1]}
@@ -196,9 +205,7 @@ class SpanStrategy:
196
205
  The slice that projects to the first line of the first projection
197
206
  corresponds to vertical heigth = 0
198
207
 
199
- In the sample stage reference system:
200
- from vertical height above stage ( pixel units) ... {doable_span_v.z_pix_minmax[0]}
201
- up to (included) ... {doable_span_v.z_pix_minmax[1]}
208
+ In voxels, the vertical doable span measures: {doable_span_v.z_pix_minmax[1] - doable_span_v.z_pix_minmax[0]}
202
209
 
203
210
  And in millimiters above the stage:
204
211
  from vertical height above stage ( mm units) ... {doable_span_v.z_mm_minmax[0] - self.z_offset_mm }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nabu
3
- Version: 2023.1.0a1
3
+ Version: 2023.1.0a2
4
4
  Summary: Nabu - Tomography software
5
5
  Author: Pierre Paleo
6
6
  Author-email: pierre.paleo@esrf.fr
@@ -1,11 +1,11 @@
1
- nabu/__init__.py,sha256=wUgOEqe3zzoUbwRy_FoV5h5hV6zUx9nD3Mniibe1zz0,242
1
+ nabu/__init__.py,sha256=k6HChLxiTiiWaNSvV3_-R7lUf36ntgZfWbjjQg4WVj4,242
2
2
  nabu/tests.py,sha256=hzdcjA8MvW_Uxtc5onQ1IpwQotdVPt1KJNEH25uh9JY,1400
3
3
  nabu/testutils.py,sha256=nOzearGltWG2fPcJt4JyI_Y4_wzGt2dg_ssaLrH9bHA,10857
4
4
  nabu/utils.py,sha256=3o3Xk40xG1ghI6oAuNHJBCXjWcqxAacYijnAD52VDMg,21956
5
5
  nabu/app/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  nabu/app/bootstrap.py,sha256=kufLeIHgFuDH8S5I9nEodwujNWm7hoTMmPYngXqsXts,3233
7
7
  nabu/app/bootstrap_stitching.py,sha256=VxXrgwP7E_k1BhBQ94bEdnxWTQFs-cE5LewlHFr4JI8,733
8
- nabu/app/cast_volume.py,sha256=NU_bToU3eHwFlMkA_ziY-1cmj3V2ZZyoumwNsvIQTMU,8701
8
+ nabu/app/cast_volume.py,sha256=kreoo5VIOIYoXRHl5cDBO6t_gBL3PP86nAP1Md0xUkU,8921
9
9
  nabu/app/cli_configs.py,sha256=BRMW8G7SCLKR_hVy1gxYuBwJy_xdEhMvQ3wh9kzRQB0,14128
10
10
  nabu/app/compare_volumes.py,sha256=z9GpnFgcS260Ti8o-DgyUtQgPFrO2CNGhY5aHT7dze8,3327
11
11
  nabu/app/composite_cor.py,sha256=MRQqlPziX_ICp5d19OK_6dEJlk8EjZZ-sX7V5tNh_sM,3369
@@ -72,7 +72,7 @@ nabu/estimation/tests/test_focus.py,sha256=deaVGbIFSzHDAReoeAy-1HLsnKWpJQsC2SL9W
72
72
  nabu/estimation/tests/test_tilt.py,sha256=PN4tnV3-XU2nNA608kQShaHugWn_-wbHzWCTnLIaCTk,1658
73
73
  nabu/estimation/tests/test_translation.py,sha256=RkOnCYgk9DZGKlIka1snqTv4wbIz_nG7-EHAxnBHsJU,2999
74
74
  nabu/io/__init__.py,sha256=Mx0HRIENk0dJbN3b9tzPZhiOnPMxBItgVNQn_QLLrlI,176
75
- nabu/io/cast_volume.py,sha256=1n6py13yRng2YRnl3bZFRPfIZNcxYKz93ZDGJWXVQuI,14761
75
+ nabu/io/cast_volume.py,sha256=J0UcvfPlR47wdn_uvzhWYivmhSyS2DOGZo98-nsy91U,15085
76
76
  nabu/io/detector_distortion.py,sha256=Or4icugi0fGRKWIG0I9hCuR1UZA5Cel25ZGY7cR2j4I,11744
77
77
  nabu/io/reader.py,sha256=nff5uva6HT254HodUNIvIkZECf-F1Kn__ApIqp3kRmM,22555
78
78
  nabu/io/reader_helical.py,sha256=_6vZBH-US_VT7oOGJUtYXqPwFws7xZKcmdOthpwvlIQ,4477
@@ -115,7 +115,7 @@ nabu/opencl/utils.py,sha256=vg2QFEA1AMZ2Ky9-iHbk-hKwfDJXGTI0b7Y6h6qYI58,5168
115
115
  nabu/pipeline/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
116
116
  nabu/pipeline/config.py,sha256=aA_DashVEHIaVMCmD2efrezSO6RHw6DO4ZYczKHZr-g,9301
117
117
  nabu/pipeline/config_validators.py,sha256=R4QZQq80krovJi_18zS1tD3Am5XDBzwiPujZafPcbko,14025
118
- nabu/pipeline/datadump.py,sha256=Okrhk5fSLeQZWgo2QBbBwitMcr68blyEBtoj7449zCY,6517
118
+ nabu/pipeline/datadump.py,sha256=Ua4tbzxfGMOiT2-7WZn3IDiJqzzK-TyFuku_XUkH8_Q,6520
119
119
  nabu/pipeline/dataset_validator.py,sha256=qsDUfbgYBvXpTbW07LWZ0lMvMut_k9ckiA0Nt1dZN2o,9207
120
120
  nabu/pipeline/detector_distortion_provider.py,sha256=ru1AxbcuO-FA8FYooPBWgp1lzdSDUtzFUC1A_sS8jME,920
121
121
  nabu/pipeline/estimators.py,sha256=mgjXPTMKHDe4DwwNwAwGqiXUGojzxo_b2FxWWi9bYZQ,32033
@@ -125,7 +125,7 @@ nabu/pipeline/processconfig.py,sha256=iPZRjd3Y1ZTgOUKgYY9F_FKJsEWf4NGGcsy_3JtR7w
125
125
  nabu/pipeline/utils.py,sha256=5I0dmJqfIXki2DNFUvcf2enQWb3--vz4RzwHv1rnl18,2730
126
126
  nabu/pipeline/writer.py,sha256=IS_1PMQubVq-ra_CydJT4dnVqD7xf3Ak-faP-nASTMs,10920
127
127
  nabu/pipeline/fullfield/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
128
- nabu/pipeline/fullfield/chunked.py,sha256=oRncu0ONIch4Aq49W6fvFn3m12S9qRn4dH17H_-KLPQ,35751
128
+ nabu/pipeline/fullfield/chunked.py,sha256=Hjx-57-hCkworNIePFg4RXlpft17wH1eIUwNflFVLfA,36047
129
129
  nabu/pipeline/fullfield/chunked_black.py,sha256=HtzVRpcQIAocHpEiPEm7mEYTI6o_XbGezN10jRMCHAw,35285
130
130
  nabu/pipeline/fullfield/chunked_cuda.py,sha256=R_X47iZPGNwv6QfvAUAZOrgMc91rpI6NZpcDd3xsDd8,5405
131
131
  nabu/pipeline/fullfield/chunked_fb.py,sha256=ikuXkqXc72ES3dB5E96TsfEgn1-lWfd2WaBMYazxifk,36425
@@ -146,11 +146,11 @@ nabu/pipeline/helical/filtering.py,sha256=A5X1_Iwc5Z2X15UfSkejCoDUnmgzrCeWAlqLeK
146
146
  nabu/pipeline/helical/gridded_accumulator.py,sha256=hwwC00A-mIZKBqYtr9HatgOaFGDj4Ljzy4FIehe_k1U,20672
147
147
  nabu/pipeline/helical/helical_chunked_regridded.py,sha256=E_catWoX_ZCnv0_fN_RBA4FBKQwb9pBR74ChQPVJalw,62389
148
148
  nabu/pipeline/helical/helical_chunked_regridded_cuda.py,sha256=tl5qIzYmqWOauFmW46WQoHdU9t9mGDr45m-uOIrYzRk,4013
149
- nabu/pipeline/helical/helical_reconstruction.py,sha256=GRwEU93gsVir_BfFZXIAbxavB5E9v8_y7xF0U-W7Kok,22341
149
+ nabu/pipeline/helical/helical_reconstruction.py,sha256=hIkwIz9dO8x1VtVDDl0Himz8zsFqcJEDWsCb2hzLx4s,22216
150
150
  nabu/pipeline/helical/helical_utils.py,sha256=uFAQHDqENHqQWUpu1n99dnBCCKOlkgjDjvYORY6XFY0,1439
151
- nabu/pipeline/helical/nabu_config.py,sha256=eX2BvDAT_7q97iWw07B3KTze8udRlzBuux5PgXaKdv0,7296
151
+ nabu/pipeline/helical/nabu_config.py,sha256=DOc16F_r9o4px2wAdRjTRFkBh2K2i8_hHH9-arF8W-g,7299
152
152
  nabu/pipeline/helical/processconfig.py,sha256=NMo97gb_uv35EDvfMAi1Emhau8Vua-8eyAzrdk0Ub3E,2571
153
- nabu/pipeline/helical/span_strategy.py,sha256=dUOThFELV6oyqP15UH82O0M56Hk0hpJj2AQPyeE5D-I,24851
153
+ nabu/pipeline/helical/span_strategy.py,sha256=-IJ8Udqbw2ddmCz0ngAYznVYfLHNoLjxL1ihysbxmsQ,25043
154
154
  nabu/pipeline/helical/utils.py,sha256=51Qbh8db6-DX0iB9B9Kb07uwIG6_upAJg_8nhyzbB7o,1555
155
155
  nabu/pipeline/helical/weight_balancer.py,sha256=j0TGe50tbbsilQvml9CgMxeSy83CNaifHj-xuMGl8uE,3981
156
156
  nabu/pipeline/helical/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -231,10 +231,10 @@ nabu/thirdparty/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
231
231
  nabu/thirdparty/pore3d_deringer_munch.py,sha256=o4bisnFc-wMjuohWBT8wgWmfNehPQGtCl6G2NebJlbg,4500
232
232
  nabu/thirdparty/tomopy_phase.py,sha256=hK4oPpkogLOhv23XzzEXQY2u3r8fJvASY_bINVs6ERE,8634
233
233
  nabu/thirdparty/tomwer_load_flats_darks.py,sha256=ZNoVAinUb_wGYbfvs_4BVnWsjsQmNxSvCh1bWhR2WWg,5611
234
- nabu-2023.1.0a1.dist-info/LICENSE,sha256=5Brn2Fb7bFq1aWEGt9Nft51PqVDT8xQmVtQ1kin9nTo,1061
235
- nabu-2023.1.0a1.dist-info/METADATA,sha256=nW7KllxUbtR-m3xEs7DAT_MBCH4t8iI2Vnnf755MV5s,951
236
- nabu-2023.1.0a1.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
237
- nabu-2023.1.0a1.dist-info/entry_points.txt,sha256=BEl17rpRKrE3v964P_CCe_Xnd-JgBVBWEp1xySNwm5A,965
238
- nabu-2023.1.0a1.dist-info/top_level.txt,sha256=4gZBSqkJpZfhO0TPuvtIFnODQGk4j0XQlOsHM9idIv8,5
239
- nabu-2023.1.0a1.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
240
- nabu-2023.1.0a1.dist-info/RECORD,,
234
+ nabu-2023.1.0a2.dist-info/LICENSE,sha256=5Brn2Fb7bFq1aWEGt9Nft51PqVDT8xQmVtQ1kin9nTo,1061
235
+ nabu-2023.1.0a2.dist-info/METADATA,sha256=SVsaCDC8I6pBboLOjgGFVuZacyIwnefob4piuqVmfvc,951
236
+ nabu-2023.1.0a2.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
237
+ nabu-2023.1.0a2.dist-info/entry_points.txt,sha256=BEl17rpRKrE3v964P_CCe_Xnd-JgBVBWEp1xySNwm5A,965
238
+ nabu-2023.1.0a2.dist-info/top_level.txt,sha256=4gZBSqkJpZfhO0TPuvtIFnODQGk4j0XQlOsHM9idIv8,5
239
+ nabu-2023.1.0a2.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
240
+ nabu-2023.1.0a2.dist-info/RECORD,,