Skip to content

Conversation

@yousefmoazzam
Copy link
Collaborator

Part of the work needed for IMGDA-517

Should be merged with the following PR in httomo-backends: DiamondLightSource/httomo-backends#90

Note that one exception for the feature working is the standard_tomo loader. If any of the required parameters representing paths in the data are omitted, then the check of the data paths within the data will itself run into an error when the omitted parameter is attempted to be checked for the auto value.

Addressing this edge case could be done by introducing a dependency between some of the checks being performed (ie, if the check of omitted parameter values not being required fails for the loader, then don't try to check the data paths in the loader). For the moment, introducing such a dependency between the checks likely adds complexity that isn't worth it, so has been left out.

Checklist

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have made corresponding changes to the documentation

Note that one exception is the `standard_tomo` loader. If any of the
required parameters representing paths in the data are omitted, then the
check of the data paths within the data will itself run into an error
when the omitted parameter is attempted to be checked for the `auto`
value.

Addressing this edge case could be done by introducing a dependency
between some of the checks being performed (ie, if the check of omitted
parameter values not being required fails for the loader, then don't try
to check the data paths in the loader). For the moment, introducing such
a dependency between the checks likely adds complexity that isn't worth
it, so has been left out.
@yousefmoazzam
Copy link
Collaborator Author

For some context, a pipeline that has the majority of parameters omitted such as the following:

- method: standard_tomo
  module_path: httomo.data.hdf.loaders
  parameters:
    data_path: auto
    image_key_path: auto
    rotation_angles: auto
- method: find_center_vo
  module_path: httomolibgpu.recon.rotation
  parameters: {}
  id: centering
  side_outputs:
    cor: centre_of_rotation
- method: remove_outlier
  module_path: httomolibgpu.misc.corr
  parameters: {}
- method: dark_flat_field_correction
  module_path: httomolibgpu.prep.normalize
  parameters: {}
- method: minus_log
  module_path: httomolibgpu.prep.normalize
  parameters: {}
- method: remove_stripe_based_sorting
  module_path: httomolibgpu.prep.stripe
  parameters: {}
- method: FBP3d_tomobar
  module_path: httomolibgpu.recon.algorithm
  parameters:
    center: ${{centering.side_outputs.centre_of_rotation}}
  save_result: true
- method: rescale_to_int
  module_path: httomolibgpu.misc.rescale
  parameters: {}
- method: save_to_images
  module_path: httomolib.misc.images
  parameters: {}

is able to pass the YAML checker:

(base) root@989bc514209d:/httomo# python -m httomo check tests/samples/pipeline_template_examples/pipeline_gpu1-omitted.yaml tests/test_data/tomo_standard.nxs
Checking that the YAML_CONFIG is properly indented and has valid mappings and tags...
Sanity check of the YAML_CONFIG was successfully done...

Checking that the first method in the pipeline is a loader...
Loader check successful!!

Checking that the paths to the data and keys in the YAML_CONFIG file match the paths and keys in the input file (IN_DATA)...
NXtomo discovered: /entry1/tomo_entry
Loader paths check successful!!

Validation of pipeline YAML file is successful.

and be executed by httomo:

(base) root@989bc514209d:/httomo# python -m httomo run tests/test_data/tomo_standard.nxs tests/samples/pipeline_template_examples/pipeline_gpu1-omitted.yaml output_dir/
Advisory: It is recommended to place find_center_vo after the dark/flat field correction
Pipeline has been separated into 2 sections
See the full log file at: output_dir/26-01-2026_15_05_36_output/user.log
Running loader (pattern=projection): standard_tomo...
    Finished loader: standard_tomo (httomo) Took 46.91ms
Section 0 (pattern=projection) with the following methods:
    data_reducer (httomolib)
    find_center_vo (httomolibgpu)
    remove_outlier (httomolibgpu)
    --- output check with data_checker --- (httomolibgpu)
    dark_flat_field_correction (httomolibgpu)
    --- output check with data_checker --- (httomolibgpu)
    minus_log (httomolibgpu)
    --- output check with data_checker --- (httomolibgpu)
     0%|          | 0/2 [00:00<?, ?block/s]
    50%|#####     | 1/2 [00:01<00:01,  1.77s/block]
    ---> The center of rotation is 79.5
    Finished processing last block
Slicing axis change (reslice) from projection to sinogram took 0.000006379s.
Section 1 (pattern=sinogram) with the following methods:
    remove_stripe_based_sorting (httomolibgpu)
    --- output check with data_checker --- (httomolibgpu)
    FBP3d_tomobar (httomolibgpu)
    save_intermediate_data (httomo)
    --- output check with data_checker --- (httomolibgpu)
    rescale_to_int (httomolibgpu)
    save_to_images (httomolib)
     0%|          | 0/1 [00:00<?, ?block/s]
    Finished processing last block
Pipeline finished. Took 3.614s

@yousefmoazzam yousefmoazzam marked this pull request as ready for review January 26, 2026 15:13
@yousefmoazzam yousefmoazzam requested a review from dkazanc January 26, 2026 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants