Skip to content

nabu.stitching.stitcher.dumper.postprocessing

source module nabu.stitching.stitcher.dumper.postprocessing

Classes

  • OutputVolumeContext Utils class to Manage the data volume creation and save it (data only !). target: used for volume stitching In the case of HDF5 we want to save this directly in the file to avoid keeping the full volume in memory. Insure also contain processing will be common between the different processing

  • OutputVolumeNoDDContext Dedicated output volume context for saving a volume without Data Duplication (DD)

  • PostProcessingStitchingDumper dumper to be used when save data during post-processing stitching (on reconstructed volume). Output is expected to be an NXtomo

  • PostProcessingStitchingDumperWithCache PostProcessingStitchingDumper with intermediate cache in order to speed up writting. The cache is save to disk when full or when closing the dumper. Mostly convenient for HDF5

  • PostProcessingStitchingDumperNoDD same as PostProcessingStitchingDumper but prevent to do data duplication. In this case we need to work on HDF5 file only

source class OutputVolumeContext(volume: VolumeBase, volume_shape: tuple, dtype: numpy.dtype, dumper)

Bases : AbstractContextManager

Utils class to Manage the data volume creation and save it (data only !). target: used for volume stitching In the case of HDF5 we want to save this directly in the file to avoid keeping the full volume in memory. Insure also contain processing will be common between the different processing

If stitching_sources_arr_shapes is provided this mean that we want to create stitching region and then create a VDS to avoid data duplication

source class OutputVolumeNoDDContext(volume: VolumeBase, volume_shape: tuple, dtype: numpy.dtype, dumper, stitching_sources_arr_shapes: Optional[tuple])

Bases : OutputVolumeContext

Dedicated output volume context for saving a volume without Data Duplication (DD)

source class PostProcessingStitchingDumper(configuration)

Bases : DumperBase

dumper to be used when save data during post-processing stitching (on reconstructed volume). Output is expected to be an NXtomo

Methods

source method PostProcessingStitchingDumper.save_configuration()

source property PostProcessingStitchingDumper.output_identifier: VolumeIdentifier

source method PostProcessingStitchingDumper.create_output_dataset()

function called at the beginning of the stitching to prepare output dataset

source class PostProcessingStitchingDumperWithCache(configuration)

Bases : PostProcessingStitchingDumper

PostProcessingStitchingDumper with intermediate cache in order to speed up writting. The cache is save to disk when full or when closing the dumper. Mostly convenient for HDF5

Methods

source method PostProcessingStitchingDumperWithCache.init_cache(dump_axis, size, dtype)

Raises

  • ValueError

source method PostProcessingStitchingDumperWithCache.reset_cache()

source method PostProcessingStitchingDumperWithCache.set_final_volume_shape(shape)

source method PostProcessingStitchingDumperWithCache.save_stitched_frame(stitched_frame: numpy.ndarray, composition_cls: dict, i_frame: int, axis: int)

save the frame to the volume. In this use case save the frame to the buffer. Waiting to be dump later. We expect 'save_stitched_frame' to be called with contiguous frames (in the output volume space)

Raises

  • RuntimeError

source method PostProcessingStitchingDumperWithCache.dump_cache(nb_frames)

dump the first nb_frames to disk

Raises

  • RuntimeError

source class PostProcessingStitchingDumperNoDD(configuration)

Bases : PostProcessingStitchingDumper

same as PostProcessingStitchingDumper but prevent to do data duplication. In this case we need to work on HDF5 file only

Attributes

  • stitching_regions_hdf5_dataset : Optional[tuple] hdf5 dataset storing the stitched regions

  • raw_regions_hdf5_dataset : Optional[tuple] hdf5 raw dataset

Methods

source method PostProcessingStitchingDumperNoDD.create_output_dataset()

function called at the beginning of the stitching to prepare output dataset

source staticmethod PostProcessingStitchingDumperNoDD.create_subset_selection(dataset: h5py.Dataset, slices: tuple)h5py.VirtualSource

source method PostProcessingStitchingDumperNoDD.output_dataset(dataset: Optional[h5py.VirtualLayout])

Raises

  • TypeError

source property PostProcessingStitchingDumperNoDD.stitching_regions_hdf5_dataset: Optional[tuple]

hdf5 dataset storing the stitched regions

source property PostProcessingStitchingDumperNoDD.raw_regions_hdf5_dataset: Optional[tuple]

hdf5 raw dataset

source method PostProcessingStitchingDumperNoDD.save_stitched_frame(stitched_frame: numpy.ndarray, composition_cls: dict, i_frame: int, axis: int)

Save the full stitched frame to disk

Raises

  • ValueError