nabu.stitching.config module¶
- class nabu.stitching.config.SlurmConfig(partition: str = '', mem: str = '128', n_jobs: int = 1, other_options: str = '', preprocessing_command: str = '', clean_script: bool = '', n_tasks: int = 1, n_cpu_per_task: int = 4)[source]¶
Bases:
object
configuration for slurm jobs
- partition: str = ''¶
- mem: str = '128'¶
- n_jobs: int = 1¶
- other_options: str = ''¶
- preprocessing_command: str = ''¶
- clean_script: bool = ''¶
- n_tasks: int = 1¶
- n_cpu_per_task: int = 4¶
- class nabu.stitching.config.StitchingType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
Enum
- Z_PREPROC = 'z-preproc'¶
- Z_POSTPROC = 'z-postproc'¶
- class nabu.stitching.config.StitchingConfiguration(axis_0_pos_px: tuple | str | None, axis_1_pos_px: tuple | str | None, axis_2_pos_px: tuple | str | None, axis_0_pos_mm: tuple | str | None = None, axis_1_pos_mm: tuple | str | None = None, axis_2_pos_mm: tuple | str | None = None, axis_0_params: dict = None, axis_1_params: dict = None, axis_2_params: dict = None, slurm_config: SlurmConfig = None, flip_lr: tuple | bool = False, flip_ud: tuple | bool = False, overwrite_results: bool = False, stitching_strategy: OverlapStitchingStrategy = OverlapStitchingStrategy.COSINUS_WEIGHTS, stitching_kernels_extra_params: dict = None, slice_for_cross_correlation: str | int = 'middle', rescale_frames: bool = False, rescale_params: dict = None)[source]¶
Bases:
object
bass class to define stitching configuration
- axis_0_pos_px: tuple | str | None¶
px
- Type:
position along axis 0 in absolute. unit
- axis_1_pos_px: tuple | str | None¶
px
- Type:
position along axis 1 in absolute. unit
- axis_2_pos_px: tuple | str | None¶
px
- Type:
position along axis 2 in absolute. unit
- axis_0_pos_mm: tuple | str | None = None¶
mm
- Type:
position along axis 0 in absolute. unit
- axis_1_pos_mm: tuple | str | None = None¶
mm
- Type:
position along axis 0 in absolute. unit
- axis_2_pos_mm: tuple | str | None = None¶
mm
- Type:
position along axis 0 in absolute. unit
- axis_0_params: dict = None¶
- axis_1_params: dict = None¶
- axis_2_params: dict = None¶
- slurm_config: SlurmConfig = None¶
- flip_lr: tuple | bool = False¶
flip frame left-right. For scan this will happen after possible flip of NXtomo metadata x_flipped field (also know as lr_flipped)
- flip_ud: tuple | bool = False¶
flip frame up-down. For scan this will happen after possible flip of NXtomo metadata y_flipped field (also know as ud_flipped)
- overwrite_results: bool = False¶
- stitching_strategy: OverlapStitchingStrategy = 'cosinus weights'¶
- stitching_kernels_extra_params: dict = None¶
- slice_for_cross_correlation: str | int = 'middle'¶
- rescale_frames: bool = False¶
- rescale_params: dict = None¶
- property stitching_type¶
- class nabu.stitching.config.ZStitchingConfiguration(axis_0_pos_px: tuple | str | None, axis_1_pos_px: tuple | str | None, axis_2_pos_px: tuple | str | None, axis_0_pos_mm: tuple | str | None = None, axis_1_pos_mm: tuple | str | None = None, axis_2_pos_mm: tuple | str | None = None, axis_0_params: dict = None, axis_1_params: dict = None, axis_2_params: dict = None, slurm_config: SlurmConfig = None, flip_lr: tuple | bool = False, flip_ud: tuple | bool = False, overwrite_results: bool = False, stitching_strategy: OverlapStitchingStrategy = OverlapStitchingStrategy.COSINUS_WEIGHTS, stitching_kernels_extra_params: dict = None, slice_for_cross_correlation: str | int = 'middle', rescale_frames: bool = False, rescale_params: dict = None, slices: slice | tuple | None = None)[source]¶
Bases:
StitchingConfiguration
base class to define z-stitching parameters
- slices: slice | tuple | None = None¶
- class nabu.stitching.config.PreProcessedZStitchingConfiguration(axis_0_pos_px: tuple | str | None, axis_1_pos_px: tuple | str | None, axis_2_pos_px: tuple | str | None, axis_0_pos_mm: tuple | str | None = None, axis_1_pos_mm: tuple | str | None = None, axis_2_pos_mm: tuple | str | None = None, axis_0_params: dict = None, axis_1_params: dict = None, axis_2_params: dict = None, slurm_config: SlurmConfig = None, flip_lr: tuple | bool = False, flip_ud: tuple | bool = False, overwrite_results: bool = False, stitching_strategy: OverlapStitchingStrategy = OverlapStitchingStrategy.COSINUS_WEIGHTS, stitching_kernels_extra_params: dict = None, slice_for_cross_correlation: str | int = 'middle', rescale_frames: bool = False, rescale_params: dict = None, slices: slice | tuple | None = None, input_scans: tuple = (), output_file_path: str = '', output_data_path: str = '', output_nexus_version: float | None = None, pixel_size: float | None = None)[source]¶
Bases:
ZStitchingConfiguration
base class to define z-stitching parameters
- input_scans: tuple = ()¶
- output_file_path: str = ''¶
- output_data_path: str = ''¶
- output_nexus_version: float | None = None¶
- pixel_size: float | None = None¶
- property stitching_type: StitchingType¶
- settle_slices() tuple [source]¶
interpret the slices to be stitched if needed
Nore: if slices is an instance of slice will redefine start and stop to avoid having negative indexes
- Returns:
(slices:[slice,Iterable], n_proj:int)
- Return type:
tuple
- class nabu.stitching.config.PostProcessedZStitchingConfiguration(axis_0_pos_px: tuple | str | None, axis_1_pos_px: tuple | str | None, axis_2_pos_px: tuple | str | None, axis_0_pos_mm: tuple | str | None = None, axis_1_pos_mm: tuple | str | None = None, axis_2_pos_mm: tuple | str | None = None, axis_0_params: dict = None, axis_1_params: dict = None, axis_2_params: dict = None, slurm_config: SlurmConfig = None, flip_lr: tuple | bool = False, flip_ud: tuple | bool = False, overwrite_results: bool = False, stitching_strategy: OverlapStitchingStrategy = OverlapStitchingStrategy.COSINUS_WEIGHTS, stitching_kernels_extra_params: dict = None, slice_for_cross_correlation: str | int = 'middle', rescale_frames: bool = False, rescale_params: dict = None, slices: slice | tuple | None = None, input_volumes: tuple = (), output_volume: VolumeIdentifier | None = None, voxel_size: float | None = None)[source]¶
Bases:
ZStitchingConfiguration
base class to define z-stitching parameters
- input_volumes: tuple = ()¶
- output_volume: VolumeIdentifier | None = None¶
- voxel_size: float | None = None¶
- property stitching_type: StitchingType¶
- settle_slices() tuple [source]¶
interpret the slices to be stitched if needed
Nore: if slices is an instance of slice will redefine start and stop to avoid having negative indexes
- Returns:
(slices:[slice,Iterable], n_proj:int)
- Return type:
tuple
- nabu.stitching.config.get_default_stitching_config(stitching_type: StitchingType | str | None) tuple [source]¶
Return a default configuration for doing stitching.
- Parameters:
stitching_type – if None then return a configuration were use can provide inputs for any of the stitching. Else return config dict dedicated to a particular stitching
- Returns:
(config, section comments)