Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: add 3d image support to StreamingManager and PipelineMemoryPrint… #28

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

heralex
Copy link

@heralex heralex commented Mar 9, 2021

…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.

@Julien-Osman
Copy link
Contributor

Dear @heralex, thank you for your contribution!

I copied your Pull Request in our forge, the unit tests are now running.

Sincerely. Julien.

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