Open tbirdso opened 2 years ago
Maybe it's not quite close enough to be of direct use, but in the context of machine learning and for getting the pixel data into Tensorflow, we do something similar in HistomicsStream. A large image is read chunk by chunk using large_image.
So you might check out the use of large_image
starting at
https://github.com/DigitalSlideArchive/HistomicsStream/blob/121ba5fa1cd60aab203f73620f1caf64b936e5dd/histomics_stream/configure.py#L109
where some header information is extracted, and starting at
https://github.com/DigitalSlideArchive/HistomicsStream/blob/121ba5fa1cd60aab203f73620f1caf64b936e5dd/histomics_stream/tensorflow.py#L352
where it reads a chunk (e.g.,2048 × 2048 pixels) of an image.
Another example to possibly reference is https://github.com/OpenImaging/demos/tree/master/ProcessImageChunks
Create a notebook example demonstrating how operations on large image input can be streamed in smaller, manageable chunks. Suggest reading from an .mha image (which supports streaming) and performing at least one convolution stage to demonstrate streaming behavior.
Reference Stream a Pipeline and itkConvolutionImageFilterStreamingTest. May be a slightly more challenging first issue, but a good way to learn the details about how the ITK pipeline model works.