InsightSoftwareConsortium / ITKSphinxExamples

Cookbook examples for the Insight Toolkit documented with Sphinx
https://examples.itk.org
Apache License 2.0
53 stars 64 forks source link

Add convolution streaming pipeline notebook #353

Open tbirdso opened 2 years ago

tbirdso commented 2 years ago

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.

Leengit commented 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.

dzenanz commented 2 years ago

Another example to possibly reference is https://github.com/OpenImaging/demos/tree/master/ProcessImageChunks