nabu 2024.2.0rc3__py3-none-any.whl → 2024.2.1__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 +1 -1
- nabu/app/cli_configs.py +1 -1
- nabu/estimation/cor.py +1 -1
- nabu/pipeline/estimators.py +3 -3
- nabu/pipeline/fullfield/chunked.py +6 -2
- nabu/pipeline/fullfield/processconfig.py +2 -2
- nabu/pipeline/fullfield/reconstruction.py +1 -1
- nabu/pipeline/writer.py +7 -0
- nabu/resources/dataset_analyzer.py +1 -1
- nabu/resources/nxflatfield.py +6 -6
- {nabu-2024.2.0rc3.dist-info → nabu-2024.2.1.dist-info}/METADATA +1 -1
- {nabu-2024.2.0rc3.dist-info → nabu-2024.2.1.dist-info}/RECORD +16 -16
- {nabu-2024.2.0rc3.dist-info → nabu-2024.2.1.dist-info}/LICENSE +0 -0
- {nabu-2024.2.0rc3.dist-info → nabu-2024.2.1.dist-info}/WHEEL +0 -0
- {nabu-2024.2.0rc3.dist-info → nabu-2024.2.1.dist-info}/entry_points.txt +0 -0
- {nabu-2024.2.0rc3.dist-info → nabu-2024.2.1.dist-info}/top_level.txt +0 -0
nabu/__init__.py
CHANGED
nabu/app/cli_configs.py
CHANGED
@@ -37,7 +37,7 @@ BootstrapConfig = {
|
|
37
37
|
"default": "",
|
38
38
|
},
|
39
39
|
"template": {
|
40
|
-
"help": "Use a template configuration file. Available are: id19_pag, id16_holo, id16_ctf. You can also define your own templates via the NABU_TEMPLATES_PATH environment variable.",
|
40
|
+
"help": "Use a template configuration file. Available are: id19_pag, id16_holo, id16_ctf, id16a_fluo, bm05_pag. You can also define your own templates via the NABU_TEMPLATES_PATH environment variable.",
|
41
41
|
"default": "",
|
42
42
|
},
|
43
43
|
"helical": {"help": "Prepare configuration file for helical", "default": 0, "required": False, "type": int},
|
nabu/estimation/cor.py
CHANGED
@@ -239,7 +239,7 @@ class CenterOfRotationSlidingWindow(CenterOfRotation):
|
|
239
239
|
win_2_start = img_width // 2 - window_shift
|
240
240
|
else:
|
241
241
|
abs_pos = int(side + img_width // 2)
|
242
|
-
window_fraction = 0.
|
242
|
+
window_fraction = 0.1 # Hard-coded ?
|
243
243
|
|
244
244
|
window_width = round(window_fraction * img_width)
|
245
245
|
window_shift = window_width // 2
|
nabu/pipeline/estimators.py
CHANGED
@@ -243,13 +243,13 @@ class CORFinder(CORFinderBase):
|
|
243
243
|
# All find_shift() methods in self.search_methods have the same API with "img_1" and "img_2"
|
244
244
|
cor_exec_kwargs = update_func_kwargs(self.cor_finder.find_shift, self.cor_options)
|
245
245
|
cor_exec_kwargs["return_relative_to_middle"] = False
|
246
|
-
# FIXME
|
246
|
+
# ----- FIXME -----
|
247
247
|
# 'self.cor_options' can contain 'side="from_file"', and we should not modify it directly
|
248
248
|
# because it's entered by the user.
|
249
249
|
# Either make a copy of self.cor_options, or change the inspect() mechanism
|
250
|
-
if cor_exec_kwargs
|
250
|
+
if cor_exec_kwargs.get("side", None) == "from_file":
|
251
251
|
cor_exec_kwargs["side"] = self._lookup_side or "center"
|
252
|
-
#
|
252
|
+
# ------
|
253
253
|
if self._lookup_side is not None:
|
254
254
|
cor_exec_kwargs["side"] = self._lookup_side
|
255
255
|
self.logger.debug("%s.find_shift(%s)" % (self.cor_finder.__class__.__name__, str(cor_exec_kwargs)))
|
@@ -668,7 +668,10 @@ class ChunkedPipeline:
|
|
668
668
|
"jpeg2000_compression_ratio": options["jpeg2000_compression_ratio"],
|
669
669
|
"float_clip_values": options["float_clip_values"],
|
670
670
|
"tiff_single_file": options.get("tiff_single_file", False),
|
671
|
-
"single_output_file_initialized": getattr(
|
671
|
+
"single_output_file_initialized": getattr(
|
672
|
+
self.process_config, "single_output_file_initialized", False
|
673
|
+
), # COMPAT.
|
674
|
+
"writer_initialized": getattr(self.process_config, "_writer_initialized", False),
|
672
675
|
"raw_vol_metadata": {"voxelSize": self.dataset_info.pixel_size}, # legacy...
|
673
676
|
}
|
674
677
|
writer_extra_options.update(extra_options)
|
@@ -853,7 +856,8 @@ class ChunkedPipeline:
|
|
853
856
|
self.writer.write_data(data)
|
854
857
|
self.logger.info("Wrote %s" % self.writer.fname)
|
855
858
|
self._write_histogram()
|
856
|
-
self.process_config.single_output_file_initialized = True
|
859
|
+
self.process_config.single_output_file_initialized = True # COMPAT.
|
860
|
+
self.process_config._writer_initialized = True
|
857
861
|
|
858
862
|
def _write_histogram(self):
|
859
863
|
if "histogram" not in self.processing_steps:
|
@@ -465,7 +465,7 @@ class ProcessConfig(ProcessConfigBase):
|
|
465
465
|
if self.get_radios_rotation_mode() == "chunk":
|
466
466
|
tasks.append("tilt_correction")
|
467
467
|
options["tilt_correction"] = {
|
468
|
-
"angle":
|
468
|
+
"angle": dataset_info.detector_tilt,
|
469
469
|
"center": nabu_config["preproc"]["rotate_projections_center"],
|
470
470
|
"mode": "chunk",
|
471
471
|
}
|
@@ -513,7 +513,7 @@ class ProcessConfig(ProcessConfigBase):
|
|
513
513
|
if self.get_radios_rotation_mode() == "full":
|
514
514
|
tasks.append("tilt_correction")
|
515
515
|
options["tilt_correction"] = {
|
516
|
-
"angle":
|
516
|
+
"angle": dataset_info.detector_tilt,
|
517
517
|
"center": nabu_config["preproc"]["rotate_projections_center"],
|
518
518
|
"mode": "full",
|
519
519
|
}
|
@@ -253,7 +253,7 @@ class FullFieldReconstructor:
|
|
253
253
|
if self.process_config.processing_options.get("phase", {}).get("method", None) == "CTF":
|
254
254
|
force_grouped_mode = True
|
255
255
|
msg = "CTF phase retrieval needs to process full radios"
|
256
|
-
if self.process_config.
|
256
|
+
if (self.process_config.dataset_info.detector_tilt or 0) > 15:
|
257
257
|
force_grouped_mode = True
|
258
258
|
msg = "Radios rotation with a large angle needs to process full radios"
|
259
259
|
if self.process_config.resume_from_step == "sinogram" and force_grouped_mode:
|
nabu/pipeline/writer.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
from os import path
|
2
2
|
from tomoscan.esrf import TIFFVolume, MultiTIFFVolume, EDFVolume, JP2KVolume
|
3
|
+
from tomoscan.esrf.volume.singleframebase import VolumeSingleFrameBase
|
3
4
|
from ..utils import check_supported, get_num_threads
|
4
5
|
from ..resources.logger import LoggerOrPrint
|
5
6
|
from ..io.writer import NXProcessWriter, HSTVolVolume, NXVolVolume
|
@@ -113,6 +114,7 @@ class WriterManager:
|
|
113
114
|
return vol_writer.data_url.file_path()
|
114
115
|
|
115
116
|
def _init_writer(self):
|
117
|
+
self._writer_was_already_initialized = self.extra_options.get("writer_initialized", False)
|
116
118
|
if self.file_format in ["tiff", "edf", "jp2", "hdf5"]:
|
117
119
|
writer_kwargs = {
|
118
120
|
"folder": self.output_dir,
|
@@ -143,6 +145,11 @@ class WriterManager:
|
|
143
145
|
self._h5_entry = self.metadata.get("entry", "entry")
|
144
146
|
self.writer = self._writer_classes[self.file_format](**writer_kwargs)
|
145
147
|
self.fname = self.get_fname(self.writer)
|
148
|
+
# In certain cases, tomoscan needs to remove any previous existing volume filess
|
149
|
+
# and avoid calling 'clean_output_data' when writing downstream (for chunk processing)
|
150
|
+
if isinstance(self.writer, VolumeSingleFrameBase):
|
151
|
+
self.writer.skip_existing_data_files_removal = self._writer_was_already_initialized
|
152
|
+
# ---
|
146
153
|
if path.exists(self.fname):
|
147
154
|
err = "File already exists: %s" % self.fname
|
148
155
|
if self.overwrite:
|
nabu/resources/nxflatfield.py
CHANGED
@@ -35,12 +35,10 @@ def get_frame_possible_urls(dataset_info, user_dir, output_dir):
|
|
35
35
|
else:
|
36
36
|
dataurl_default_template = h5scan.REDUCED_DARKS_DATAURLS[0]
|
37
37
|
|
38
|
-
rel_file_path = dataurl_default_template.file_path().format(
|
39
|
-
scan_prefix=dataset_info.dataset_scanner.get_dataset_basename()
|
40
|
-
)
|
38
|
+
rel_file_path = dataurl_default_template.file_path().format(scan_prefix=h5scan.get_dataset_basename())
|
41
39
|
return DataUrl(
|
42
40
|
file_path=os.path.join(dirname, rel_file_path),
|
43
|
-
data_path=dataurl_default_template.data_path(),
|
41
|
+
data_path=dataurl_default_template.data_path().format(entry=h5scan.entry, index="{index}"),
|
44
42
|
data_slice=dataurl_default_template.data_slice(), # not sure if needed
|
45
43
|
scheme="silx",
|
46
44
|
)
|
@@ -144,9 +142,11 @@ def data_url_exists(data_url):
|
|
144
142
|
"""
|
145
143
|
if not (os.path.isfile(data_url.file_path())):
|
146
144
|
return False
|
145
|
+
group_exists = False
|
147
146
|
with HDF5File(data_url.file_path(), "r") as f:
|
148
|
-
|
149
|
-
|
147
|
+
data_path_without_index = data_url.data_path().split("{")[0]
|
148
|
+
group_exists = f.get(data_path_without_index, default=None) is not None
|
149
|
+
return group_exists
|
150
150
|
|
151
151
|
|
152
152
|
# pylint: disable=E1136
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: nabu
|
3
|
-
Version: 2024.2.
|
3
|
+
Version: 2024.2.1
|
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>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
doc/conf.py,sha256=3xtCarCHrXPr50GbeRDuH-o3Jzojw7mpr7vpGfZPLAE,3787
|
2
2
|
doc/create_conf_doc.py,sha256=IVOdP70KvbW9WS_UQu3Iyd0YfS60E2fJ5IDtQ_s4cDw,1143
|
3
3
|
doc/get_mathjax.py,sha256=VIvKRCdDuF2VoY8JD3mSey9XX13AZMmwTJBHdt1tUs4,1012
|
4
|
-
nabu/__init__.py,sha256=
|
4
|
+
nabu/__init__.py,sha256=_crjpH1e06xe5ACe0WGTWJwi-ZGm59UWsB_3tUnYxlA,270
|
5
5
|
nabu/tests.py,sha256=cew9OY2uTyncHI_HM32W8CP6B1GTGKaOW65XtMEqs7o,1417
|
6
6
|
nabu/testutils.py,sha256=VkSL9tbY0XEH49Z5OjDFFhzkSxrCv4UIuvSVFgegSUY,7632
|
7
7
|
nabu/utils.py,sha256=V1B_sD54XGNKn5pORa2yNCATyswOzybey3sv8BuIYWY,26355
|
@@ -9,7 +9,7 @@ nabu/app/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
9
|
nabu/app/bootstrap.py,sha256=3yLZJmrmQBmPJMBtE2ih2cspfqOy5T_UN2U8B3i_hkI,3266
|
10
10
|
nabu/app/bootstrap_stitching.py,sha256=Inr0_zRAtyeMTK1BKxGqoDf-Na0O33CICmQJYja06ug,2148
|
11
11
|
nabu/app/cast_volume.py,sha256=mjINEIFrh2BVC8mPFO0cnzlFUOS3x5aqjFPGKsb3H-c,11264
|
12
|
-
nabu/app/cli_configs.py,sha256=
|
12
|
+
nabu/app/cli_configs.py,sha256=EGKp7DrR48PAahZLJd09XAIAdm7Q5nOVSybztglhW_8,22276
|
13
13
|
nabu/app/compare_volumes.py,sha256=Mu5O4uP-ANo-el-fE5PLvEq42BTk5FkrscaFRyQZdis,3341
|
14
14
|
nabu/app/composite_cor.py,sha256=TjYiAtmY4o9lwNpkIEueTTNli72QN6jtR_zbtCeOJz4,5138
|
15
15
|
nabu/app/correct_rot.py,sha256=K0UQz4l5caFvsSr1-1y5hZvt6e45NAH3qYOhzHm2mGc,2130
|
@@ -64,7 +64,7 @@ nabu/cuda/src/transpose.cu,sha256=Enim7vLxTCFZbK3BmYdQ6ZatA_FLp6601VOSl8iGFjg,47
|
|
64
64
|
nabu/cuda/tests/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
65
65
|
nabu/estimation/__init__.py,sha256=HWE3ivArjlJx4FjFh2Q73VmpIyzod80KTmXvFo1AP1s,379
|
66
66
|
nabu/estimation/alignment.py,sha256=DWe4PBLsAOt95m_UEinVXUhXyYDmV0NOHW-oHpVEjVk,21185
|
67
|
-
nabu/estimation/cor.py,sha256=
|
67
|
+
nabu/estimation/cor.py,sha256=HcE0xw0ECSkx_kG30taw964rWZwh6lfgg8m9wnKdXik,50415
|
68
68
|
nabu/estimation/cor_sino.py,sha256=Wh0t8Ak6h8kf3rn5azD1XqD4e0Xa90oZUy90n9Ory8c,19116
|
69
69
|
nabu/estimation/distortion.py,sha256=DEXizQpgHBXmrhbQ0kuEchicxmiDgmU2qrh8bCgSezg,4701
|
70
70
|
nabu/estimation/focus.py,sha256=I2B5ODmGToE0-Y-B_6v1zJv7XcWdkXPZzrs2uYpiPlc,18029
|
@@ -131,20 +131,20 @@ nabu/pipeline/config_validators.py,sha256=ocAKB26iRjm5qs1Ay4B_rgGcg8aZjAP34XpEZR
|
|
131
131
|
nabu/pipeline/datadump.py,sha256=lK36YlsVSeE4fdkD7cgVCl4RKn-Wa9KYgOw4DNtH8Ow,6982
|
132
132
|
nabu/pipeline/dataset_validator.py,sha256=etQw9NC_YGsdWCgjsn8aJ3WfvcRuJlLVZlWoqhvvo-8,9263
|
133
133
|
nabu/pipeline/detector_distortion_provider.py,sha256=ru1AxbcuO-FA8FYooPBWgp1lzdSDUtzFUC1A_sS8jME,920
|
134
|
-
nabu/pipeline/estimators.py,sha256=
|
134
|
+
nabu/pipeline/estimators.py,sha256=AZXDmz7hngbVEfytpcu3E2QkOG4IqtXjQN8uUMBJTa0,40298
|
135
135
|
nabu/pipeline/params.py,sha256=EoovjCUTUXmj5HQ3qE0RhP7XD3cndaiT21TdvjTIhE8,3746
|
136
136
|
nabu/pipeline/processconfig.py,sha256=3xx2Lc8uEzPAqSMwUncr4RCiCtKn2c7wnXXbPSn8GNo,7719
|
137
137
|
nabu/pipeline/reader.py,sha256=wkxPHYOi_C8dHNc7kddB8AMtFuW7GjsP_tm6SJeHlEY,4792
|
138
138
|
nabu/pipeline/utils.py,sha256=0O1GLyYLQ8oA2ErI_T3BIfEVjP48dl-u_gl91eX7pjU,3543
|
139
|
-
nabu/pipeline/writer.py,sha256=
|
139
|
+
nabu/pipeline/writer.py,sha256=MG_R1oU8Ff9NdKRHiBkLMz0CmvEXY47zBUE-DpjXElQ,8172
|
140
140
|
nabu/pipeline/fullfield/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
141
|
-
nabu/pipeline/fullfield/chunked.py,sha256=
|
141
|
+
nabu/pipeline/fullfield/chunked.py,sha256=_LauzrZSMO0y6E1g_zYFweK8wb07u1p2JulrVDRnA04,40549
|
142
142
|
nabu/pipeline/fullfield/chunked_cuda.py,sha256=Jdkk6ZIt3S6UZYbupHtSj2vrj3krWMcqRHHprfblDfk,5848
|
143
143
|
nabu/pipeline/fullfield/computations.py,sha256=AEp3qvwyY-l8-GzjH1E6kmcmU6OgDp6sB-mltq0Jnxg,9970
|
144
144
|
nabu/pipeline/fullfield/dataset_validator.py,sha256=Iy6oOnXnBldDcg0ifm_zzrzMQ6YdkR_hkHFySZgxbno,2943
|
145
145
|
nabu/pipeline/fullfield/nabu_config.py,sha256=rvHmCNHx2y-GKBidRWCAjJd0IynvolPTTmBqNoOSvEA,31877
|
146
|
-
nabu/pipeline/fullfield/processconfig.py,sha256=
|
147
|
-
nabu/pipeline/fullfield/reconstruction.py,sha256=
|
146
|
+
nabu/pipeline/fullfield/processconfig.py,sha256=2eE9W0KjsHq8aSCXlczsISpWM9SMjWL03fN1RqZWyxg,36815
|
147
|
+
nabu/pipeline/fullfield/reconstruction.py,sha256=fMHKR8LnpQ2_asIO5bJB3pRixABrKLi53KzJuB83NZ4,37422
|
148
148
|
nabu/pipeline/helical/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
149
149
|
nabu/pipeline/helical/dataset_validator.py,sha256=0YQc0hdYdpaXznFaKmlj9SIu7mNs0xXMejcRkhOZHaI,640
|
150
150
|
nabu/pipeline/helical/fbp.py,sha256=0fAz-Fb0Rn_FzellvcS2cy-Wvm-5dxEf494YFt4pLws,5845
|
@@ -250,10 +250,10 @@ nabu/reconstruction/tests/test_reconstructor.py,sha256=3p2Wk_OqgZqkNOkhK_NJWlHkO
|
|
250
250
|
nabu/reconstruction/tests/test_sino_normalization.py,sha256=fGv5Dlidxgm8ZC70Nk6oqVgpY2jzOW9NJaGlo44IJOo,3692
|
251
251
|
nabu/resources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
252
252
|
nabu/resources/cor.py,sha256=-mcrTbj3G7o4PP5E_gIRo2j6_-ADmMkkOc_0CyQv84c,170
|
253
|
-
nabu/resources/dataset_analyzer.py,sha256=
|
253
|
+
nabu/resources/dataset_analyzer.py,sha256=e3AqYR9ORW9Q03mGYCiC66nXld-X0LPnx9E8X3zFIGU,18568
|
254
254
|
nabu/resources/gpu.py,sha256=GgpMb5umRQAUsEDEAefb4wSA5qm4JSMhkWmCEpW3X9g,5702
|
255
255
|
nabu/resources/logger.py,sha256=-lOzhN_sU4R3BIfC69aMj2O8S_ocsvXsmwkhWlcxVEc,3758
|
256
|
-
nabu/resources/nxflatfield.py,sha256=
|
256
|
+
nabu/resources/nxflatfield.py,sha256=FhPqiXe6ZKu5eGI6aVfyTgcHhZF9kQUNX0cOxDPD73k,9324
|
257
257
|
nabu/resources/utils.py,sha256=LtOWEYneEzz0mDIpUWM23v9ILJ8FM0YFaVG3fFVc7OU,5725
|
258
258
|
nabu/resources/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
259
259
|
nabu/resources/templates/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -311,9 +311,9 @@ nabu/thirdparty/pore3d_deringer_munch.py,sha256=o4bisnFc-wMjuohWBT8wgWmfNehPQGtC
|
|
311
311
|
nabu/thirdparty/tomocupy_remove_stripe.py,sha256=Khe4zFf0kRzu65Yxnvq58gt1ljOztqJGdMDhVAiM7lM,24363
|
312
312
|
nabu/thirdparty/tomopy_phase.py,sha256=hK4oPpkogLOhv23XzzEXQY2u3r8fJvASY_bINVs6ERE,8634
|
313
313
|
nabu/thirdparty/tomwer_load_flats_darks.py,sha256=ZNoVAinUb_wGYbfvs_4BVnWsjsQmNxSvCh1bWhR2WWg,5611
|
314
|
-
nabu-2024.2.
|
315
|
-
nabu-2024.2.
|
316
|
-
nabu-2024.2.
|
317
|
-
nabu-2024.2.
|
318
|
-
nabu-2024.2.
|
319
|
-
nabu-2024.2.
|
314
|
+
nabu-2024.2.1.dist-info/LICENSE,sha256=1eAIPSnEsnSFNUODnLtNtQTs76exG3ZxJ1DJR6zoUBA,1066
|
315
|
+
nabu-2024.2.1.dist-info/METADATA,sha256=XlEefB-apFg-XrbRJ-uOM18VdoqY-MXyiqO77-l3_m4,5538
|
316
|
+
nabu-2024.2.1.dist-info/WHEEL,sha256=5sUXSg9e4bi7lTLOHcm6QEYwO5TIF1TNbTSVFVjcJcc,92
|
317
|
+
nabu-2024.2.1.dist-info/entry_points.txt,sha256=cJKGkBeykVL7uK3E4R0RLRqMXifTL2qdO573syPAvJc,1288
|
318
|
+
nabu-2024.2.1.dist-info/top_level.txt,sha256=fsm_N3eXLRZk2QXF9OSKPNDPFXOz8FAQjHh5avT3dok,9
|
319
|
+
nabu-2024.2.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|