I have 3D data on which I want to do operations that are independent of each other along the third dimension. I could for example work independently on 2D slices in the two first dimensions or on subvolumes which have only a limited extend in the third dimension.
I would like to build a low-latency pipeline of filters, say A and B, that perform this kind of operations on slices or subvolumes and iteratively construct the output, e.g. slice by slice or subvolume by subvolume.
I have tried to connect source -> A -> B and in each iteration in a loop set a single slice or subvolume as a requested region of B. The problem is that the output of B gets reallocated every time I change the requested region so that the buffered region is only as large as the requested region. All my previously computed data is lost here.
Ideally, I would like B to output INTO a volume that I keep (without an extra copy). The design of ITK seems to put responsibility of allocating output on the producer, so this might not be possible.
What options do I have here?