Skip to content

ENH: add 3d image support to StreamingManager and PipelineMemoryPrintCalculator

Julien Osman requested to merge 3D-streaming into develop

This Merge Request was open on GitHub and manually imported to GitLab.

…Calculator

Summary

Add nD image support to otbStreamingManager and 3D image support to PipelineMemoryPrintCalculator

Rationale

The StreamingManager class defines a small, i.e. 100 pixel, region around the image centre that is used to estimate the memory footprint of the processing pipeline. The current implementation only explicitly sets the index for dimensions 0 and 1 respectively. Since the index value assignment does not account for the actual number of dimensions of the image, a 1D image would produce a segmentation fault when the value of index[1] is assigned.

The PipelineMemoryPrintCalculator currently only supports 2D images. The number of image dimensions is currently hard coded in ::EvaluateDataObjectPrint in macro OTB_IMAGE_SIZE_BLOCK.

Implementation Details

otbStreamingManager.hxx
  • The assignment of index and size values of the test region is done considering the actual number of image dimensions.
  • smallRegion.Crop(region) is removed because it is superfluous with the new implementation.
otbPipelineMemoryPrintCalculator.cxx
  • I added a set of image memory print calculation statements for 3-dimensional images to the OTB_IMAGE_SIZE_BLOCK macro
  • Note: This revision will be performance neutral for 2D images but enables use of this class for 3D images. A future improvement of this class would be to template it over the image type to enable nD support.

Copyright

The copyright owner is Manaaki Whenua - Landcare Research (MWLR). MWLR has signed the ORFEO ToolBox Contributor License Agreement.


Check before merging:

  • All discussions are resolved
  • At least 2 👍 votes from core developers, no 👎 vote.
  • The feature branch is (reasonably) up-to-date with the base branch
  • Dashboard is green
  • Copyright owner has signed the ORFEO ToolBox Contributor License Agreement
  • Optionally, run git diff develop... -U0 --no-color | clang-format-diff.py -p1 -i on latest changes and commit

Merge request reports

Loading