<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Hi Roman,</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">I tried some modifications of your second <a href="https://github.com/romangrothausmann/ITK-CLIs/blob/d9b5c3f1a786b595255a9153da9ceafd88d2a189/resample.cxx">attempt</a>, but couldn't get it to compile. But your code reminded me very much of <a href="https://github.com/BRAINSia/BRAINSTools/tree/master/BRAINSFit">BRAINSFit</a>, so you might take inspiration from that.</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">I am sorry I could not be of more help.</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Dženan</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 16, 2016 at 7:42 AM, Grothausmann, Roman Dr. <span dir="ltr"><<a href="mailto:grothausmann.roman@mh-hannover.de" target="_blank">grothausmann.roman@mh-hannover.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 12/09/16 17:41, Dženan Zukić wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
can you turn<br>
smoother->SetInput(savedPointe<wbr>rs[i]->GetOutput());<br>
into<br>
if (i==0)<br>
<br>
smoother->SetInput(static_cast<wbr><CastFilterType::Pointer>(save<wbr>dPointers[i])->GetOutput());<br>
else<br>
<br>
smoother->SetInput(static_cast<wbr><GaussianFilterType::Pointer>(<wbr>savedPointers[i])->GetOutput()<wbr>);<br>
or something similar and see whether that works?<br>
</blockquote>
<br></span>
Did so,<br>
<a href="https://github.com/romangrothausmann/ITK-CLIs/commit/2cd1fbe4406eccbd6552e88e8be0a0ab1aad4ba6" rel="noreferrer" target="_blank">https://github.com/romangrotha<wbr>usmann/ITK-CLIs/commit/2cd1fbe<wbr>4406eccbd6552e88e8be0a0ab1aad4<wbr>ba6</a><br>
but still getting compile errors like:<br>
resample.cxx:73:5: error: no matching function for call to ?std::vector<itk::SmartPointer<wbr><itk::ProcessObject> >::push_back(itk::CastImageFil<wbr>ter<itk::Image<float, 1u>, itk::Image<float, 1u> >::Pointer&)?<br>
     savedPointers.push_back(caste<wbr>r);<br>
<br>
and<br>
<br>
resample.cxx:80:25: error: invalid user-defined conversion from ?itk::SmartPointer<itk::Proces<wbr>sObject>? to ?itk::SmartPointer<itk::CastIm<wbr>ageFilter<itk::Image<float, 1u>, itk::Image<float, 1u> > >::ObjectType* {aka itk::CastImageFilter<itk::Imag<wbr>e<float, 1u>, itk::Image<float, 1u> >*}? [-fpermissive]<br>
      smoother->SetInput(static_cast<wbr><typename CastFilterType::Pointer>(saved<wbr>Pointers[i])->GetOutput());<br>
<br>
<br>
<br>
I also tried Your suggestion on the .GetPointer() variant:<br>
<a href="https://github.com/romangrothausmann/ITK-CLIs/commit/4a96d962430461c0b26de9363a1ccf623b9c9840" rel="noreferrer" target="_blank">https://github.com/romangrotha<wbr>usmann/ITK-CLIs/commit/4a96d96<wbr>2430461c0b26de9363a1ccf623b9c9<wbr>840</a><br>
which compiles but segfaults when executed.<br>
<br>
<br>
<br>
A third variant stores the Output SPs in a separate list:<br>
<a href="https://github.com/romangrothausmann/ITK-CLIs/commit/d9b5c3f1a786b595255a9153da9ceafd88d2a189" rel="noreferrer" target="_blank">https://github.com/romangrotha<wbr>usmann/ITK-CLIs/commit/d9b5c3f<wbr>1a786b595255a9153da9ceafd88d2a<wbr>189</a><br>
but compilation stops with:<span class=""><br>
resample.cxx:77:5: error: request for member ?GetPointer? in ?caster.itk::SmartPointer<TObj<wbr>ectType>::operator-><itk::Cast<wbr>ImageFilter<itk::Image<float, 1u>, itk::Image<float, 1u> > >()->itk::CastImageFilter<itk:<wbr>:Image<float, 1u>, itk::Image<float, 1u> >::<anonymous>.itk::UnaryFunct<wbr>orImageFilter<itk::Image<<wbr>float, 1u>, itk::Image<float, 1u>, itk::Functor::Cast<float, float> >::<anonymous>.itk::InPlaceIma<wbr>geFilter<itk::Image<float, 1u>, itk::Image<float, 1u> >::<anonymous>.itk::ImageToIma<wbr>geFilter<itk::Image<float, 1u>, itk::Image<float, 1u> >::<anonymous>.itk::ImageSourc<wbr>e<TOutputImage>::GetOutput<<wbr>itk::Image<float, 1u> >()?, which is of pointer type ?itk::ImageSource<itk::Image<f<wbr>loat, 1u> >::OutputImageType* {aka itk::Image<float, 1u>*}? (maybe you meant to use ?->? ?)<br>
     savedOutPointers.push_back(ca<wbr>ster->GetOutput().GetPointer()<wbr>);<br>
     ^<br>
<br></span>
Any other ideas how to get this working?<br>
<br>
Many thanks for looking into this.<br>
Roman<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
On Mon, Sep 12, 2016 at 5:41 AM, Grothausmann, Roman Dr.<br></span>
<<a href="mailto:grothausmann.roman@mh-hannover.de" target="_blank">grothausmann.roman@mh-hannove<wbr>r.de</a> <mailto:<a href="mailto:grothausmann.roman@mh-hannover.de" target="_blank">grothausmann.roman@mh-<wbr>hannover.de</a>>><div><div class="h5"><br>
wrote:<br>
<br>
    On 09/09/16 16:21, Dženan Zukić wrote:<br>
<br>
        Hi Roman,<br>
<br>
        you should not save the pointer the SmartPointer encapsulates, but<br>
        rather the<br>
        SmartPointer itself. The saving line of code should not be<br>
        savedPointers.push_back(caster<wbr>.GetPointer());<br>
        but rather<br>
        savedPointers.push_back(caster<wbr>);<br>
        and later usage should not be<br>
        smoother->SetInput(dynamic_cas<wbr>t<ISType*>(savedPointers[i].<wbr>GetPointer())->GetOutput());<br>
        but rather<br>
        smoother->SetInput(savedPointe<wbr>rs[i]->GetOutput());<br>
<br>
<br>
    Many thanks Dženan for Your reply. I tried as You suggested:<br>
<br>
    <a href="https://github.com/romangrothausmann/ITK-CLIs/commit/b00551faf951192f50e4090d683300524b4c95ba" rel="noreferrer" target="_blank">https://github.com/romangrotha<wbr>usmann/ITK-CLIs/commit/b00551f<wbr>af951192f50e4090d683300524b4c9<wbr>5ba</a><br>
    <<a href="https://github.com/romangrothausmann/ITK-CLIs/commit/b00551faf951192f50e4090d683300524b4c95ba" rel="noreferrer" target="_blank">https://github.com/romangroth<wbr>ausmann/ITK-CLIs/commit/b00551<wbr>faf951192f50e4090d683300524b4c<wbr>95ba</a>><br>
<br>
    but am getting:<br>
<br>
    resample.cxx:79:49: error: no matching function for call to<br>
    ?itk::ProcessObject::GetOutput<wbr>()?<br>
      smoother->SetInput(savedPointe<wbr>rs[i]->GetOutput());<br>
                                                     ^<br>
    resample.cxx:79:49: note: candidates are:<br>
    In file included from resample.cxx:5:<br>
    /opt/itk-4.9.1/include/ITK-4.9<wbr>/itkProcessObject.h:612:16: note:<br>
    itk::DataObject* itk::ProcessObject::GetOutput(<wbr>const DataObjectIdentifierType&)<br>
       DataObject * GetOutput(const DataObjectIdentifierType & key);<br>
                    ^<br>
<br>
    I also tried:<br>
    std::vector<itk::ProcessObject<wbr>> savedPointers;<br>
    std::vector<itk::ISType> savedPointers;<br>
    std::vector< itk::SmartPointer<itk::Process<wbr>Object> > savedPointers;<br>
    but always got compile errors.<br>
    I am confused when to use the smart-pointer as is and when with .GetPointer().<br>
<br>
    According to<br>
<br>
    <a href="https://cmake.org/pipermail/insight-users/2007-May/022374.html" rel="noreferrer" target="_blank">https://cmake.org/pipermail/in<wbr>sight-users/2007-May/022374.ht<wbr>ml</a><br>
    <<a href="https://cmake.org/pipermail/insight-users/2007-May/022374.html" rel="noreferrer" target="_blank">https://cmake.org/pipermail/i<wbr>nsight-users/2007-May/022374.h<wbr>tml</a>><br>
<br>
    I also tried storing the output-pointers (without pipe-line disconnection)<br>
    in a separate list<br>
<br>
    <a href="https://github.com/romangrothausmann/ITK-CLIs/commit/d9b5c3f1a786b595255a9153da9ceafd88d2a189" rel="noreferrer" target="_blank">https://github.com/romangrotha<wbr>usmann/ITK-CLIs/commit/d9b5c3f<wbr>1a786b595255a9153da9ceafd88d2a<wbr>189</a><br>
    <<a href="https://github.com/romangrothausmann/ITK-CLIs/commit/d9b5c3f1a786b595255a9153da9ceafd88d2a189" rel="noreferrer" target="_blank">https://github.com/romangroth<wbr>ausmann/ITK-CLIs/commit/d9b5c3<wbr>f1a786b595255a9153da9ceafd88d2<wbr>a189</a>><br>
<br>
    which does not compile either:<br>
<br>
    resample.cxx:77:5: error: request for member ?GetPointer? in<br>
    ?caster.itk::SmartPointer<TObj<wbr>ectType>::operator-><itk::Cast<wbr>ImageFilter<itk::Image<float,<br>
    1u>, itk::Image<float, 1u> > >()->itk::CastImageFilter<itk:<wbr>:Image<float,<br>
    1u>, itk::Image<float, 1u><br>
    >::<anonymous>.itk::UnaryFunct<wbr>orImageFilter<itk::Image<<wbr>float, 1u>,<br>
    itk::Image<float, 1u>, itk::Functor::Cast<float, float><br>
    >::<anonymous>.itk::InPlaceIma<wbr>geFilter<itk::Image<float, 1u>,<br>
    itk::Image<float, 1u><br>
    >::<anonymous>.itk::ImageToIma<wbr>geFilter<itk::Image<float, 1u>,<br>
    itk::Image<float, 1u><br>
    >::<anonymous>.itk::ImageSourc<wbr>e<TOutputImage>::GetOutput<<wbr>itk::Image<float,<br>
    1u> >()?, which is of pointer type ?itk::ImageSource<itk::Image<f<wbr>loat, 1u><br>
    >::OutputImageType* {aka itk::Image<float, 1u>*}? (maybe you meant to use<br>
    ?->? ?)<br>
         savedOutPointers.push_back(ca<wbr>ster->GetOutput().GetPointer()<wbr>);<br>
         ^<br>
<br>
    I'm wondering if construct as needed is not possible at all because I can't<br>
    find anything like that in the ITK-sources or examples. For the code<br>
    snippets I can find in the MLs it is not clear whether they got tested and<br>
    were accepted by a compiler.<br>
<br>
    Any further ideas?<br>
<br>
    Best<br>
    Roman<br>
<br>
<br>
        On Fri, Sep 9, 2016 at 8:29 AM, Grothausmann, Roman Dr.<br>
        <<a href="mailto:grothausmann.roman@mh-hannover.de" target="_blank">grothausmann.roman@mh-hannove<wbr>r.de</a><br>
        <mailto:<a href="mailto:grothausmann.roman@mh-hannover.de" target="_blank">grothausmann.roman@mh-<wbr>hannover.de</a>><br></div></div>
        <mailto:<a href="mailto:grothausmann.roman@mh-hannover.de" target="_blank">grothausmann.roman@mh-<wbr>hannover.de</a><div><div class="h5"><br>
        <mailto:<a href="mailto:grothausmann.roman@mh-hannover.de" target="_blank">grothausmann.roman@mh-<wbr>hannover.de</a>>>><br>
        wrote:<br>
<br>
            On 22/07/16 14:49, Lowekamp, Bradley (NIH/NLM/LHC) [C] wrote:<br>
<br>
                Hi,<br>
<br>
                Who is holding the pointer to the newly created ImageFileReader<br>
        outside of<br>
                the loop? For that type of operation I’ll frequently just stash<br>
        smart<br>
                pointers into a std::vector or list.<br>
<br>
<br>
            I tried to change the resample example<br>
<br>
        (<a href="https://itk.org/Doxygen/html/Examples_2Filtering_2ResampleVolumesToBeIsotropic_8cxx-example.html" rel="noreferrer" target="_blank">https://itk.org/Doxygen/html/<wbr>Examples_2Filtering_2ResampleV<wbr>olumesToBeIsotropic_8cxx-<wbr>example.html</a><br>
        <<a href="https://itk.org/Doxygen/html/Examples_2Filtering_2ResampleVolumesToBeIsotropic_8cxx-example.html" rel="noreferrer" target="_blank">https://itk.org/Doxygen/html/<wbr>Examples_2Filtering_2ResampleV<wbr>olumesToBeIsotropic_8cxx-<wbr>example.html</a>><br>
<br>
        <<a href="https://itk.org/Doxygen/html/Examples_2Filtering_2ResampleVolumesToBeIsotropic_8cxx-example.html" rel="noreferrer" target="_blank">https://itk.org/Doxygen/html/<wbr>Examples_2Filtering_2ResampleV<wbr>olumesToBeIsotropic_8cxx-<wbr>example.html</a><br>
        <<a href="https://itk.org/Doxygen/html/Examples_2Filtering_2ResampleVolumesToBeIsotropic_8cxx-example.html" rel="noreferrer" target="_blank">https://itk.org/Doxygen/html/<wbr>Examples_2Filtering_2ResampleV<wbr>olumesToBeIsotropic_8cxx-<wbr>example.html</a>>><br>
            that uses itkRecursiveGaussianImageFilte<wbr>r for each dimension) such<br>
        that it works<br>
            for any dimensional image.<br>
            Doing as Brad suggested and storing each smart-pointer of<br>
            itkRecursiveGaussianImageFilte<wbr>r in a std::vector I get a program<br>
<br>
        (<a href="https://github.com/romangrothausmann/ITK-CLIs/blob/0968dd25af2abc37ffb0c0503cc4c2972b3b2098/resample.cxx" rel="noreferrer" target="_blank">https://github.com/romangroth<wbr>ausmann/ITK-CLIs/blob/0968dd25<wbr>af2abc37ffb0c0503cc4c2972b3b20<wbr>98/resample.cxx</a><br>
        <<a href="https://github.com/romangrothausmann/ITK-CLIs/blob/0968dd25af2abc37ffb0c0503cc4c2972b3b2098/resample.cxx" rel="noreferrer" target="_blank">https://github.com/romangroth<wbr>ausmann/ITK-CLIs/blob/0968dd25<wbr>af2abc37ffb0c0503cc4c2972b3b20<wbr>98/resample.cxx</a>><br>
<br>
        <<a href="https://github.com/romangrothausmann/ITK-CLIs/blob/0968dd25af2abc37ffb0c0503cc4c2972b3b2098/resample.cxx" rel="noreferrer" target="_blank">https://github.com/romangroth<wbr>ausmann/ITK-CLIs/blob/0968dd25<wbr>af2abc37ffb0c0503cc4c2972b3b20<wbr>98/resample.cxx</a><br>
        <<a href="https://github.com/romangrothausmann/ITK-CLIs/blob/0968dd25af2abc37ffb0c0503cc4c2972b3b2098/resample.cxx" rel="noreferrer" target="_blank">https://github.com/romangroth<wbr>ausmann/ITK-CLIs/blob/0968dd25<wbr>af2abc37ffb0c0503cc4c2972b3b20<wbr>98/resample.cxx</a>>>)<br>
            that compiles but segfaults when used. I guess the way I'm trying to<br>
            dereference a pointer from the list is not correct<br>
<br>
        (<a href="https://github.com/romangrothausmann/ITK-CLIs/commit/0968dd25af2abc37ffb0c0503cc4c2972b3b2098#diff-cb1b1c6837c6074372c220250cfdbb36R80" rel="noreferrer" target="_blank">https://github.com/romangroth<wbr>ausmann/ITK-CLIs/commit/0968dd<wbr>25af2abc37ffb0c0503cc4c2972b3b<wbr>2098#diff-cb1b1c6837c6074372c2<wbr>20250cfdbb36R80</a><br>
        <<a href="https://github.com/romangrothausmann/ITK-CLIs/commit/0968dd25af2abc37ffb0c0503cc4c2972b3b2098#diff-cb1b1c6837c6074372c220250cfdbb36R80" rel="noreferrer" target="_blank">https://github.com/romangroth<wbr>ausmann/ITK-CLIs/commit/0968dd<wbr>25af2abc37ffb0c0503cc4c2972b3b<wbr>2098#diff-cb1b1c6837c6074372c2<wbr>20250cfdbb36R80</a>><br>
<br>
        <<a href="https://github.com/romangrothausmann/ITK-CLIs/commit/0968dd25af2abc37ffb0c0503cc4c2972b3b2098#diff-cb1b1c6837c6074372c220250cfdbb36R80" rel="noreferrer" target="_blank">https://github.com/romangroth<wbr>ausmann/ITK-CLIs/commit/0968dd<wbr>25af2abc37ffb0c0503cc4c2972b3b<wbr>2098#diff-cb1b1c6837c6074372c2<wbr>20250cfdbb36R80</a><br>
        <<a href="https://github.com/romangrothausmann/ITK-CLIs/commit/0968dd25af2abc37ffb0c0503cc4c2972b3b2098#diff-cb1b1c6837c6074372c220250cfdbb36R80" rel="noreferrer" target="_blank">https://github.com/romangroth<wbr>ausmann/ITK-CLIs/commit/0968dd<wbr>25af2abc37ffb0c0503cc4c2972b3b<wbr>2098#diff-cb1b1c6837c6074372c2<wbr>20250cfdbb36R80</a>>>)<br>
            but I could not find an example except the one referenced in the<br>
        code line.<br>
            So how to correctly dereference a pointer from the list of<br>
        smart-pointers to<br>
            get its output?<br>
<br>
            Thank for any help or hints<br>
            Roman<br>
<br>
                    On Jul 22, 2016, at 6:00 AM, Grothausmann, Roman Dr.<br>
                    <<a href="mailto:grothausmann.roman@mh-hannover.de" target="_blank">grothausmann.roman@mh-hannove<wbr>r.de</a><br>
        <mailto:<a href="mailto:grothausmann.roman@mh-hannover.de" target="_blank">grothausmann.roman@mh-<wbr>hannover.de</a>><br></div></div>
                    <mailto:<a href="mailto:grothausmann.roman@mh-hannover.de" target="_blank">grothausmann.roman@mh-<wbr>hannover.de</a><div><div class="h5"><br>
        <mailto:<a href="mailto:grothausmann.roman@mh-hannover.de" target="_blank">grothausmann.roman@mh-<wbr>hannover.de</a>>>> wrote:<br>
<br>
                    Many thanks Brad for Your detailed reply. I understand now<br>
        the problems<br>
                    concerning streaming TileImageFilter. However I still wonder<br>
        why my<br>
                    non-streaming version also does not work any more after<br>
        moving the<br>
                    creation<br>
                    of reader instances into the for-loop:<br>
<br>
        <a href="https://github.com/romangrothausmann/ITK-CLIs/blob/ebfc0aea37d28cbbf2bb22c3f56be52453cebde9/tile.cxx#L46-L50" rel="noreferrer" target="_blank">https://github.com/romangrotha<wbr>usmann/ITK-CLIs/blob/ebfc0aea3<wbr>7d28cbbf2bb22c3f56be52453cebde<wbr>9/tile.cxx#L46-L50</a><br>
        <<a href="https://github.com/romangrothausmann/ITK-CLIs/blob/ebfc0aea37d28cbbf2bb22c3f56be52453cebde9/tile.cxx#L46-L50" rel="noreferrer" target="_blank">https://github.com/romangroth<wbr>ausmann/ITK-CLIs/blob/ebfc0aea<wbr>37d28cbbf2bb22c3f56be52453cebd<wbr>e9/tile.cxx#L46-L50</a>><br>
<br>
        <<a href="https://github.com/romangrothausmann/ITK-CLIs/blob/ebfc0aea37d28cbbf2bb22c3f56be52453cebde9/tile.cxx#L46-L50" rel="noreferrer" target="_blank">https://github.com/romangroth<wbr>ausmann/ITK-CLIs/blob/ebfc0aea<wbr>37d28cbbf2bb22c3f56be52453cebd<wbr>e9/tile.cxx#L46-L50</a><br>
        <<a href="https://github.com/romangrothausmann/ITK-CLIs/blob/ebfc0aea37d28cbbf2bb22c3f56be52453cebde9/tile.cxx#L46-L50" rel="noreferrer" target="_blank">https://github.com/romangroth<wbr>ausmann/ITK-CLIs/blob/ebfc0aea<wbr>37d28cbbf2bb22c3f56be52453cebd<wbr>e9/tile.cxx#L46-L50</a>>><br>
<br>
<br>
<br>
            Is this construct inappropriate for the TileImageFilter?<br>
<br>
                    Why does it work for:<br>
<br>
        <a href="https://itk.org/Doxygen/html/SphinxExamples_2src_2Filtering_2ImageGrid_2AppendTwo3DVolumes_2Code_8cxx-example.html#_a2" rel="noreferrer" target="_blank">https://itk.org/Doxygen/html/S<wbr>phinxExamples_2src_2Filtering_<wbr>2ImageGrid_2AppendTwo3DVolumes<wbr>_2Code_8cxx-example.html#_a2</a><br>
        <<a href="https://itk.org/Doxygen/html/SphinxExamples_2src_2Filtering_2ImageGrid_2AppendTwo3DVolumes_2Code_8cxx-example.html#_a2" rel="noreferrer" target="_blank">https://itk.org/Doxygen/html/<wbr>SphinxExamples_2src_2Filtering<wbr>_2ImageGrid_2AppendTwo3DVolume<wbr>s_2Code_8cxx-example.html#_a2</a>><br>
<br>
        <<a href="https://itk.org/Doxygen/html/SphinxExamples_2src_2Filtering_2ImageGrid_2AppendTwo3DVolumes_2Code_8cxx-example.html#_a2" rel="noreferrer" target="_blank">https://itk.org/Doxygen/html/<wbr>SphinxExamples_2src_2Filtering<wbr>_2ImageGrid_2AppendTwo3DVolume<wbr>s_2Code_8cxx-example.html#_a2</a><br>
        <<a href="https://itk.org/Doxygen/html/SphinxExamples_2src_2Filtering_2ImageGrid_2AppendTwo3DVolumes_2Code_8cxx-example.html#_a2" rel="noreferrer" target="_blank">https://itk.org/Doxygen/html/<wbr>SphinxExamples_2src_2Filtering<wbr>_2ImageGrid_2AppendTwo3DVolume<wbr>s_2Code_8cxx-example.html#_a2</a>><wbr>><br>
<br>
<br>
<br>
            On 21/07/16 15:41, Lowekamp, Bradley (NIH/NLM/LHC) [C] wrote:<br>
<br>
                        Hello,<br>
<br>
                        The TileImageFilter does not fully stream [1]. The<br>
        filter also<br>
                        has some<br>
                        odd behavior, and other older implementation details. If<br>
        you are<br>
                        going to<br>
                        work on a streaming pipelines it is best practice to<br>
        examine the<br>
                        filters<br>
                        to determine how the Requested regions behave.<br>
<br>
                        However, there is no reason that the TileImageFilter<br>
        algorithm<br>
                        couldn’t<br>
                        support streaming. It is just a matter of code and a<br>
        bunch of<br>
                        testing. A<br>
                        contribution for this issue would be welcomed! Also this<br>
        filter<br>
                        is in<br>
                        need a refactoring and bring it up to several other best<br>
                        practices. There<br>
                        are several issue with the current implementation that would<br>
                        cause it not<br>
                        to work correctly with a streaming pipeline, and cause<br>
        excessive<br>
                        execution.<br>
<br>
                        You can also use the PipelieMoniotorImageFilter to<br>
        record and<br>
                        print the<br>
                        pipeline interaction during Update [2]. This information<br>
        helps with<br>
                        debugging and diagnosing problems, but if the pipeline is<br>
                        mis-behaving (<br>
                        as the TileImageFilter may ), the information may not be<br>
        correct.<br>
<br>
                        I have tried similar streaming with the<br>
        JoinSeriesImageFilter.<br>
                        However I<br>
                        ran into many problems with having hundreds of ImageIO being<br>
                        utilized at<br>
                        the same time. There were problems with having too many<br>
        files<br>
                        open at the<br>
                        same time along with ImageIO libraries that couldn’t<br>
        handle single<br>
                        threaded access to multiple files.<br>
<br>
                        [1]<br>
<br>
        <a href="https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Filtering/ImageGrid/include/itkTileImageFilter.hxx#L125-L136" rel="noreferrer" target="_blank">https://github.com/InsightSoft<wbr>wareConsortium/ITK/blob/<wbr>master/Modules/Filtering/Image<wbr>Grid/include/itkTileImageFilte<wbr>r.hxx#L125-L136</a><br>
        <<a href="https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Filtering/ImageGrid/include/itkTileImageFilter.hxx#L125-L136" rel="noreferrer" target="_blank">https://github.com/InsightSof<wbr>twareConsortium/ITK/blob/<wbr>master/Modules/Filtering/Image<wbr>Grid/include/itkTileImageFilte<wbr>r.hxx#L125-L136</a>><br>
<br>
        <<a href="https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Filtering/ImageGrid/include/itkTileImageFilter.hxx#L125-L136" rel="noreferrer" target="_blank">https://github.com/InsightSof<wbr>twareConsortium/ITK/blob/<wbr>master/Modules/Filtering/Image<wbr>Grid/include/itkTileImageFilte<wbr>r.hxx#L125-L136</a><br>
        <<a href="https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Filtering/ImageGrid/include/itkTileImageFilter.hxx#L125-L136" rel="noreferrer" target="_blank">https://github.com/InsightSof<wbr>twareConsortium/ITK/blob/<wbr>master/Modules/Filtering/Image<wbr>Grid/include/itkTileImageFilte<wbr>r.hxx#L125-L136</a>>><br>
<br>
<br>
<br>
<br>
            [2]<br>
        <a href="https://itk.org/Doxygen/html/classitk_1_1PipelineMonitorImageFilter.html" rel="noreferrer" target="_blank">https://itk.org/Doxygen/html/c<wbr>lassitk_1_1PipelineMonitorImag<wbr>eFilter.html</a><br>
        <<a href="https://itk.org/Doxygen/html/classitk_1_1PipelineMonitorImageFilter.html" rel="noreferrer" target="_blank">https://itk.org/Doxygen/html/<wbr>classitk_1_1PipelineMonitorIma<wbr>geFilter.html</a>><br>
<br>
        <<a href="https://itk.org/Doxygen/html/classitk_1_1PipelineMonitorImageFilter.html" rel="noreferrer" target="_blank">https://itk.org/Doxygen/html/<wbr>classitk_1_1PipelineMonitorIma<wbr>geFilter.html</a> <<a href="https://itk.org/Doxygen/html/classitk_1_1PipelineMonitorImageFilter.html" rel="noreferrer" target="_blank">https://itk.org/Doxygen/html/<wbr>classitk_1_1PipelineMonitorIma<wbr>geFilter.html</a>>><br>
<br>
<br>
                            On Jul 21, 2016, at 6:41 AM, Grothausmann, Roman Dr.<br>
                            <<a href="mailto:grothausmann.roman@mh-hannover.de" target="_blank">grothausmann.roman@mh-hannove<wbr>r.de</a><br>
        <mailto:<a href="mailto:grothausmann.roman@mh-hannover.de" target="_blank">grothausmann.roman@mh-<wbr>hannover.de</a>><br></div></div>
                            <mailto:<a href="mailto:grothausmann.roman@mh-hannover.de" target="_blank">grothausmann.roman@mh-<wbr>hannover.de</a><div><div class="h5"><br>
        <mailto:<a href="mailto:grothausmann.roman@mh-hannover.de" target="_blank">grothausmann.roman@mh-<wbr>hannover.de</a>>>> wrote:<br>
<br>
                            Dear mailing list members,<br>
<br>
<br>
                            Based on the examples for TileImageFilter I've created a<br>
                            working CLI<br>
                            to append an arbitrary number of inputs<br>
<br>
        (<a href="https://github.com/romangrothausmann/ITK-CLIs/blob/4fdf5778022598dcf83fb38e6002df72bd67bef3/tile.cxx" rel="noreferrer" target="_blank">https://github.com/romangroth<wbr>ausmann/ITK-CLIs/blob/4fdf5778<wbr>022598dcf83fb38e6002df72bd67be<wbr>f3/tile.cxx</a><br>
        <<a href="https://github.com/romangrothausmann/ITK-CLIs/blob/4fdf5778022598dcf83fb38e6002df72bd67bef3/tile.cxx" rel="noreferrer" target="_blank">https://github.com/romangroth<wbr>ausmann/ITK-CLIs/blob/4fdf5778<wbr>022598dcf83fb38e6002df72bd67be<wbr>f3/tile.cxx</a>><br>
<br>
        <<a href="https://github.com/romangrothausmann/ITK-CLIs/blob/4fdf5778022598dcf83fb38e6002df72bd67bef3/tile.cxx" rel="noreferrer" target="_blank">https://github.com/romangroth<wbr>ausmann/ITK-CLIs/blob/4fdf5778<wbr>022598dcf83fb38e6002df72bd67be<wbr>f3/tile.cxx</a><br>
        <<a href="https://github.com/romangrothausmann/ITK-CLIs/blob/4fdf5778022598dcf83fb38e6002df72bd67bef3/tile.cxx" rel="noreferrer" target="_blank">https://github.com/romangroth<wbr>ausmann/ITK-CLIs/blob/4fdf5778<wbr>022598dcf83fb38e6002df72bd67be<wbr>f3/tile.cxx</a>>>).<br>
<br>
<br>
<br>
<br>
            As there is an example that does not apply Update and<br>
        DisconnectPipeline on<br>
            the readers<br>
<br>
        (<a href="https://itk.org/Doxygen/html/SphinxExamples_2src_2Filtering_2ImageGrid_2AppendTwo3DVolumes_2Code_8cxx-example.html#_a2" rel="noreferrer" target="_blank">https://itk.org/Doxygen/html/<wbr>SphinxExamples_2src_2Filtering<wbr>_2ImageGrid_2AppendTwo3DVolume<wbr>s_2Code_8cxx-example.html#_a2</a><br>
        <<a href="https://itk.org/Doxygen/html/SphinxExamples_2src_2Filtering_2ImageGrid_2AppendTwo3DVolumes_2Code_8cxx-example.html#_a2" rel="noreferrer" target="_blank">https://itk.org/Doxygen/html/<wbr>SphinxExamples_2src_2Filtering<wbr>_2ImageGrid_2AppendTwo3DVolume<wbr>s_2Code_8cxx-example.html#_a2</a>><br>
<br>
        <<a href="https://itk.org/Doxygen/html/SphinxExamples_2src_2Filtering_2ImageGrid_2AppendTwo3DVolumes_2Code_8cxx-example.html#_a2" rel="noreferrer" target="_blank">https://itk.org/Doxygen/html/<wbr>SphinxExamples_2src_2Filtering<wbr>_2ImageGrid_2AppendTwo3DVolume<wbr>s_2Code_8cxx-example.html#_a2</a><br>
        <<a href="https://itk.org/Doxygen/html/SphinxExamples_2src_2Filtering_2ImageGrid_2AppendTwo3DVolumes_2Code_8cxx-example.html#_a2" rel="noreferrer" target="_blank">https://itk.org/Doxygen/html/<wbr>SphinxExamples_2src_2Filtering<wbr>_2ImageGrid_2AppendTwo3DVolume<wbr>s_2Code_8cxx-example.html#_a2</a>><wbr>>)<br>
<br>
<br>
<br>
                            I changed my code such that a reader instance is<br>
        created for<br>
                            each input<br>
                            in a for-loop:<br>
<br>
        <a href="https://github.com/romangrothausmann/ITK-CLIs/commit/ebfc0aea37d28cbbf2bb22c3f56be52453cebde9" rel="noreferrer" target="_blank">https://github.com/romangrotha<wbr>usmann/ITK-CLIs/commit/ebfc0ae<wbr>a37d28cbbf2bb22c3f56be52453ceb<wbr>de9</a><br>
        <<a href="https://github.com/romangrothausmann/ITK-CLIs/commit/ebfc0aea37d28cbbf2bb22c3f56be52453cebde9" rel="noreferrer" target="_blank">https://github.com/romangroth<wbr>ausmann/ITK-CLIs/commit/ebfc0a<wbr>ea37d28cbbf2bb22c3f56be52453ce<wbr>bde9</a>><br>
<br>
        <<a href="https://github.com/romangrothausmann/ITK-CLIs/commit/ebfc0aea37d28cbbf2bb22c3f56be52453cebde9" rel="noreferrer" target="_blank">https://github.com/romangroth<wbr>ausmann/ITK-CLIs/commit/ebfc0a<wbr>ea37d28cbbf2bb22c3f56be52453ce<wbr>bde9</a><br>
        <<a href="https://github.com/romangrothausmann/ITK-CLIs/commit/ebfc0aea37d28cbbf2bb22c3f56be52453cebde9" rel="noreferrer" target="_blank">https://github.com/romangroth<wbr>ausmann/ITK-CLIs/commit/ebfc0a<wbr>ea37d28cbbf2bb22c3f56be52453ce<wbr>bde9</a>>><br>
<br>
<br>
<br>
<br>
<br>
            However, the update from the writer seems not to propagate to the<br>
        readers<br>
            whether streaming or not. Can the TileImageFilter not stream in such<br>
        a case<br>
            or are further modifications necessary?<br>
<br>
<br>
                            Thanks for any help or hints Roman<br>
<br>
<br>
                            On 18/08/14 17:01, Michka Popoff wrote:<br>
<br>
                                Hi<br>
<br>
                                Going the way described in the CreateVolume<br>
        example is<br>
                                the way to<br>
                                go.<br>
<br>
                                Why did you uncomment the DisconnectPipeline()<br>
        call and<br>
                                Update() call<br>
                                in the for loop ? They need to stay there, else<br>
        you will<br>
                                always use<br>
                                the last image. That’s why you see the same<br>
        image, the<br>
                                single update<br>
                                call will be triggered at the end of the script<br>
        and read<br>
                                only one<br>
                                image.<br>
<br>
                                You don’t need to call tileFilter->Update(), you can<br>
                                remove this<br>
                                line. The writer->Update() will take care of the<br>
                                pipeline update. As<br>
                                a bonus, you may wrap your writer->Update() call, to<br>
                                fetch errors at<br>
                                the end of the pipeline:<br>
<br>
                                try { writer->Update(); } catch(<br>
        itk::ExceptionObject &<br>
                                error ) {<br>
                                std::cerr << "Error: " << error << std::endl; return<br>
                                EXIT_FAILURE; }<br>
<br>
                                I made a little Python prototype, the syntax is<br>
        a little bit<br>
                                different than in C++ but it gives you the main<br>
        idea.<br>
<br>
                                Michka<br>
<br>
<br>
                            -- Dr. Roman Grothausmann<br>
<br>
                            Tomographie und Digitale Bildverarbeitung Tomography and<br>
                            Digital Image<br>
                            Analysis<br>
<br>
                            Institut für Funktionelle und Angewandte Anatomie,<br>
        OE 4120<br>
                            Medizinische Hochschule Hannover Carl-Neuberg-Str. 1<br>
        D-30625<br>
                            Hannover<br>
<br>
                            Tel. <a href="tel:%2B49%20511%20532-2900" value="+495115322900" target="_blank">+49 511 532-2900</a> <tel:%2B49%20511%20532-2900><br>
        <tel:%2B49%20511%20532-2900><br>
                            ______________________________<wbr>_______ Powered by<br>
                            <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a> <<a href="http://www.kitware.com" rel="noreferrer" target="_blank">http://www.kitware.com</a>><br>
        <<a href="http://www.kitware.com" rel="noreferrer" target="_blank">http://www.kitware.com</a>><br>
<br>
                            Visit other Kitware open-source projects at<br>
                            <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensou<wbr>rce/opensource.html</a><br>
        <<a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/openso<wbr>urce/opensource.html</a>><br>
                            <<a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/openso<wbr>urce/opensource.html</a><br>
        <<a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/openso<wbr>urce/opensource.html</a>>><br>
<br>
                            Kitware offers ITK Training Courses, for more<br>
        information visit:<br>
                            <a href="http://www.kitware.com/products/protraining.php" rel="noreferrer" target="_blank">http://www.kitware.com/product<wbr>s/protraining.php</a><br>
        <<a href="http://www.kitware.com/products/protraining.php" rel="noreferrer" target="_blank">http://www.kitware.com/produc<wbr>ts/protraining.php</a>><br>
                            <<a href="http://www.kitware.com/products/protraining.php" rel="noreferrer" target="_blank">http://www.kitware.com/produc<wbr>ts/protraining.php</a><br>
        <<a href="http://www.kitware.com/products/protraining.php" rel="noreferrer" target="_blank">http://www.kitware.com/produc<wbr>ts/protraining.php</a>>><br>
<br>
                            Please keep messages on-topic and check the ITK FAQ at:<br>
                            <a href="http://www.itk.org/Wiki/ITK_FAQ" rel="noreferrer" target="_blank">http://www.itk.org/Wiki/ITK_FA<wbr>Q</a><br>
        <<a href="http://www.itk.org/Wiki/ITK_FAQ" rel="noreferrer" target="_blank">http://www.itk.org/Wiki/ITK_F<wbr>AQ</a>><br>
                            <<a href="http://www.itk.org/Wiki/ITK_FAQ" rel="noreferrer" target="_blank">http://www.itk.org/Wiki/ITK_F<wbr>AQ</a><br>
        <<a href="http://www.itk.org/Wiki/ITK_FAQ" rel="noreferrer" target="_blank">http://www.itk.org/Wiki/ITK_F<wbr>AQ</a>>><br>
<br>
                            Follow this link to subscribe/unsubscribe:<br>
<br>
        <a href="http://public.kitware.com/mailman/listinfo/insight-users" rel="noreferrer" target="_blank">http://public.kitware.com/mail<wbr>man/listinfo/insight-users</a><br>
        <<a href="http://public.kitware.com/mailman/listinfo/insight-users" rel="noreferrer" target="_blank">http://public.kitware.com/mai<wbr>lman/listinfo/insight-users</a>><br>
<br>
        <<a href="http://public.kitware.com/mailman/listinfo/insight-users" rel="noreferrer" target="_blank">http://public.kitware.com/mai<wbr>lman/listinfo/insight-users</a><br>
        <<a href="http://public.kitware.com/mailman/listinfo/insight-users" rel="noreferrer" target="_blank">http://public.kitware.com/mai<wbr>lman/listinfo/insight-users</a>>><br>
                            ______________________________<wbr>_________________<br>
        Community<br>
                            mailing list<br>
                            <a href="mailto:Community@itk.org" target="_blank">Community@itk.org</a> <mailto:<a href="mailto:Community@itk.org" target="_blank">Community@itk.org</a>><br></div></div>
        <mailto:<a href="mailto:Community@itk.org" target="_blank">Community@itk.org</a> <mailto:<a href="mailto:Community@itk.org" target="_blank">Community@itk.org</a>>><span class=""><br>
                            <a href="http://public.kitware.com/mailman/listinfo/community" rel="noreferrer" target="_blank">http://public.kitware.com/mail<wbr>man/listinfo/community</a><br>
        <<a href="http://public.kitware.com/mailman/listinfo/community" rel="noreferrer" target="_blank">http://public.kitware.com/mai<wbr>lman/listinfo/community</a>><br>
<br>
        <<a href="http://public.kitware.com/mailman/listinfo/community" rel="noreferrer" target="_blank">http://public.kitware.com/mai<wbr>lman/listinfo/community</a><br>
        <<a href="http://public.kitware.com/mailman/listinfo/community" rel="noreferrer" target="_blank">http://public.kitware.com/mai<wbr>lman/listinfo/community</a>>><br>
<br>
<br>
<br>
                    -- Dr. Roman Grothausmann<br>
<br>
                    Tomographie und Digitale Bildverarbeitung Tomography and<br>
        Digital Image<br>
                    Analysis<br>
<br>
                    Institut für Funktionelle und Angewandte Anatomie, OE 4120<br>
        Medizinische<br>
                    Hochschule Hannover Carl-Neuberg-Str. 1 D-30625 Hannover<br>
<br>
                    Tel. <a href="tel:%2B49%20511%20532-2900" value="+495115322900" target="_blank">+49 511 532-2900</a> <tel:%2B49%20511%20532-2900><br>
        <tel:%2B49%20511%20532-2900><br>
<br>
<br>
<br>
            --<br>
            Dr. Roman Grothausmann<br>
<br>
            Tomographie und Digitale Bildverarbeitung<br>
            Tomography and Digital Image Analysis<br>
<br>
            Institut für Funktionelle und Angewandte Anatomie, OE 4120<br>
            Medizinische Hochschule Hannover<br>
            Carl-Neuberg-Str. 1<br>
            D-30625 Hannover<br>
<br>
            Tel. <a href="tel:%2B49%20511%20532-2900" value="+495115322900" target="_blank">+49 511 532-2900</a> <tel:%2B49%20511%20532-2900><br></span><span class="">
        <tel:%2B49%20511%20532-2900><br>
            ______________________________<wbr>_______<br>
            Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a> <<a href="http://www.kitware.com" rel="noreferrer" target="_blank">http://www.kitware.com</a>><br>
        <<a href="http://www.kitware.com" rel="noreferrer" target="_blank">http://www.kitware.com</a>><br>
<br>
            Visit other Kitware open-source projects at<br>
            <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensou<wbr>rce/opensource.html</a><br>
        <<a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/openso<wbr>urce/opensource.html</a>><br>
            <<a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/openso<wbr>urce/opensource.html</a><br>
        <<a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/openso<wbr>urce/opensource.html</a>>><br>
<br>
            Kitware offers ITK Training Courses, for more information visit:<br>
            <a href="http://www.kitware.com/products/protraining.php" rel="noreferrer" target="_blank">http://www.kitware.com/product<wbr>s/protraining.php</a><br>
        <<a href="http://www.kitware.com/products/protraining.php" rel="noreferrer" target="_blank">http://www.kitware.com/produc<wbr>ts/protraining.php</a>><br>
            <<a href="http://www.kitware.com/products/protraining.php" rel="noreferrer" target="_blank">http://www.kitware.com/produc<wbr>ts/protraining.php</a><br>
        <<a href="http://www.kitware.com/products/protraining.php" rel="noreferrer" target="_blank">http://www.kitware.com/produc<wbr>ts/protraining.php</a>>><br>
<br>
            Please keep messages on-topic and check the ITK FAQ at:<br>
            <a href="http://www.itk.org/Wiki/ITK_FAQ" rel="noreferrer" target="_blank">http://www.itk.org/Wiki/ITK_FA<wbr>Q</a> <<a href="http://www.itk.org/Wiki/ITK_FAQ" rel="noreferrer" target="_blank">http://www.itk.org/Wiki/ITK_F<wbr>AQ</a>><br>
        <<a href="http://www.itk.org/Wiki/ITK_FAQ" rel="noreferrer" target="_blank">http://www.itk.org/Wiki/ITK_F<wbr>AQ</a> <<a href="http://www.itk.org/Wiki/ITK_FAQ" rel="noreferrer" target="_blank">http://www.itk.org/Wiki/ITK_F<wbr>AQ</a>>><br>
<br>
            Follow this link to subscribe/unsubscribe:<br>
            <a href="http://public.kitware.com/mailman/listinfo/insight-users" rel="noreferrer" target="_blank">http://public.kitware.com/mail<wbr>man/listinfo/insight-users</a><br>
        <<a href="http://public.kitware.com/mailman/listinfo/insight-users" rel="noreferrer" target="_blank">http://public.kitware.com/mai<wbr>lman/listinfo/insight-users</a>><br></span><span class="">
            <<a href="http://public.kitware.com/mailman/listinfo/insight-users" rel="noreferrer" target="_blank">http://public.kitware.com/mai<wbr>lman/listinfo/insight-users</a><br>
        <<a href="http://public.kitware.com/mailman/listinfo/insight-users" rel="noreferrer" target="_blank">http://public.kitware.com/mai<wbr>lman/listinfo/insight-users</a>>><br>
<br>
<br>
<br>
    --<br>
    Dr. Roman Grothausmann<br>
<br>
    Tomographie und Digitale Bildverarbeitung<br>
    Tomography and Digital Image Analysis<br>
<br>
    Institut für Funktionelle und Angewandte Anatomie, OE 4120<br>
    Medizinische Hochschule Hannover<br>
    Carl-Neuberg-Str. 1<br>
    D-30625 Hannover<br>
<br></span><span class="">
    Tel. <a href="tel:%2B49%20511%20532-2900" value="+495115322900" target="_blank">+49 511 532-2900</a> <tel:%2B49%20511%20532-2900><br>
<br>
<br>
</span></blockquote><div class="HOEnZb"><div class="h5">
<br>
-- <br>
Dr. Roman Grothausmann<br>
<br>
Tomographie und Digitale Bildverarbeitung<br>
Tomography and Digital Image Analysis<br>
<br>
Institut für Funktionelle und Angewandte Anatomie, OE 4120<br>
Medizinische Hochschule Hannover<br>
Carl-Neuberg-Str. 1<br>
D-30625 Hannover<br>
<br>
Tel. <a href="tel:%2B49%20511%20532-2900" value="+495115322900" target="_blank">+49 511 532-2900</a><br>
</div></div></blockquote></div><br></div>