ExtractingROI This example demonstrates how to use the
SbImageDataAccessor to access values of an image.
DESCRIPTION:
It is sometimes necessary to select a Region Of Interest (ROI) inside an image. This allows removing non relevant data or saving computation time during the validation step of a workflow.
-
This example shows how to load an image from a file into an SoImageDataAdapter object.
-
Then a rectangular region [30, 100]x[30, 100]x[0, 0] pixels is extracted in an SoMemoryDataAdapter.
-
The ROI is saved to a file in the current directory.
NOTE:
-
This example works with a 2D square area but could be easily extended to extract a cubic volume from a 3D image.
-
This example do not use ImageViz engines but could be a step to start working with ImageViz.
-
The SoCropImageProcessing can be used to do the same workflow. This example shows how to handle the data in a lower level way.
SEE ALSO
SbImageDataAccessor, SbImageDataAdapterHelper, SoImageDataAdapter, SoCropImageProcessing
FILES:
-
ImageViz/GettingStarted/04.3.ExtractingROI.cxx