<div dir="ltr">Hi,<div> I am trying to create a filter using ImageToImageFilter that I would like to be multi-threaded.</div><div>However, I have some trouble figuring out how to get the dimensions right.</div><div><br></div>


<div>The input is 4D and I want to create an output that is also 4D, but the fourth dimension of the output will always be of constant length in the output, say L=4. (So Dim4 is a vector dim and regardless of the input length the outputs 4th dimension will have length 4).</div>

<div style>In <span style="color:rgb(0,0,0);font-style:italic">ThreadedGenerateData(), </span><span style="color:rgb(0,0,0)">I would like to just iterate spatial positions (the first 3 dimensions) so for example partition </span><span style="color:rgb(0,0,0)">the </span><span style="color:rgb(0,0,0)">outputRegionForThread</span><span style="color:rgb(0,0,0)"> partitioned along the 3rd dimension (although along 1 or 2nd dim would work too).</span></div>

<div style><span style="color:rgb(0,0,0)">So essentially I want to iterate over all spatial locations (dimensions 1-3), and for each spatial location grab the vector along the 4th dimension. For each location, the result (vector of length 3) is written into the 4D output.</span></div>

<div style><span style="color:rgb(0,0,0)"><br></span></div><div style><span style="color:rgb(0,0,0)">It seems to me that once I define the output dimensions in </span><span style="color:rgb(0,0,0);font-style:italic">GenerateOutputInformation() </span><span style="color:rgb(0,0,0)">(4D)</span><span style="color:rgb(0,0,0)">, then </span><span style="color:rgb(0,0,0);font-style:italic">ThreadedGenerateData() </span><span style="color:rgb(0,0,0)">will partition THIS 4D region whereas I am looking to iterate just the first 3 dimensions of the output.</span></div>

<div style><span style="color:rgb(0,0,0)">How can I achieve this? </span></div><div style><span style="color:rgb(0,0,0)">Should I be looking at using vector images for this?  Or multiple outputs?</span></div><div style><span style="color:rgb(0,0,0)"><br>

</span></div><div style><span style="color:rgb(0,0,0)">Thanks</span></div><div style><font color="#000000">Soren</font></div><div style><span style="color:rgb(0,0,0)"><br></span></div><div style><span style="color:rgb(0,0,0)"><br>

</span></div><div style><span style="color:rgb(0,0,0)">Btw:</span></div><div style><span style="color:rgb(0,0,0)">Thanks to whoever put all the examples on Wiki  - they are fantastic.</span></div><div style><span style="color:rgb(0,0,0)"><br>

</span></div><div style><span style="color:rgb(0,0,0)"><br></span></div><div style><span style="color:rgb(0,0,0)">  </span></div>




</div>