pre-procesing stitching
It would be nice to be able to do some stitching from a configuration file defining NXtomo entries and some rules like: Can be even used for sinogram stitching and volume stitching ??? Might get some comparable code there...
[concatenation]
projections = entry0000@bamoo.nx, entry0001@bamoo.nx, entry0002@bamoo.nx
# could also be volumes ? volumes = ...
positions = (0, 0, 0); (0, 1000, 0); (1000, 0, 0)
scales = (1, 1, 1), (1, 1, 1), (1, 1, 1) # do we need to have scales ? I don't think so at this point
stitching_missing_rule = raise_error # could also be linear_interpolation (average with linear weight), sinusoidal_interpolation (average with sinusoidal weight), mean (average), closest (raw), less_divergent, kernel_size=5 # only used for the less divergent algorithm
stitching_overlap_rule = sinusoidal_interpolation # options are the same as for stitching_missing_rule I guess
kernel_size
max_overlap_size = (20, 30) # define maximal stitching area (where the stitching_overlap_rule will be applied)
compute_histogram = True
crop_raw = (10, 0) # we can ask to crop raw sinograms borders (edge effect)
output_dtype = uint16
Then on the processing part (nabu ? tomwer ? script ? Third part library ?) we could have:
scans = entry0000@bamoo.nx, entry0001@bamoo.nx, entry0002@bamoo.nx
stitching_missing_rule = raise_error
stitching_overlap_rule = mean
y_search_window = 10 # search window in slices. Y in sinogram space. Used to compute the positions to be provided to nxtomomill `nx-stitch`
x_search_window = 10 # search window in pixel. X in sinogram space. Used to compute the positions to be provided to nxtomomill `nx-stitch`
# z_search_window ?
crop_raw_data = (10, 0) # we can ask to crop raw sinograms borders (edge effect). Should this be 3D ?
rotation_axis_positions = 512, coarse-to-fine, centered # algorithm(s) or values to use to compute the center of rotation and move from 360 to 180 sinograms. One or x values can be provided. x == number of scans
motor_position_to_pixel_size_factor = 1 Might be need to get a raw estimation of the shift
output_dtype = uint16
What happen if we have more that two sinograms / volume for one pixel ? Should we handle this case ?
Best way to provide stitching ? Create a matrix with a mask saving the overlap areas and missing areas. If we want to use the same for volumes and sinograms I guess only axis should be provided. Instead of positions and scales maybe we could provide a link to 'homography' matrices somewhere ?
Questions
- Do we need more than rigid registration ?
- I don't think we want to do registration for each reconstructed slice / sinogram and each time. Do we do it one each XXX slices / sinogram and interpolate in between ?
- SimpleElastix: all the processing is done on CPU ?