Advanced Image Reading¶
This example illustrates advanced image reading options:
- Querying an image for its meta-data without reading the bulk intensity data.
- Reading a sub-region of an image.
Querying an image for its meta-data¶
In some cases you may only want to read an image’s meta-data without reading the bulk intensity data into memory. For instance, if you want to read subregions of an image and not the whole image or if you want to display image information (e.g. patient name) to a user in a GUI which then allows them to select a specific image.
Reading an image sub-region¶
In some cases you are only interested in reading a sub-region of an image. This may be due to memory constraints or if it is known that the relevant content is always in a sub region of the image. If the specific image IO used for this operation supports streaming then this will indeed only read the sub-region, otherwise the whole image is read into memory and the sub-region is returned. The IOs that support streaming are:
- TIFFImageIO (supports a subset of encodings)
- HDF5ImageIO (supports a subset of encodings)
- VTKImageIO (supports a subset of encodings)