Read ROI from image from disk in SimpleITK


(Roger) #1

does anyone know if there is a way to read a subsection of an image (an ROI) without loading the entire image into memory, is it doable in SimpleITK?

(Bradley Lowekamp) #2

Hello Roger,

SimpleITK 1.2 just added an easy interface for this feature. The object oriented interface is required, and the image file format needs to support the IO sub-operation to get the savings of time and memory ( otherwise the full image will be read, and the requested region extracted). We have an example in read the docs the usage. To use streaming IO, you seed to call ImageFileReader::SetExtractSize and/or ImageFileReader::SetExtractIndex. This is subject to the actual size of the image which can be obtained before reading the image bulk data with the ImageFileReader::ReadImageInformation methods.

Please let us know if you have any further questions.