nabu 2024.2.0__py3-none-any.whl → 2024.2.0rc2__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/estimation/cor.py +1 -1
- nabu/pipeline/estimators.py +3 -3
- nabu/pipeline/fullfield/chunked.py +2 -6
- nabu/pipeline/writer.py +0 -7
- nabu/resources/dataset_analyzer.py +11 -11
- {nabu-2024.2.0.dist-info → nabu-2024.2.0rc2.dist-info}/METADATA +2 -2
- {nabu-2024.2.0.dist-info → nabu-2024.2.0rc2.dist-info}/RECORD +12 -12
- {nabu-2024.2.0.dist-info → nabu-2024.2.0rc2.dist-info}/LICENSE +0 -0
- {nabu-2024.2.0.dist-info → nabu-2024.2.0rc2.dist-info}/WHEEL +0 -0
- {nabu-2024.2.0.dist-info → nabu-2024.2.0rc2.dist-info}/entry_points.txt +0 -0
- {nabu-2024.2.0.dist-info → nabu-2024.2.0rc2.dist-info}/top_level.txt +0 -0
nabu/__init__.py
CHANGED
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.2 # 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
|
-
#
|
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["side"] == "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,10 +668,7 @@ 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(
|
672
|
-
self.process_config, "single_output_file_initialized", False
|
673
|
-
), # COMPAT.
|
674
|
-
"writer_initialized": getattr(self.process_config, "_writer_initialized", False),
|
671
|
+
"single_output_file_initialized": getattr(self.process_config, "single_output_file_initialized", False),
|
675
672
|
"raw_vol_metadata": {"voxelSize": self.dataset_info.pixel_size}, # legacy...
|
676
673
|
}
|
677
674
|
writer_extra_options.update(extra_options)
|
@@ -856,8 +853,7 @@ class ChunkedPipeline:
|
|
856
853
|
self.writer.write_data(data)
|
857
854
|
self.logger.info("Wrote %s" % self.writer.fname)
|
858
855
|
self._write_histogram()
|
859
|
-
self.process_config.single_output_file_initialized = True
|
860
|
-
self.process_config._writer_initialized = True
|
856
|
+
self.process_config.single_output_file_initialized = True
|
861
857
|
|
862
858
|
def _write_histogram(self):
|
863
859
|
if "histogram" not in self.processing_steps:
|
nabu/pipeline/writer.py
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
from os import path
|
2
2
|
from tomoscan.esrf import TIFFVolume, MultiTIFFVolume, EDFVolume, JP2KVolume
|
3
|
-
from tomoscan.esrf.volume.singleframebase import VolumeSingleFrameBase
|
4
3
|
from ..utils import check_supported, get_num_threads
|
5
4
|
from ..resources.logger import LoggerOrPrint
|
6
5
|
from ..io.writer import NXProcessWriter, HSTVolVolume, NXVolVolume
|
@@ -114,7 +113,6 @@ class WriterManager:
|
|
114
113
|
return vol_writer.data_url.file_path()
|
115
114
|
|
116
115
|
def _init_writer(self):
|
117
|
-
self._writer_was_already_initialized = self.extra_options.get("writer_initialized", False)
|
118
116
|
if self.file_format in ["tiff", "edf", "jp2", "hdf5"]:
|
119
117
|
writer_kwargs = {
|
120
118
|
"folder": self.output_dir,
|
@@ -145,11 +143,6 @@ class WriterManager:
|
|
145
143
|
self._h5_entry = self.metadata.get("entry", "entry")
|
146
144
|
self.writer = self._writer_classes[self.file_format](**writer_kwargs)
|
147
145
|
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
|
-
# ---
|
153
146
|
if path.exists(self.fname):
|
154
147
|
err = "File already exists: %s" % self.fname
|
155
148
|
if self.overwrite:
|
@@ -52,7 +52,7 @@ class DatasetAnalyzer:
|
|
52
52
|
"output_dir": None,
|
53
53
|
"exclude_projections": None,
|
54
54
|
"hdf5_entry": None,
|
55
|
-
|
55
|
+
"nx_version": 1.0,
|
56
56
|
}
|
57
57
|
# --
|
58
58
|
advanced_options.update(extra_options)
|
@@ -302,7 +302,7 @@ class EDFDatasetAnalyzer(DatasetAnalyzer):
|
|
302
302
|
return np.deg2rad(self.dataset_scanner.rotation_angle())
|
303
303
|
|
304
304
|
def get_reduced_flats(self, **reader_kwargs):
|
305
|
-
if self.
|
305
|
+
if self.flats in [None, {}]:
|
306
306
|
raise FileNotFoundError("No reduced flat ('refHST') found in %s" % self.location)
|
307
307
|
# A few notes:
|
308
308
|
# (1) In principle we could do the reduction (mean/median) from raw frames (ref_xxxx_yyyy)
|
@@ -311,15 +311,15 @@ class EDFDatasetAnalyzer(DatasetAnalyzer):
|
|
311
311
|
# (eg. subsampling, binning, distortion correction...)
|
312
312
|
# (3) The following spawns one reader instance per file, which is not elegant,
|
313
313
|
# but in principle there are typically 1-2 reduced flats in a scan
|
314
|
-
readers = {k: EDFStackReader([self.
|
315
|
-
return {k: readers[k].load_data()[0] for k in self.
|
314
|
+
readers = {k: EDFStackReader([self.flats[k].file_path()], **reader_kwargs) for k in self.flats.keys()}
|
315
|
+
return {k: readers[k].load_data()[0] for k in self.flats.keys()}
|
316
316
|
|
317
317
|
def get_reduced_darks(self, **reader_kwargs):
|
318
318
|
# See notes in get_reduced_flats() above
|
319
|
-
if self.
|
319
|
+
if self.darks in [None, {}]:
|
320
320
|
raise FileNotFoundError("No reduced dark ('darkend.edf' or 'dark.edf') found in %s" % self.location)
|
321
|
-
readers = {k: EDFStackReader([self.
|
322
|
-
return {k: readers[k].load_data()[0] for k in self.
|
321
|
+
readers = {k: EDFStackReader([self.darks[k].file_path()], **reader_kwargs) for k in self.darks.keys()}
|
322
|
+
return {k: readers[k].load_data()[0] for k in self.darks.keys()}
|
323
323
|
|
324
324
|
@property
|
325
325
|
def files(self):
|
@@ -365,10 +365,10 @@ class HDF5DatasetAnalyzer(DatasetAnalyzer):
|
|
365
365
|
def _get_dataset_hdf5_url(self):
|
366
366
|
if len(self.projections) > 0:
|
367
367
|
frames_to_take = self.projections
|
368
|
-
elif len(self.
|
369
|
-
frames_to_take = self.
|
370
|
-
elif len(self.
|
371
|
-
frames_to_take = self.
|
368
|
+
elif len(self.flats) > 0:
|
369
|
+
frames_to_take = self.flats
|
370
|
+
elif len(self.darks) > 0:
|
371
|
+
frames_to_take = self.darks
|
372
372
|
else:
|
373
373
|
raise ValueError("No projections, no flats and no darks ?!")
|
374
374
|
first_proj_idx = sorted(frames_to_take.keys())[0]
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: nabu
|
3
|
-
Version: 2024.2.
|
3
|
+
Version: 2024.2.0rc2
|
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>
|
@@ -53,7 +53,7 @@ Requires-Dist: numpy <2,>1.9.0
|
|
53
53
|
Requires-Dist: scipy
|
54
54
|
Requires-Dist: h5py >=3.0
|
55
55
|
Requires-Dist: silx >=0.15.0
|
56
|
-
Requires-Dist: tomoscan >=2.1.
|
56
|
+
Requires-Dist: tomoscan >=2.1.0a14
|
57
57
|
Requires-Dist: psutil
|
58
58
|
Requires-Dist: pytest
|
59
59
|
Requires-Dist: tifffile
|
@@ -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=GU7YEox3KaUtQMTS4mUVSVO6IWhXqQ_Ad6wWGkVsDyk,274
|
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
|
@@ -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=b8dv047g8AYL9mV6vAAkIloSgNeN3w2bozZY1ox7bII,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,14 +131,14 @@ 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=a-6ISR6ii8J7xMvr6oKFJO8yMFT_QzO7L5kMcg4RJmw,40269
|
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=V4b6tGHMj5KpTl2RmDltSP-a-BEw5lfR96cBAdm_6FQ,7649
|
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=LxT9LxViYIihgy0N34BgY9uvMlupfJYiX9l6Hp2EdlA,40348
|
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
|
@@ -250,7 +250,7 @@ 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=_M7EQcRgldhtGeXCsOUNdx6M1nlLRWW8rKPWMB-lfN0,18518
|
254
254
|
nabu/resources/gpu.py,sha256=GgpMb5umRQAUsEDEAefb4wSA5qm4JSMhkWmCEpW3X9g,5702
|
255
255
|
nabu/resources/logger.py,sha256=-lOzhN_sU4R3BIfC69aMj2O8S_ocsvXsmwkhWlcxVEc,3758
|
256
256
|
nabu/resources/nxflatfield.py,sha256=XlhLYj1TmSQ4s36W48kn0lNTvqXlFCuZxKHfTveltow,9225
|
@@ -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.0rc2.dist-info/LICENSE,sha256=1eAIPSnEsnSFNUODnLtNtQTs76exG3ZxJ1DJR6zoUBA,1066
|
315
|
+
nabu-2024.2.0rc2.dist-info/METADATA,sha256=nJCwt8-vLEu5ZeqjsatPynMDbqdIILum0iPK23dEqD0,5544
|
316
|
+
nabu-2024.2.0rc2.dist-info/WHEEL,sha256=5sUXSg9e4bi7lTLOHcm6QEYwO5TIF1TNbTSVFVjcJcc,92
|
317
|
+
nabu-2024.2.0rc2.dist-info/entry_points.txt,sha256=cJKGkBeykVL7uK3E4R0RLRqMXifTL2qdO573syPAvJc,1288
|
318
|
+
nabu-2024.2.0rc2.dist-info/top_level.txt,sha256=fsm_N3eXLRZk2QXF9OSKPNDPFXOz8FAQjHh5avT3dok,9
|
319
|
+
nabu-2024.2.0rc2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|