Skip to content

Darks/Flats handling: no more DataUrls

Pierre Paleo requested to merge dkrf_reader into master

About

This MR simplifies how darks/flats are handled within nabu, following-up !430 (merged), !439 (merged) and !451 (merged)

For the record: up to now, nabu relied on mechanisms around DataUrl provided by tomoscan. This made many things cumbersome (get_compacted_data_slices, FlatFieldDataUrls, and so on).

Close #536 (closed)

To do

  • Implement DKRFReader
  • Unit tests
  • (Bonus) Make data_path optional in NXTomoReader (take first entry by default)
  • Simplify update_dataset_info_flats_darks, return arrays rather than DataUrls
  • Get rid of FlatFieldDataUrl in chunked.py and chunked_cuda.py
  • Deprecate ChunkReader, ChunkReaderHelical and remove associated tests
  • Simplify test_flatfield, get rid of FlatFieldDataUrl
  • Get rid of FlatFieldDataUrl in nabu/pipeline/estimators
  • Get rid of FlatFieldDataUrl in DoubleFlatField
    • Make sure nabu-double-flatfield CLI still works
  • Update changelog/documentation
  • End-to-end reconstruction tests
    • NX pipeline
    • NX pipeline with x binning
    • NX pipeline with x and/or z binning
    • NX pipeline with angular subsampling and/or exclude projs and/or binning
    • edf pipeline
    • edf pipeline with x binning
    • edf pipeline with x and/or z binning
    • edf pipeline with angular subsampling and/or exclude projs and/or binning

Notes

In a simple world, getting the final darks/flats would be as simple as

    def get_reduced_flats(self, method="median", force_reload=False, **reader_kwargs):
        dkrf_reader = NXDarksFlats(
            self.dataset_hdf5_url.file_path(), data_path=self.dataset_hdf5_url.data_path(), **reader_kwargs
        )
        return dkrf_reader.get_reduced_flats(method=method, force_reload=force_reload, as_dict=True)

However we have to deal with

  • scans where custom darks/flats are inserted to be used instead of the one acquired
  • EDF legacy format
Edited by Pierre Paleo

Merge request reports