I’m working on a preprocessing and a segmentation pipeline for vessel extraction from micro-scan medical images. The image volumes are around 2048x2048x1400 and 2560x2560x1400, with 5,5 Gb and 8,5 Gb in 8 bits. In my pipeline i’m using some Frangi , k-mean and morphological filters and i’m struggling with processing such volumes.
I’ve made some research and tried to use stream divisions in the filters to solve the problem but nothing changed ( maybe i’m using it wrong). Apparently, loading and processing the whole image is the problem, so i tried to split in different stacks but filters such as Frangi has different results working like that.
So, i was wondering what options could be more interesting to deal with such volumes of medical images. Could you guys help me on this?
I’m using Python 3.7.6 on windows 10.
We are actively working on improving support for this use case. Can you share a sample dataset and a simple, self-contained set of code for your particular pipeline?
Unfortunately, the dataset that i’m working on is confidential, so i don’t have permission to send it. But i can send you a part of my code. The image is a .tiff file from a micro-ct scan and i’m using a Dell Precision Tower with 16Gb RAM.
Use a file format for the input and output that supports streaming, e.g. MetaImage, .mha extension.
Separate filters, that do not support streaming, e.g. the morphological filters, into separate pipelines calls. If the filters that do not support streaming are at the end of the pipeline, then all memory will be required for the preceeding steps of the pipeline.
The ITK filter to generate the Hessian is the HessianRecursiveGaussianImageFilter, this filter is not streamable and needs the whole image to generate its output. With a 8-bit scalar as input, the 64-bit double Hessian matrix would be 48x times the size of the input image.
In the SimpleITKFilters remote module there is a filter HessianImageFilter which directly computes the Hessian using discrete derivatives. This filter can enable the computation of Hessian based objecteness measures in a streamed fashion.
Thanks very much for the help Matt, i’ll do those changes to improve the code. Just one more question, tiff files and the k-mean filter they doesn’t suport streaming too?
Hrmm… It looks the the itk::TIFFImageIO does not support streaming after reviewing the code. I recall stream whole slices at a time. Perhaps I used separate tools to split multi-splice images into separate files, then used the ImageSeriesReader.
I believe the SCIFIOImageIO can read many TIFF files and has better support for streaming.