Tomography tasks#

How to use

These tasks come from ewoksid16a ewokstomo ewoksxrdct tomwer. It can be installed with

pip install ewoksid16a ewokstomo ewoksxrdct tomwer

ℹ️ These tasks are used at the following ESRF beamlines: BM05, BM18, ID03, ID11, ID15A, ID16A, ID16B, ID19

BuildProjectionsGallery#

Identifier:
ewokstomo.tasks.buildgallery.BuildProjectionsGallery
Task type:
class
Inputs:
nx_path* : str

Path to the input NX file.

reduced_darks_path* : str

Path to the reduced dark frames HDF5 file.

reduced_flats_path* : str

Path to the reduced flat frames HDF5 file.

bounds : tuple[float, float] | None= None

Intensity bounds (min, max) for image normalization. If not provided, robust defaults are computed automatically.

angle_step : float= 90.0

Angular step in degrees for selecting projections to include in the gallery.

output_format : Literal['jpg', 'png', 'jpeg', 'webp']= jpg

Image format for gallery images (e.g., ‘jpg’, ‘png’).

overwrite : bool= True

Whether to overwrite existing gallery images.

image_size : int= 1000

Maximum size (in pixels) for the largest dimension of gallery images. Images larger than this will be downsampled.

Outputs:
processed_data_dir : str

Directory containing the processed data.

gallery_path : str

Path to the created gallery directory.

BuildSlicesGallery#

Create two gallery images from a reconstructed slice (full-size suffixed _large, and a 200x200 resized version). The large image is downsampled if needed so neither dimension exceeds the configured image_size (default 1000 px).

Identifier:
ewokstomo.tasks.buildgallery.BuildSlicesGallery
Task type:
class
Inputs:
reconstructed_slice_path* : str

Path to the reconstructed slice file.

bounds : tuple[float, float] | None= None

Intensity bounds (min, max) for image normalization. If not provided, robust defaults are computed automatically.

output_format : Literal['jpg', 'png', 'jpeg', 'webp']= jpg

Image format for gallery images (e.g., ‘jpg’, ‘png’).

overwrite : bool= True

Whether to overwrite existing gallery images.

image_size : int= 1000

Maximum size (in pixels) for the largest dimension of gallery images. Images larger than this will be downsampled.

Outputs:
processed_data_dir : str

Directory containing the processed data.

gallery_path : str

Path to the created gallery directory.

gallery_image_path : str

Path to the created gallery image.

BuildVolumeGallery#

Create gallery images from a reconstructed 3D volume.

For each axis (X, Y, Z), extract slices at 1/4, 2/4 and 3/4 of the volume extent and save them to the gallery directory.

Identifier:
ewokstomo.tasks.buildgallery.BuildVolumeGallery
Task type:
class
Inputs:
reconstructed_volume_path* : str

Path to the reconstructed 3D volume file.

bounds : tuple[float, float] | None= None

Intensity bounds (min, max) for image normalization. If not provided, robust defaults are computed automatically.

output_format : Literal['jpg', 'png', 'jpeg', 'webp']= jpg

Image format for gallery images (e.g., ‘jpg’, ‘png’).

overwrite : bool= True

Whether to overwrite existing gallery images.

image_size : int= 1000

Maximum size (in pixels) for the largest dimension of gallery images. Images larger than this will be downsampled.

Outputs:
processed_data_dir : str

Directory containing the processed data.

gallery_path : str

Path to the created gallery directory.

gallery_image_paths : list[str]

Paths to the created gallery images.

ConvertVolumeTo16Bit#

Task to convert volume to 16-bit format and save it to disk. The output file format is determined by the Nabu configuration dictionary provided as input. The task also removes the original 32-bit volume after conversion to save disk space.

Identifier:
ewokstomo.tasks.convert_volume.ConvertVolumeTo16Bit
Task type:
class
Inputs:
reconstructed_volume_path* : str

The file path to the reconstructed volume.

nabu_dict* : dict

The Nabu configuration dictionary used for reconstruction. Used to determine the output file format for the converted volume.

output_format : Literal['hdf5', 'tiff', 'edf', 'jp2']= tiff

The desired output file format for the converted volume. Supported formats include ‘hdf5’, ‘tiff’, ‘edf’, ‘jp2’.

Outputs:
converted_volume_path : str

The file path of the converted 16-bit volume.

BuildDataPortalMetadata#

(ESRF-only) Convert Nabu processing options into Data Portal metadata.

Identifier:
ewokstomo.tasks.dataportalupload.BuildDataPortalMetadata
Task type:
class
Inputs:
processing_options : dict[str, Any] | None= None

Nabu processing options dictionary to convert into Data Portal metadata.

Outputs:
dataportal_metadata : dict[str, Any]

Generated Data Portal metadata dictionary.

DataPortalUpload#

(ESRF-only) Upload a processed dataset folder to the Data Portal using pyicat_plus.

Identifier:
ewokstomo.tasks.dataportalupload.DataPortalUpload
Task type:
class
Inputs:
process_folder_path* : str

Path to the processed dataset folder to upload.

metadata : dict[str, Any] | None= None

Optional metadata dictionary to include in the upload.

dry_run : bool= False

If True, simulate the upload without performing it.

dataset : str | None= None

Optional dataset name to use for the upload.

ComputeBMSpectrum#

Compute a bending-magnet (BM) spectrum using XOPPY’s xoppy_calc_bm.

Inputs (units):

  • TYPE_CALC (int): must be 0.

  • VER_DIV (int): vertical divergence model, {0, 2}.

  • MACHINE_NAME (str), RB_CHOICE (int), MACHINE_R_M (m).

  • BFIELD_T (T), BEAM_ENERGY_GEV (GeV), CURRENT_A (A), HOR_DIV_MRAD (mrad).

  • PHOT_ENERGY_MIN / PHOT_ENERGY_MAX (eV), NPOINTS (int), LOG_CHOICE (0/1).

  • PSI_* (mrad) and PSI_NPOINTS (int), FILE_DUMP (bool).

Outputs:

  • energy_eV (eV), sorted ascending.

  • flux (phot/s/0.1%bw) as returned by XOPPY.

  • spectral_power (W/eV).

  • cumulated_power (W).

Identifier:
ewokstomo.tasks.energycalculation.ComputeBMSpectrum
Task type:
class
Inputs:
BEAM_ENERGY_GEV*
BFIELD_T*
CURRENT_A*
FILE_DUMP*
HOR_DIV_MRAD*
LOG_CHOICE*
MACHINE_NAME*
MACHINE_R_M*
NPOINTS*
PHOT_ENERGY_MAX*
PHOT_ENERGY_MIN*
PSI_MAX*
PSI_MIN*
PSI_MRAD_PLOT*
PSI_NPOINTS*
RB_CHOICE*
TYPE_CALC*
VER_DIV*
Outputs:
cumulated_power
energy_eV
flux
spectral_power

ComputeWigglerSpectrum#

Compute a wiggler spectrum on an aperture using xoppy_calc_wiggler_on_aperture.

Inputs (units):

  • PHOT_ENERGY_MIN / PHOT_ENERGY_MAX (eV), NPOINTS (int).

  • ENERGY (GeV), CURRENT (mA).

  • FIELD, NPERIODS (int), ULAMBDA (m), K (–), NTRAJPOINTS (int), FILE (str).

  • SLIT_*: distances in m/mm per name; flags as ints.

  • SHIFT_X_VALUE (m), SHIFT_BETAX_VALUE (rad).

  • TRAJ_RESAMPLING_FACTOR, SLIT_POINTS_FACTOR (floats), LOG_CHOICE (0/1).

Outputs:

  • energy_eV (eV), sorted ascending.

  • flux (phot/s/0.1%bw) as returned by XOPPY.

  • spectral_power (W/eV).

  • cumulated_power (W).

Identifier:
ewokstomo.tasks.energycalculation.ComputeWigglerSpectrum
Task type:
class
Inputs:
CURRENT*
ENERGY*
FIELD*
FILE*
K*
LOG_CHOICE*
NPERIODS*
NPOINTS*
NTRAJPOINTS*
PHOT_ENERGY_MAX*
PHOT_ENERGY_MIN*
SHIFT_BETAX_FLAG*
SHIFT_BETAX_VALUE*
SHIFT_X_FLAG*
SHIFT_X_VALUE*
SLIT_CENTER_H_MM*
SLIT_CENTER_V_MM*
SLIT_D*
SLIT_FLAG*
SLIT_HEIGHT_V_MM*
SLIT_NY*
SLIT_POINTS_FACTOR*
SLIT_WIDTH_H_MM*
TRAJ_RESAMPLING_FACTOR*
ULAMBDA*
Outputs:
cumulated_power
energy_eV
flux
spectral_power

ApplyAttenuators#

Apply a stack of attenuators to the source spectrum (and optionally flux).

Inputs

energy_eV : numpy.ndarray Photon energy grid in electron-volts. spectral_power : numpy.ndarray Power spectrum (W/eV). attenuators : dict[str, dict] Mapping where each value contains material, thickness_mm and optional density_g_cm3. material accepts element symbols (e.g. "Al"), NIST aliases (e.g. "kapton") or chemical formulae parsable by :mod:xraylib. order : list[str], optional Explicit stacking order of the attenuator keys. Defaults to the dictionary insertion order. flux : numpy.ndarray, optional Source flux array (phot/s/0.1%bw) matching energy_eV.

Outputs

energy_eV : numpy.ndarray Same energy grid passed through. transmission : numpy.ndarray Cumulative transmission of the attenuator stack. attenuated_spectral_power : numpy.ndarray spectral_power multiplied by transmission. attenuated_flux : numpy.ndarray | None flux multiplied by transmission when provided, otherwise None.

Identifier:
ewokstomo.tasks.energycalculation.ApplyAttenuators
Task type:
class
Inputs:
attenuators*
energy_eV*
spectral_power*
flux
order
Outputs:
attenuated_flux
attenuated_spectral_power
energy_eV
transmission

SpectrumStats#

Stats on an attenuated spectrum.

Inputs

  • energy_eV: array-like (eV)

  • attenuated_flux : array-like (ph/s/0.1%bw)

Outputs

  • mean_energy_eV: Flux-weighted mean using bin weights: weights = flux * ΔE / (0.001 * E).

  • mean_idx (int): Index of energy_eV closest to mean_energy_eV (−1 if N/A).

  • pic_energy_eV: energy at which flux * ΔE / (0.001 * E) is maximal (NaN if N/A).

  • pic_idx (int): Index of that maximum (−1 if N/A).

Identifier:
ewokstomo.tasks.energycalculation.SpectrumStats
Task type:
class
Inputs:
attenuated_flux*
energy_eV*
Outputs:
mean_energy_eV
mean_idx
pic_energy_eV
pic_idx

LinkSlices#

Create ESRF tomo symlinks for a reconstructed slice in SLICES directories.

Identifier:
ewokstomo.tasks.linkresults.LinkSlices
Task type:
class
Inputs:
reconstructed_slice_path* : str

Path to the reconstructed slice file.

overwrite : bool= True

Whether to overwrite existing symlinks if present.

Outputs:
reconstructed_slice_path : str

Original reconstructed slice path (pass-through).

slices_link_collection_file : str | None

Symlink path under PROCESSED_DATA//SLICES, if created.

slices_link_root_file : str | None

Symlink path under PROCESSED_DATA/SLICES, if created.

LinkVolumes#

Create ESRF tomo symlinks for a reconstructed volume in VOLUMES directories.

Identifier:
ewokstomo.tasks.linkresults.LinkVolumes
Task type:
class
Inputs:
reconstructed_volume_path* : str

Path to the reconstructed or converted volume file.

overwrite : bool= True

Whether to overwrite existing symlinks if present.

Outputs:
reconstructed_volume_path : str

Original reconstructed volume path (pass-through).

volumes_link_collection_file : str | None

Symlink path under PROCESSED_DATA//VOLUMES, if created.

volumes_link_root_file : str | None

Symlink path under PROCESSED_DATA/VOLUMES, if created.

H5ToNx#

Identifier:
ewokstomo.tasks.nxtomomill.H5ToNx
Task type:
class
Inputs:
bliss_hdf5_path* : str

Path to the Bliss-produced raw scan (.h5).

nx_path* : str

Target path for the generated .nx file (parent dir created).

Outputs:
nx_path : str

Path to the created .nx file.

FluoToNx#

Identifier:
ewokstomo.tasks.nxtomomill.FluoToNx
Task type:
class
Inputs:
bliss_hdf5_path* : str

Path to the Bliss-produced raw XRFCT scan (.h5).

nx_path* : str

Target path for the generated .nx file (parent dir created).

Outputs:
nx_path : str

Path to the created .nx file.

ReconstructSlice#

Identifier:
ewokstomo.tasks.reconstruct_slice.ReconstructSlice
Task type:
class
Inputs:
nx_path* : str

Path to the input NX file.

config_dict* : dict[str, Any]

Configuration dictionary for Nabu. Must include at least “dataset” -> “location”, pointing to the input NX file.(see https://www.silx.org/pub/nabu/doc/nabu_config_items.html)

slice_index : int | Literal['first', 'middle', 'last']= middle

Index of the slice to reconstruct. Accepts an integer or one of the fixed strings: “first”, “middle”, “last”.

Outputs:
reconstructed_slice_path : str

Path to the saved reconstructed slice.

slice_index : int

Index of the reconstructed slice.

nabu_dict : dict

Nabu configuration dictionary used for reconstruction.

processing_options : dict

Resolved Nabu processing options used by ProcessConfig.

ReconstructVolume#

Identifier:
ewokstomo.tasks.reconstruct_volume.ReconstructVolume
Task type:
class
Inputs:
nx_path* : pathlib.Path

Path to the input NX file containing the tomography data.

config_dict* : dict

A dictionary containing parameters used to override Nabu’s default configuration. Must include at least ‘dataset’ -> ‘location’, pointing to the input NX file. (see https://www.silx.org/pub/nabu/doc/nabu_config_items.html)

slice_index_range : tuple[int, int] | None= None

Optional tuple specifying the (start, end) indices of slices to reconstruct. If not provided, the entire volume will be reconstructed.

Outputs:
reconstructed_volume_path : str

The file path to the saved reconstructed volume.

nabu_dict : dict

The Nabu configuration dictionary used for reconstruction.

processing_options : dict

The resolved Nabu processing options used by ProcessConfig.

ReduceDarkFlat#

Identifier:
ewokstomo.tasks.reducedarkflat.ReduceDarkFlat
Task type:
class
Inputs:
nx_path* : str

Path to the input NX file.

dark_reduction_method : str= mean

Method to reduce dark frames (‘mean’ or ‘median’).

flat_reduction_method : str= median

Method to reduce flat frames (‘mean’ or ‘median’).

overwrite : bool= True

Whether to overwrite existing reduced files.

output_dtype : type= <class 'numpy.float32'>

Data type for the output reduced frames.

return_info : bool= False

Whether to return additional info from reduction.

reference_dir_to_soft_link : str | None= None

Directory from which the reduced darks and flats will be linked. If provided, reduction is skipped.

Outputs:
reduced_darks_path : str

Path to the reduced dark frames file.

reduced_flats_path : str

Path to the reduced flat frames file.

TomoBasicToNXtomo#

Build a NXtomo file directly from explicit inputs (no HDF5 reads).

Units expected (raw numbers):

  • energy_kev: keV

  • detector_x_pixel_size_um, detector_y_pixel_size_um: micrometer

  • sample_x_pixel_size_um, sample_y_pixel_size_um: micrometer

  • sample_detector_distance_mm, source_sample_distance_mm, propagation_distance_mm: mm

  • count_time_s: s

  • rotation_angle_deg: degree

  • x_translation_mm, y_translation_mm, z_translation_mm: mm

  • current_a: ampere

Detector flips are described by raw Bliss detector_data_axes metadata in (ud, lr) order, e.g. ["-z", "y"] means no flip.

Identifier:
ewokstomo.tasks.tomobasictonxtomo.TomoBasicToNXtomo
Task type:
class
Inputs:
detector_data_dtype*
detector_data_file_paths*
detector_data_h5_url*
detector_data_shapes*
image_key_control*
nx_path*
rotation_angle_deg*
sample_name*
count_time_s
current_a
detector_data_axes
detector_x_pixel_size_um
detector_y_pixel_size_um
end_time
energy_kev
estimated_cor
field_of_view
group_size
instrument_name
propagation_distance_mm
sample_detector_distance_mm
sample_x_pixel_size_um
sample_y_pixel_size_um
sequence_number
source_sample_distance_mm
start_time
title
x_translation_mm
y_translation_mm
z_translation_mm
Outputs:
nx_path

SumTask#

Add two numbers

Identifier:
ewoksxrdct.tasks.sumtask.SumTask
Task type:
class
Inputs:
a*
b
delay
Outputs:
result

SumTask1#

Add two numbers

Identifier:
ewoksxrdct.tasks.sumtask.SumTask1
Task type:
class
Inputs:
a*
b
delay
Outputs:
result

SumTask2#

Add two numbers

Identifier:
ewoksxrdct.tasks.sumtask.SumTask2
Task type:
class
Inputs:
a*
b
delay
Outputs:
result

FutureSupervisorTask#

Task used to wait for a ‘FutureTomwerObject’ and convert it to original instance of:

  • TomwerScanBase (data): if the FutureTomwerObject is based on a scan instance

  • TomwerVolumeBase (volume): if the FutureTomwerObject is based on a volume instance

  • tuple of IcatReconstructedVolumeDataset (data_portal_processed_datasets): if the FutureTomwerObject is based on a volume instance

Identifier:
tomwer.tasks.cluster.supervisor.FutureSupervisorTask
Task type:
class
Inputs:
process_id : int | None= None

Process id to provide advancement progress about the workflow

future_tomo_obj* : tomwer.core.futureobject.FutureTomwerObject
Outputs:
data : tomwer.core.scan.scanbase.TomwerScanBase | None
volume : tomwer.core.volume.volumebase.TomwerVolumeBase | None
data_portal_processed_datasets : tuple[tomwer.core.drac.dracbase.DracDatasetBase, ...]

FileNameFilterTask#

Task to filter a scan according to his name and a ‘unix file name pattern’ or a ‘regular expression’

Identifier:
tomwer.tasks.conditions.filters.FileNameFilterTask
Task type:
class
Inputs:
process_id : int | None= None

Process id to provide advancement progress about the workflow

data* : tomwer.core.scan.scanbase.TomwerScanBase
pattern* : str
invert_result : bool= False

If True invert filtering result

filter_type : Literal['unix file name pattern', 'regular expression']= unix file name pattern
Outputs:
data : tomwer.core.scan.scanbase.TomwerScanBase

TomoEmailTask#

Dedicated task for tomography and gui approach

Identifier:
tomwer.tasks.control.emailnotifier.TomoEmailTask
Task type:
class
Inputs:
configuration*
tomo_obj*
Outputs:
tomo_obj

ConcatenateNXtomoTask#

Task used to concatenate a list of NXtomo (NXtomoScan) into a single NXtomo

Identifier:
tomwer.tasks.control.nxtomoconcatenate.ConcatenateNXtomoTask
Task type:
class
Inputs:
output_entry*
output_file*
overwrite*
series*
progress
Outputs:
data

H5ToNxProcess#

Task to convert from a bliss dataset to a nexus compliant dataset

Identifier:
tomwer.tasks.control.nxtomomill.H5ToNxProcess
Task type:
class
Inputs:
h5_to_nx_configuration*
bliss_scan
progress
Outputs:
data
series

EDFToNxProcess#

Task calling edf2nx in order to insure conversion from .edf to .nx (create one NXtomo to be used elsewhere)

Identifier:
tomwer.tasks.control.nxtomomill.EDFToNxProcess
Task type:
class
Inputs:
edf_to_nx_configuration*
edf_scan
progress
Outputs:
data

ScanSelectorPlaceHolder#

task to select one or several scan / data to be processed

Identifier:
tomwer.tasks.control.scanselector.ScanSelectorPlaceHolder
Task type:
class
Inputs:
data* : tomwer.core.scan.scanbase.TomwerScanBase
Outputs:
data : tomwer.core.scan.scanbase.TomwerScanBase

SingleTomoObjProcess#

For now data can only be a single element and not a list. This must be looked at. Also when part of an ewoks graph ‘data’ is mandatory which is not the class when part of a orange workflow. Those can be added interactively

Identifier:
tomwer.tasks.control.singletomoobj.SingleTomoObjProcess
Task type:
class
Inputs:
tomo_obj* : tomwer.core.tomwer_object.TomwerObject
Outputs:
tomo_obj : tomwer.core.tomwer_object.TomwerObject
reduced_darks : tomwer.models.reconstruction.reduced_frames.ReducedFrames | None
reduced_flats : tomwer.models.reconstruction.reduced_frames.ReducedFrames | None

PublishICatDatasetTask#

publish a list of DracDatasetBase instances.

DracDatasetBase provide API to retrieve data and metadata to be publish

input field:

  • data_portal_processed_datasets: list of ‘DracDatasetBase’ instances.

  • beamline: name of the beamline (bm05, id19…)

  • proposal: proposal name

Identifier:
tomwer.tasks.dataportal.publish.PublishICatDatasetTask
Task type:
class
Inputs:
process_id : int | None= None

Process id to provide advancement progress about the workflow

data_portal_processed_datasets* : tuple[tomwer.core.drac.dracbase.DracDatasetBase, ...]

processed dataset to be published

beamline : str | None= None

Beamline producing the dataset. If not provided will be deduced from ‘’data_portal_processed_datasets’.

proposal : str | None= None

proposal ID. If not provided will be deduced from ‘’data_portal_processed_datasets.

dataset : str | None= None

dataset name. If not provided will be deduced from ‘’data_portal_processed_datasets.

dry_run : bool= False

DarkFlatPatchTask#

Patch an existing NXtomo calling nxtomomill

Identifier:
tomwer.tasks.edit.darkflatpatch.DarkFlatPatchTask
Task type:
class
Inputs:
process_id : int | None= None

Process id to provide advancement progress about the workflow

data* : tomwer.core.scan.scanbase.TomwerScanBase
configuration* : dict
Outputs:
data : tomwer.core.scan.scanbase.TomwerScanBase

ImageKeyUpgraderTask#

close to ImageKeyEditor but convert a full “family” of frame type to another like all projections to dark field

Identifier:
tomwer.tasks.edit.imagekey_upgrader.ImageKeyUpgraderTask
Task type:
class
Inputs:
process_id : int | None= None

Process id to provide advancement progress about the workflow

data* : tomwer.core.scan.scanbase.TomwerScanBase
operations* : dict
Outputs:
data : tomwer.core.scan.scanbase.TomwerScanBase

ImageKeyEditorTask#

task to edit image_key field of a NXtomo (‘data’ input)

Identifier:
tomwer.tasks.edit.imagekeyeditor.ImageKeyEditorTask
Task type:
class
Inputs:
process_id : int | None= None

Process id to provide advancement progress about the workflow

data* : tomwer.core.scan.scanbase.TomwerScanBase
configuration* : dict
Outputs:
data : tomwer.core.scan.scanbase.TomwerScanBase

NXtomoEditorTask#

task to edit a couple of field of a NXtomo

Identifier:
tomwer.tasks.edit.nxtomoeditor.NXtomoEditorTask
Task type:
class
Inputs:
configuration*
data*
Outputs:
data

CastVolumeTask#

This task cast a volume from one format / data type to another.

Identifier:
tomwer.tasks.reconstruction.castvolume.CastVolumeTask
Task type:
class
Inputs:
process_id : int | None= None

Process id to provide advancement progress about the workflow

volume : tomwer.core.volume.volumebase.TomwerVolumeBase | None= None

Volume to be cast. If not provided ‘data’ should be provided with reconstructed volume registered.

output_data_type : numpy.dtype | None= uint16

Output volume data type

output_file_format : tomwer.core.reconstruction.output.NabuOutputFileFormat | None= NabuOutputFileFormat.TIFF

Cast volume output format (hdf5, tiff…)

data : tomwer.core.scan.scanbase.TomwerScanBase | None= None

Parent scan of the volume

output_file_path : str | None= None

Output file path to the output volume.

output_dir : str | None= {volume_data_parent_folder}/cast_volume

Output folder to save the volume.

cluster_config : tomwer.models.cluster.slurm_cluster.SlurmClusterConfiguration | None= None

Configuration to be used if the job must be done remotely.

overwrite : bool= True

If the output volume exist already overwrite it.

remove_input_volume : bool= False

Delete input volume once the output volume is created.

compression_ratios : str | None= None

Compression ratios to apply during the casting process.

rescale_min_percentile : float | None= 0.1

Minimum percentile for rescaling, in the range [0, 100].

rescale_max_percentile : float | None= 99.9

Maximum percentile for rescaling, in the range [0, 100].

data_min : float | None= None

Minimum value for rescaling. If None, it will be calculated from the data.

data_max : float | None= None

Maximum value for rescaling. If None, it will be calculated from the data.

output_volume : tomwer.core.volume.volumebase.TomwerVolumeBase= None

Output volume. Can be given as an identifier. If not provided must be deductible from other optional inputs (output_dir…)

Outputs:
volume : tomwer.core.volume.volumebase.TomwerVolumeBase
future_tomo_obj : tomwer.core.futureobject.FutureTomwerObject | None
data_portal_processed_datasets : tuple[tomwer.core.drac.dracbase.DracDatasetBase, ...]
cast_volume : tomwer.core.volume.volumebase.TomwerVolumeBase

Result of the cast.

NabuSettingsTask#

Task to pass trough nabu reconstruction settings

Identifier:
tomwer.tasks.reconstruction.config.NabuSettingsTask
Task type:
class
Inputs:
nabu_params : dict= {}

Reconstruction settings for nabu

Outputs:
nabu_params : dict

Reconstruction settings for nabu

CopyReducedDarkFlatTask#

Copy reduced darks and flats to “data”. If reduced darks of flats exists we will overwrite them only if ‘overwrite’ is True

Identifier:
tomwer.tasks.reconstruction.copydarkflat.CopyReducedDarkFlatTask
Task type:
class
Inputs:
data* : tomwer.core.scan.scanbase.TomwerScanBase
process_id : int | None= None

Process id to provide advancement progress about the workflow

reduced_darks : tomwer.models.reconstruction.reduced_frames.ReducedFrames | None= None

Reduced darks frames

reduced_flats : tomwer.models.reconstruction.reduced_frames.ReducedFrames | None= None

Reduced flats frames

copy_darks : bool= True
copy_flats : bool= True
force_copy : bool= False
Outputs:
data : tomwer.core.scan.scanbase.TomwerScanBase

NabuVolumeTask#

Task to launch a ‘standard’ nabu reconstruction.

Identifier:
tomwer.tasks.reconstruction.nabuvolume.NabuVolumeTask
Task type:
class
Inputs:
process_id : int | None= None

Process id to provide advancement progress about the workflow

data* : tomwer.core.scan.scanbase.TomwerScanBase
nabu_params : dict= {'dataset': {'location': '', 'hdf5_entry': '', 'nexus_version': '', 'darks_flats_dir': '', 'binning': '1', 'binning_z': '1', 'projections_subsampling': '1', 'exclude_projections': '', 'overwrite_metadata': '', 'flip_lr': 'auto', 'flip_ud': 'auto'}, 'preproc': {'flatfield': '1', 'flatfield_loading_mode': 'load_if_present', 'flat_distortion_correction_enabled': '0', 'flat_distortion_params': "tile_size=100; interpolation_kind='linear'; padding_mode='edge'; correction_spike_threshold=None", 'normalize_srcurrent': '1', 'ccd_filter_enabled': '0', 'ccd_filter_threshold': '0.04', 'detector_distortion_correction': '', 'detector_distortion_correction_options': '', 'double_flatfield': '0', 'dff_sigma': '', 'take_logarithm': '1', 'log_min_clip': '1e-6', 'log_max_clip': '10.0', 'target_dark_mean': '', 'sino_normalization': '', 'sino_normalization_file': '', 'processes_file': '', 'sino_rings_correction': '', 'sino_rings_options': '', 'rotate_projections_center': '', 'tilt_correction': '', 'autotilt_options': ''}, 'phase': {'method': 'none', 'delta_beta': '100.0', 'material_formula': '', 'material_density': '', 'unsharp_coeff': '0', 'unsharp_sigma': '0', 'unsharp_method': 'gaussian', 'padding_type': 'edge', 'ctf_geometry': 'z1_v=None; z1_h=None; detec_pixel_size=None; magnification=True', 'ctf_advanced_params': 'length_scale=1e-5; lim1=1e-5; lim2=0.2; normalize_by_mean=True'}, 'reconstruction': {'method': 'FBP', 'implementation': '', 'angles_file': '', 'rotation_axis_position': 'sliding-window', 'cor_options': "side='from_file'", 'cor_slice': '', 'axis_correction_file': '', 'translation_movements_file': '', 'angle_offset': '0', 'fbp_filter_type': 'ramlak', 'fbp_filter_cutoff': '1.', 'source_sample_dist': '', 'sample_detector_dist': '', 'padding_type': 'edges', 'enable_halftomo': 'auto', 'clip_outer_circle': '0', 'outer_circle_value': '0', 'centered_axis': '1', 'hbp_reduction_steps': '2', 'hbp_legs': '4', 'crop_filtered_data': '1', 'start_x': '0', 'end_x': '-1', 'start_y': '0', 'end_y': '-1', 'start_z': '0', 'end_z': '-1', 'iterations': '200', 'regularization_weight': '0', 'expand_support_factor': '1', 'optim_algorithm': 'chambolle-pock', 'preconditioning_filter': '1', 'positivity_constraint': '1'}, 'output': {'location': '', 'file_prefix': '', 'file_format': 'hdf5', 'overwrite_results': '1', 'keep_existing_files': '0', 'tiff_single_file': '0', 'jpeg2000_compression_ratio': '', 'zarr_options': '', 'float_clip_values': ''}, 'postproc': {'output_histogram': '1', 'histogram_bins': '1000000'}, 'resources': {'method': 'local', 'workers': '1', 'gpus': '1', 'gpu_id': '', 'memory_fraction': '90%', 'num_threads': '100%'}, 'pipeline': {'save_steps': '', 'resume_from_step': '', 'ignore_checkpoint_config': '0', 'steps_file': '', 'processing_margin': '', 'verbosity': '2'}, 'about': {}}

Reconstruction settings to be provided to nabu.

cluster_config : tomwer.models.cluster.slurm_cluster.SlurmClusterConfiguration | None= None

Configuration to be used if the job must be done remotely.

dry_run : bool= False

If True no reconstruction will be triggered but nabu config file will be generated.

output_dir : str= {scan_working_directory}/reconstructed_volumes

Output folder to save the volume.

Outputs:
data : tomwer.core.scan.scanbase.TomwerScanBase
volume : tomwer.core.volume.volumebase.TomwerVolumeBase | None

Reconstructed volume.

future_tomo_obj : tomwer.core.futureobject.FutureTomwerObject | None
data_portal_processed_datasets : tuple[tomwer.core.drac.dracbase.DracDatasetBase, ...]

ReduceDarkFlatTask#

Compute reduced darks and flats from raw frames.

This is simply calling numpy.method or picking a single frame of the stack.

.. warning:: If the darks or the flat is not computing then reduced_darks or reduced_flats will be None

Identifier:
tomwer.tasks.reconstruction.reducedarkflat.ReduceDarkFlatTask
Task type:
class
Inputs:
data* : tomwer.core.scan.scanbase.TomwerScanBase
process_id : int | None= None

Process id to provide advancement progress about the workflow

dark_method : tomoscan.framereducer.method.ReduceMethod= ReduceMethod.MEAN

Method to use to compute the reduced of dark

flat_method : tomoscan.framereducer.method.ReduceMethod= ReduceMethod.MEDIAN

Method to use to compute the reduced of flat

force : bool= False

Force recalculation of the reduced frames even if already existing

remove_raw_edf : bool= False

Remove raw spec- edf if succeed

edf_spec_flat_pattern : str= ref*.*[0-9]{3,4}_[0-9]{3,4}

Pattern to be used to compute reduce darks and flats for spec-EDF

edf_spec_dark_pattern : str= darkend[0-9]{3,4}

Pattern to be used to compute reduce darks and flats for spec-EDF

Outputs:
data : tomwer.core.scan.scanbase.TomwerScanBase
reduced_darks : tomwer.models.reconstruction.reduced_frames.ReducedFrames | None
reduced_flats : tomwer.models.reconstruction.reduced_frames.ReducedFrames | None

NabuSlicesTask#

Task to reconstruct a set of slices.

Identifier:
tomwer.tasks.reconstruction.slices.NabuSlicesTask
Task type:
class
Inputs:
process_id : int | None= None

Process id to provide advancement progress about the workflow

data* : tomwer.core.scan.scanbase.TomwerScanBase
slices : dict[tomwer.core.reconstruction.common.plane.NabuPlane, str | int | tuple[int | str, ...]]= {'XY': 'middle'}

slices to be reconstructed. Expected to be provided as a dict with the following keys:

  • ‘YZ’: slices to be reconstructed along the X axis

  • ‘XZ’: slices to be reconstructed along the Y axis

  • ‘XY’: slices to be reconstructed along the Z axis

.. warning:: reconstruction speed is expected to be wildly different according to the reconstruction plane. XY is expected to be the fastest and YZ the slowest (reconstructing a single slice can take as much time as reconstructing the full volume in the worst case)

Examples:
  • {'XY': 2}
  • {'XZ': '100:500:100'}
  • {'YZ': (20, 70)}
  • {'XY': 'middle'}
nabu_params* : dict | None

nabu reconstruction parameters and nabu configuration file <https://tomotools.gitlab-pages.esrf.fr/nabu/nabu_config_file.html#configuration-file>_

cluster_config : tomwer.models.cluster.slurm_cluster.SlurmClusterConfiguration | None= None

Configuration to be used if the job must be done remotely.

dry_run : bool= False

If true we will only create the nabu configuration file but not reconstruction will be launched.

invalid_slice_callback : collections.abc.Callable | None= None

Callable to be executed to notify user in case provided slice(s) is invalid (out of bounds).

output_dir : str= {scan_working_directory}/reconstructed_slices

Output folder to save the volume.

Outputs:
data : tomwer.core.scan.scanbase.TomwerScanBase
future_tomo_obj : tomwer.core.futureobject.FutureTomwerObject | None
nabu_params : dict | None

PythonScript#

Identifier:
tomwer.tasks.script.python.PythonScript
Task type:
class
Inputs:
scriptText*
data
process_id
volume
Outputs:
data
volume

StitcherTask#

Identifier:
tomwer.tasks.stitching.nabustitcher.StitcherTask
Task type:
class
Inputs:
stitching_config*
cluster_config
process_id
progress
Outputs:
data
future_tomo_obj
volume

VolumeViewerTask#

Function loading a three slices into each direction and volume metadata and create a ‘summary’ of the reconstructed volume

Identifier:
tomwer.tasks.visualization.volume_viewer.VolumeViewerTask
Task type:
class
Inputs:
volume* : tomwer.core.volume.volumebase.TomwerVolumeBase | str | None
load_volume : bool= False

If True load the full volume in memory. Mostly used for GUI. In this case it allows user to browse through the entire volume. Can also speed up extraction of slice.

Outputs:
loaded_volume
slices
volume_metadata
volume_shape

Additional models#

ReducedFrames#

Fields:
data : dict[int, numpy.ndarray] | None= None

Reduced frame with index as key and numpy.ndarray as value

metadata* : tomwer.models.reconstruction.reduced_frames.ReducedFramesInfos | None
url* : silx.io.url.DataUrl | None

ReducedFramesInfos#

Fields:
count_time : tuple[float, ...]= ()
machine_current : tuple[float, ...]= ()
lr_flip : bool | None= None
ud_flip : bool | None= None

SlurmClusterConfiguration#

Fields:
n_cpu_per_task : int= 16
n_tasks : int= 1
memory : str | int= 128
queue : str= gpu
n_gpus : int= 1
project_name : str= tomwer_{scan}_-_{process}_-_{info}
walltime : str= 01:00:00
python_venv : str | None= None

expected to be used for debug only. Prefer using modules when possible.

n_jobs : int= 1
modules_to_load : Tuple[str, ...]= ('tomotools/stable',)
act_as_login_shell : bool= False
sbatch_extra_params : dict[str, str | int | None]= {'export': 'ALL'}
port_range : Tuple[int, int, int] | None= None
dashboard_port : int | None= None

ReducedFrames#

Fields:
data : dict[int, numpy.ndarray] | None= None

Reduced frame with index as key and numpy.ndarray as value

metadata* : tomwer.models.reconstruction.reduced_frames.ReducedFramesInfos | None
url* : silx.io.url.DataUrl | None

ReducedFramesInfos#

Fields:
count_time : tuple[float, ...]= ()
machine_current : tuple[float, ...]= ()
lr_flip : bool | None= None
ud_flip : bool | None= None

SlurmClusterConfiguration#

Fields:
n_cpu_per_task : int= 16
n_tasks : int= 1
memory : str | int= 128
queue : str= gpu
n_gpus : int= 1
project_name : str= tomwer_{scan}_-_{process}_-_{info}
walltime : str= 01:00:00
python_venv : str | None= None

expected to be used for debug only. Prefer using modules when possible.

n_jobs : int= 1
modules_to_load : Tuple[str, ...]= ('tomotools/stable',)
act_as_login_shell : bool= False
sbatch_extra_params : dict[str, str | int | None]= {'export': 'ALL'}
port_range : Tuple[int, int, int] | None= None
dashboard_port : int | None= None

ReducedFrames#

Fields:
data : dict[int, numpy.ndarray] | None= None

Reduced frame with index as key and numpy.ndarray as value

metadata* : tomwer.models.reconstruction.reduced_frames.ReducedFramesInfos | None
url* : silx.io.url.DataUrl | None

ReducedFramesInfos#

Fields:
count_time : tuple[float, ...]= ()
machine_current : tuple[float, ...]= ()
lr_flip : bool | None= None
ud_flip : bool | None= None

SlurmClusterConfiguration#

Fields:
n_cpu_per_task : int= 16
n_tasks : int= 1
memory : str | int= 128
queue : str= gpu
n_gpus : int= 1
project_name : str= tomwer_{scan}_-_{process}_-_{info}
walltime : str= 01:00:00
python_venv : str | None= None

expected to be used for debug only. Prefer using modules when possible.

n_jobs : int= 1
modules_to_load : Tuple[str, ...]= ('tomotools/stable',)
act_as_login_shell : bool= False
sbatch_extra_params : dict[str, str | int | None]= {'export': 'ALL'}
port_range : Tuple[int, int, int] | None= None
dashboard_port : int | None= None