I made a quick fix.
I simply have replaced the otb::FunctorFilter with itk::UnaryFunctorImageFilter.
It seems like the otb::FunctorFilter is not registered in the pipeline, or something like that. Can someone who knows well otb::FunctorFilter take a look? I really would keep otb::FunctorFilter but I fail to solve this another way that replacing it.
I get a itk exception telling that the requested region is outside the largest possible region. After debugging I found that the filters were unitialized, even if they were pushed in a std::vector that is member of the application. Strangely the itk filter behaves differently... I am a bit lost
I must say that I can not see what's wrong in the application code. Are you sure that the filter are really uninitialized ? Sometimes gdb can be a little mis-leading if you have optimization flags during compilation ...
@jmichelThis commit solves the problem. I do not use gdb, there is no segfault, everything is handled with clean exception. But I am still trying to understand
@jmichel I just found that the otb::FunctorFilter does not like when its requested region is [0,0].
In otb::StreamingMosaicFilterBase filters, when an output requested region is entirely outside the largest possible region of a particular input, the requested region of this one is set to [0,0].
That's why we end here when the input is a otb::FunctorFilter.
The itk::UnaryFunctorFilter tolerates a requested region of [0,0], but not the otb::FunctorFilter.
Maybe we can change this behavior? Processing a null region might have sense... like in Mosaic!
hmm, from my understanding (which could not be exact) #1963 (closed) enables the StreamingWarpImageFilter to behaves correctly when a requested region is empty.
I do not think that this will have an impact.
Let's consider the following piece of pipeline (illustrated with this fine ascii art) bellow:
F1, F2, F3 and F4 are instances of FunctorImageFilter, image1 and image2 are instances of readers, and output is a writer instance for the output image. Mosaic is a mosaic filter.
Now suppose the writer of output is generating a chunk of image that is completely outside the image1 largest possible region.
0. output propagates the region to F3, then F3 to Mosaic
Mosaic request an empty region to F4
Before fix: F4 throw an exception. After fix: F4 propagates upstream an empty region
Thank to #1963 (closed), warp_filter is able to manage correctly the request
All requested regions have reached the readers, which produce the regions
Mosaic reads what it needs (it won't read any of the output of warp_filter, even if it exists)