tomwer 1.4.2__py3-none-any.whl → 1.4.4__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.
@@ -181,21 +181,8 @@ class _StitcherThread(qt.QThread):
181
181
  },
182
182
  )
183
183
 
184
- if self._cluster_config in (None, {}):
185
- self._runLocally(task)
186
- else:
187
- self._runRemotely(task)
188
-
189
- def _runLocally(self, task):
190
- task.run()
191
-
192
- def _runRemotely(self, task):
193
184
  task.run()
194
- # wait for processing to be finished
195
- for future in task.outputs.future_tomo_obj.futures:
196
- future.result()
197
- # note: there is also a callback to aggregate result once all are finished.
198
- # so at this stage the final "nxtomo" or "volume" might not exists yet
185
+ print("stitching finished")
199
186
 
200
187
 
201
188
  class MainWindow(qt.QDialog):
@@ -445,13 +445,47 @@ def interpret_tomwer_configuration(config: dict, scan: TomwerScanBase | None) ->
445
445
  return nabu_config
446
446
 
447
447
  if "tomwer_slices" in config and scan is not None:
448
+ reconstruction_axis = NabuPlane.from_value(
449
+ config.get("reconstruction", {}).get("slice_plane", "XY")
450
+ )
448
451
  slices = list(
449
452
  NabuSliceMode.getSlices(
450
453
  config["tomwer_slices"],
451
454
  scan=scan,
452
- axis=config.get("reconstruction", {}).get("slice_plane", "XY"),
455
+ axis=reconstruction_axis,
456
+ )
457
+ )
458
+
459
+ def filter_slice(slice_index: int, axis: NabuPlane):
460
+ """remove slices that 'cannot' be reconstructed (out of bounds)"""
461
+ if axis is NabuPlane.XY:
462
+ index_max = scan.dim_2
463
+ elif axis in (NabuPlane.XZ, NabuPlane.YZ):
464
+ index_max = scan.dim_1
465
+ else:
466
+ raise ValueError
467
+
468
+ if index_max is None:
469
+ return True
470
+
471
+ index_max = index_max - 1
472
+
473
+ if slice_index > index_max:
474
+ _logger.error(
475
+ f"slice index {slice_index} requested. But slice index must be in 0-{index_max} - ignore this request"
476
+ )
477
+ return False
478
+ return True
479
+
480
+ slices = list(
481
+ filter(
482
+ lambda slice_index: filter_slice(
483
+ int(slice_index), axis=reconstruction_axis
484
+ ),
485
+ slices,
453
486
  )
454
487
  )
488
+
455
489
  else:
456
490
  slices = []
457
491
 
@@ -464,17 +498,6 @@ def interpret_tomwer_configuration(config: dict, scan: TomwerScanBase | None) ->
464
498
  else:
465
499
  pag_dbs = (None,)
466
500
 
467
- # remove slices that 'cannot' be reconstructed (out of bounds)
468
- def filter_slice(slice_index: int):
469
- if scan.dim_2 is not None and slice_index > scan.dim_2:
470
- _logger.error(
471
- f"slice index {slice_index} requested. But slice index must be in 0-{scan.dim_2} - ignore this request"
472
- )
473
- return False
474
- return True
475
-
476
- slices = list(filter(lambda slice_index: filter_slice(int(slice_index)), slices))
477
-
478
501
  # by default add the slice 'None' which is the slice for the volume
479
502
  slices.append(None)
480
503
  nabu_config = get_nabu_config(config=config)
@@ -26,7 +26,6 @@ from processview.core.superviseprocess import SuperviseProcess
26
26
  from tomwer.core.process.task import Task
27
27
  from tomwer.core.scan.nxtomoscan import NXtomoScan
28
28
  from tomwer.core.scan.scanfactory import ScanFactory
29
- from tomwer.core.futureobject import FutureTomwerObject
30
29
  from tomwer.core.volume.volumefactory import VolumeFactory
31
30
 
32
31
 
@@ -135,32 +134,24 @@ class StitcherTask(
135
134
  stitching_config=config,
136
135
  progress_bars=slurm_job_progress_bars,
137
136
  )
138
- for future in futures.values():
139
- # TODO: do we ned to make sure the processing is not finished yet ?
140
- future.add_done_callback(data_aggregation.onePartFinished)
137
+ # will wait and provide feedback until the stitching is completed.
138
+ data_aggregation.process()
141
139
 
142
140
  if config.stitching_type is StitchingType.Z_PREPROC:
143
141
  output_nx_tomo_file = config.output_file_path
144
142
  output_nx_tomo_entry = config.output_data_path
145
- tomwer_scan = NXtomoScan(
143
+ self.outputs.data = NXtomoScan(
146
144
  scan=output_nx_tomo_file, entry=output_nx_tomo_entry
147
145
  )
148
- self.outputs.future_tomo_obj = FutureTomwerObject(
149
- tomo_obj=tomwer_scan,
150
- futures=tuple(futures.values()),
151
- )
152
- self.outputs.data = None
146
+ self.outputs.future_tomo_obj = None
153
147
  self.outputs.volume = None
154
148
 
155
149
  elif config.stitching_type is StitchingType.Z_POSTPROC:
156
150
  tomwer_volume = VolumeFactory.create_tomo_object_from_identifier(
157
151
  config.output_volume.get_identifier().to_str()
158
152
  )
159
- self.outputs.future_tomo_obj = FutureTomwerObject(
160
- tomo_obj=tomwer_volume,
161
- futures=tuple(futures.values()),
162
- )
163
- self.outputs.volume = None
153
+ self.outputs.future_tomo_obj = None
154
+ self.outputs.volume = tomwer_volume
164
155
  self.outputs.data = None
165
156
 
166
157
 
@@ -171,7 +162,7 @@ class StitchingPostProcAggregation(_StitchingPostProcAggregation):
171
162
 
172
163
  def __init__(self, *args, **kwargs) -> None:
173
164
  super().__init__(*args, **kwargs)
174
- self._n_finished = 0
165
+ print("creates StitchingPostProcAggregation")
175
166
 
176
167
  if isinstance(self.stitching_config, dict):
177
168
  stitching_type = StitchingType.from_value(
@@ -192,10 +183,6 @@ class StitchingPostProcAggregation(_StitchingPostProcAggregation):
192
183
  f"stitching_config is expected to be an instance of {StitchingConfiguration}. {type(self.stitching_config)} provided instead"
193
184
  )
194
185
 
195
- def onePartFinished(self, *args, **kwargs):
196
- self._n_finished += 1
197
- # note: for now we only consider the user of the futures.
198
- # if users want to only run post-processing agregation then they will use the nabu CLI for it.
199
- if self._n_finished == len(self._futures):
200
- _logger.info("All slurm job finished. Will aggregate results")
201
- self.process()
186
+ def process(self):
187
+ super().process()
188
+ _logger.info("Stitching finished.")
@@ -95,6 +95,7 @@ class _NabuPhaseConfig(qt.QWidget, base._NabuStageConfigBase):
95
95
  self._unsharpOpts.setDiscourageUnsharpMask(
96
96
  self.getMethod() is _NabuPhaseMethod.NONE
97
97
  )
98
+ self._unsharpOpts._updateUnsharpMaskWarning()
98
99
  self.sigConfChanged.emit("method")
99
100
 
100
101
  def _signalConfChanged(self, param):
tomwer/version.py CHANGED
@@ -77,7 +77,7 @@ RELEASE_LEVEL_VALUE = {
77
77
 
78
78
  MAJOR = 1
79
79
  MINOR = 4
80
- MICRO = 2
80
+ MICRO = 4
81
81
  RELEV = "final" # <16
82
82
  SERIAL = 0 # <16
83
83
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tomwer
3
- Version: 1.4.2
3
+ Version: 1.4.4
4
4
  Summary: "tomography workflow tools"
5
5
  Home-page: https://gitlab.esrf.fr/tomotools/tomwer
6
6
  Author: Henri Payno, Pierre Paleo, Pierre-Olivier Autran, Jérôme Lesaint, Alessandro Mirone
@@ -220,7 +220,7 @@ orangecontrib/tomwer/widgets/visualization/tests/__init__.py,sha256=47DEQpj8HBSa
220
220
  tomwer/__init__.py,sha256=GeLSeY4__z-HQZu1y4ptZ5Y1OeXFvG8kuEwWXhkeaMA,360
221
221
  tomwer/__main__.py,sha256=7tCADiS4u7k1PCxFhlRAcYSIOpxQTGUTx8sCEQ-hi1E,8707
222
222
  tomwer/utils.py,sha256=7h7dEgKAEUmQ43jkULvC1B9Adl55nkCty-SEKUKCl4U,7008
223
- tomwer/version.py,sha256=Ut5Y5Pzhf7aqEi5CMCIwsyq_OqFINJdLxd0lcDcQ7js,4386
223
+ tomwer/version.py,sha256=cQn0hp7H0RGoblTK9Od0_A4QCnVaVE5G-t2RThewbMg,4386
224
224
  tomwer/app/__init__.py,sha256=RYMB2YhbQaoMXC8W-oOyfZ_Y1vmHD7L13YkKeAMuShM,85
225
225
  tomwer/app/axis.py,sha256=OhDgMj_gS-45PnjKBTyOCOkmZ1Iy-Tb6Dj66mzQg0sU,5827
226
226
  tomwer/app/canvas.py,sha256=sM368nniUwbQXLA-oNCg1iNwMMol_ZGTKbiw8WsC4yw,1539
@@ -253,7 +253,7 @@ tomwer/app/canvas_launcher/splash.py,sha256=cpUuZVKwlQbeAWfAqjpjP4q1v1MmkfxU6WWl
253
253
  tomwer/app/canvas_launcher/utils.py,sha256=4zWaao2EW5OcKomAw38YUIUgOLfkUPGdPCqLsfD1NMI,1031
254
254
  tomwer/app/canvas_launcher/widgetsscheme.py,sha256=9Or1KMmSxIs_dJmJGV0Xhjg9HH4m8aPGbtiEuK2i6q0,2744
255
255
  tomwer/app/stitching/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
256
- tomwer/app/stitching/common.py,sha256=-CztPRSwIAHocNIDksBdbRWALsy9G5aRFiG9b78vtlg,15203
256
+ tomwer/app/stitching/common.py,sha256=TCXNnAz2MSJrrogB5iWptktxq-g5ED2FUt_jMnDXpnQ,14723
257
257
  tomwer/core/__init__.py,sha256=ry3BZxaZzsbjymW1wqPcKROzJO9ePkiiqWp1JRVOrS8,72
258
258
  tomwer/core/futureobject.py,sha256=YQE6zROyDFu2PYBI7hxZKpn-K_FqZQ9xGSIyqMErK5U,5114
259
259
  tomwer/core/settings.py,sha256=57qD44LU_3eB50rD7RHdg5nBweiHerzWbXHcBUna6gY,4089
@@ -336,7 +336,7 @@ tomwer/core/process/reconstruction/nabu/castvolume.py,sha256=4VEVnJxWfG8_Ku2uhUS
336
336
  tomwer/core/process/reconstruction/nabu/helical.py,sha256=gauUkoPiShvnvMQrCQXv28g0yLe-GceML5kYMSXmNIg,1997
337
337
  tomwer/core/process/reconstruction/nabu/nabucommon.py,sha256=s1KxEzHQJ09JEWP3_EvKFe51k1boi_a8YRlbs3TppdE,23338
338
338
  tomwer/core/process/reconstruction/nabu/nabuscores.py,sha256=e5tRG1QtmVAdXb8KHMTMtBXA3KQXqKKcqipY2HzMURg,25275
339
- tomwer/core/process/reconstruction/nabu/nabuslices.py,sha256=sUpU1f6_qWbuKVUDNattFVvFE88By29f3CtTCtuKT-k,31517
339
+ tomwer/core/process/reconstruction/nabu/nabuslices.py,sha256=WAmNlfyRWL0zhEE8jMjMg7WyzPM4BcBA6bWpaH8O53A,32101
340
340
  tomwer/core/process/reconstruction/nabu/nabuvolume.py,sha256=Fn0tkPDTDJQaMEJA4LzpPp0ZtG4MIu9YN82-jesxRKo,20052
341
341
  tomwer/core/process/reconstruction/nabu/plane.py,sha256=366gWprWw8Rlob8jsMn753CqgudruvvVauU0ihH2lU4,400
342
342
  tomwer/core/process/reconstruction/nabu/settings.py,sha256=3AJpxVQbJziw4v6F26Ppz8Q9vc9ZNepTWygqpCAbIEM,955
@@ -374,7 +374,7 @@ tomwer/core/process/script/python.py,sha256=NScx6DtRA6m71jciiN6a7QIr3ICWmo3rXJY1
374
374
  tomwer/core/process/script/tests/test_script.py,sha256=1uku23G5_6JEjohI53FZyLpTjkmfsdGrwX__5Mr3DBg,1024
375
375
  tomwer/core/process/stitching/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
376
376
  tomwer/core/process/stitching/metadataholder.py,sha256=QWo04TRsGFg1MdydLvuuK1C2ICRXNwL1oK32JXB1dE8,6530
377
- tomwer/core/process/stitching/nabustitcher.py,sha256=DQTmCqOvcei9S9eu-H9NoVXBcBQf6DRxYOJO2Nn50QY,8129
377
+ tomwer/core/process/stitching/nabustitcher.py,sha256=wJGCpPIcBQXv-g6F6kxchEtcMEiqMGsq-r0Nq36aKmo,7422
378
378
  tomwer/core/process/stitching/tests/test_metadataholder.py,sha256=E9jgvtwdbcF9tgWS3uqHppHf8ff0aCvjROrLAFVZSpQ,631
379
379
  tomwer/core/process/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
380
380
  tomwer/core/process/tests/test_conditions.py,sha256=FBmBn3fvMW2H27ZLVnyYyS1bnfCb9v86WnWDw46WbMo,2140
@@ -568,7 +568,7 @@ tomwer/gui/reconstruction/nabu/nabuconfig/base.py,sha256=ZsfZORtztbZRIGmcX5bJGlV
568
568
  tomwer/gui/reconstruction/nabu/nabuconfig/ctf.py,sha256=z7mqBt77Y81gO7GO1OsXG3iGxcgSKNYLAjxlG-uC0K8,13142
569
569
  tomwer/gui/reconstruction/nabu/nabuconfig/nabuconfig.py,sha256=rJXFMr_dlTekd0mCbzzg7b7L2QJrLthDHX6JK1zkZTc,9059
570
570
  tomwer/gui/reconstruction/nabu/nabuconfig/output.py,sha256=0SShYqvFj-motxTw20e3I1Z0WiierSqgOsN15qwe-TY,11907
571
- tomwer/gui/reconstruction/nabu/nabuconfig/phase.py,sha256=3SPSokMuE4wvoKTn-aFStln__sjewcpG7H9oJY4x5qs,16239
571
+ tomwer/gui/reconstruction/nabu/nabuconfig/phase.py,sha256=h4F0qtKXOeligVuqKa-pBAvP2ol2EgfSRHjxvsQkvAQ,16293
572
572
  tomwer/gui/reconstruction/nabu/nabuconfig/preprocessing.py,sha256=lmL2UTL7gt20nbDv921SFIAnVoJkumafSCjqTE4zGlY,32608
573
573
  tomwer/gui/reconstruction/nabu/nabuconfig/reconstruction.py,sha256=bGCF7bJBfnh0xh4zcWpqhLrzqHuG32F-Tn4xHVQny3M,41151
574
574
  tomwer/gui/reconstruction/nabu/test/test_cast_volume.py,sha256=kup5JVKNN4QZOXYGco1ZRb_4TWrXAQOtfuQcqTpraA0,2764
@@ -903,9 +903,9 @@ tomwer/tests/orangecontrib/tomwer/widgets/visualization/tests/test_volume_viewer
903
903
  tomwer/tests/test_ewoks/test_conversion.py,sha256=a8cEWbErXiFCAkaapi0jeEoRKYxcFQCoa-Jr_u77_OM,3656
904
904
  tomwer/tests/test_ewoks/test_single_node_execution.py,sha256=YBUHfiAnkciv_kjj7biC5fOs7c7ofNImM_azGMn4LZM,2813
905
905
  tomwer/tests/test_ewoks/test_workflows.py,sha256=Eq80eexf5NVL7SzvwctLOaUeuQ8V3vDiFiHgbJA4Yb8,4871
906
- tomwer-1.4.2.dist-info/LICENSE,sha256=62p1wL0n9WMTu8x2YDv0odYgTqeSvTd9mQ0v6Mq7lzE,1876
907
- tomwer-1.4.2.dist-info/METADATA,sha256=0YX0nYm5b6VVBEgnLOx-vDB7Hermd6Q0lDpus2rD-tc,13377
908
- tomwer-1.4.2.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
909
- tomwer-1.4.2.dist-info/entry_points.txt,sha256=py3ZUWvGnWGc5c7Yhw_uBTm8Fmew0BDw3aQZnWMBNZI,500
910
- tomwer-1.4.2.dist-info/top_level.txt,sha256=Yz5zKh0FPiImtzHYcPuztG1AO8-6KEpUWgoChGbA0Ys,21
911
- tomwer-1.4.2.dist-info/RECORD,,
906
+ tomwer-1.4.4.dist-info/LICENSE,sha256=62p1wL0n9WMTu8x2YDv0odYgTqeSvTd9mQ0v6Mq7lzE,1876
907
+ tomwer-1.4.4.dist-info/METADATA,sha256=rX-5hSdlbZ--HdznnGl7KCiDSBycJgqfzwxurDQeYFU,13377
908
+ tomwer-1.4.4.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
909
+ tomwer-1.4.4.dist-info/entry_points.txt,sha256=py3ZUWvGnWGc5c7Yhw_uBTm8Fmew0BDw3aQZnWMBNZI,500
910
+ tomwer-1.4.4.dist-info/top_level.txt,sha256=Yz5zKh0FPiImtzHYcPuztG1AO8-6KEpUWgoChGbA0Ys,21
911
+ tomwer-1.4.4.dist-info/RECORD,,
File without changes