Hello,<br><br>I was the person who initially reported this difficulty to Amy.&nbsp; I have existing code that uses the AccumulateImageFilter to find the mean of several volumes stacked into a 4D dataset from the TileImageFilter.&nbsp; I have several 3D vector image volumes which I stack into a 4D volume using TileImageFilter, and then I use the accumulate filter to find the mean 3D volume.&nbsp; Requiring the mean image to remain in 4D requires the headache of further processing to reduce it to a 3D volume.&nbsp; The AccumulateFilter already works for me in going from ND to (N-1)D so there are no code changes required.&nbsp; 
<br><br>Can the concept check allow either the same dimension or one less, because people may already be using either of these conventions?&nbsp; I dont think enforcing either one exclusively is a good idea in terms of backwards compatibility.
<br><br>I can provide sample code if necessary, but I'd need to extract it from a larger project.<br><br>Casey Goodlett<br><br><div><span class="gmail_quote">On 3/1/06, <b class="gmail_sendername">Luis Ibanez</b> &lt;<a href="mailto:luis.ibanez@kitware.com">
luis.ibanez@kitware.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>Hi Gaetan,<br><br>We agree with you that according to the Doxygen documentation
<br>of the filter, the dimensions of the input image and the output<br>image should be the same.<br><br><br>However, what is a stake here is the conceptual correctness<br>of the filter. (we can fix the Doxygen documentation accordingly).
<br><br><br><br>Since the filter is integrating an image across one dimension,<br>it is equivalent to computing the integral of a function of<br>N-variables along a range of one of those N variables.<br><br><br>Something like:
<br><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sum{ F(x,y,z) }&nbsp;&nbsp;&nbsp;&nbsp;from Z=-inf to Z=inf<br><br><br>which we would expect to become a function of the remaining<br>variables,<br><br><br>something like<br><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;G(x,y).<br><br><br>If you take a CT scan and integrate the values along the Z
<br>direction, conceptually this is close to generating a DRR<br>(an X-Ray) of that 3D CT image, and therefore it seems<br>reasonable to expect that output image to be a 2D image.<br><br><br>Expecting the integral of a 3D function to be a 3D degenerate
<br>function (a 3D image of 1 slice) is a dangerous approach, because<br>then filters that are applied to the accumulated image will<br>assume that is a 3D image. For example a gradient will not work<br>properly on the accumulated image.
<br><br><br><br>I don't see any difficulty on writing the code for a (N) to (N-1)<br>dimensional image. We only need a linear iterator, and a while loop.<br>The GenerateData method shouldn't require more than 50 lines of code.
<br><br><br><br>Have you used this filter ?<br><br><br>Could you post some of the cases for which you use this filter ?<br><br><br><br>That could help us to understand if the output should be a<br>N-dimensional or an (N-1)-dimensional image.
<br><br><br><br>&nbsp;&nbsp;&nbsp;&nbsp;Please let us know,<br><br><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Thanks<br><br><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Luis<br><br><br><br>--------------------<br>Gaetan Lehmann wrote:<br>&gt; Hi,<br>&gt;<br>&gt; The check is correct. The output is an image of the same dimension to keep the
<br>&gt; info of the output image on the same dimension (the docstring is surely a lot<br>&gt; more clear than me).<br>&gt; I don't think it will work if you try to build it with a dim=3 in input and<br>&gt; dim=2 in output.
<br>&gt; It would be nice to be able to set the dim=3 or dim=2 in output, but the code<br>&gt; will surely be difficult to write.<br>&gt;<br>&gt; Gaetan<br>&gt;<br>&gt;<br>&gt; On Wednesday 01 March 2006 21:04, Amy Squillacote wrote:
<br>&gt;<br>&gt;&gt;Hi all,<br>&gt;&gt;<br>&gt;&gt;There is currently a check in the header file of the<br>&gt;&gt;AccumulateImageFilter (in Code/BasicFilters) for whether the input<br>&gt;&gt;and output images have the same dimension.&nbsp;&nbsp;Another ITK developer
<br>&gt;&gt;pointed out to me a couple days ago that this concept check is<br>&gt;&gt;probably wrong.&nbsp;&nbsp;He suggested that the dimension of the output should<br>&gt;&gt;actually be one less than that of the input.&nbsp;&nbsp;Luis and I discussed
<br>&gt;&gt;this earlier today, and we believe that the output's dimension should<br>&gt;&gt;be one less than that of the input.&nbsp;&nbsp;However, if we make this change,<br>&gt;&gt;anyone's code depending on the input and output to have the same
<br>&gt;&gt;dimensionality would break.<br>&gt;&gt;<br>&gt;&gt;What has been the experience of other people using this filter?&nbsp;&nbsp;What<br>&gt;&gt;is your opinion about the dimensionality of the input and output of<br>&gt;&gt;this filter?
<br>&gt;&gt;<br>&gt;&gt;- Amy<br>&gt;&gt;<br>&gt;&gt;_______________________________________________<br>&gt;&gt;Insight-users mailing list<br>&gt;&gt;<a href="mailto:Insight-users@itk.org">Insight-users@itk.org</a><br>&gt;&gt;
<a href="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users</a><br>&gt;&gt;<br>&gt;&gt;<br>&gt;&gt;------------------------------------------------------------------------
<br>&gt;&gt;<br>&gt;&gt;_______________________________________________<br>&gt;&gt;Insight-users mailing list<br>&gt;&gt;<a href="mailto:Insight-users@itk.org">Insight-users@itk.org</a><br>&gt;&gt;<a href="http://www.itk.org/mailman/listinfo/insight-users">
http://www.itk.org/mailman/listinfo/insight-users</a><br><br>_______________________________________________<br>Insight-developers mailing list<br><a href="mailto:Insight-developers@itk.org">Insight-developers@itk.org</a>
<br><a href="http://www.itk.org/mailman/listinfo/insight-developers">http://www.itk.org/mailman/listinfo/insight-developers</a><br></blockquote></div><br>