<div dir="ltr">Great. I agree with this approach.<div><br></div><div>I would actually love to see this approach for all meta-data - request pairs. It would be a lot of work to extend it to WHOLE_EXTENT() / UPDATE_EXTENT() though.</div><div><br></div><div>-berk</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 21, 2016 at 1:42 PM, David Gobbi <span dir="ltr"><<a href="mailto:david.gobbi@gmail.com" target="_blank">david.gobbi@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Some of the imaging filters (e.g. vtkImageReslice) need the origin and spacing in order to compute the UpdateExtent. Without this information, these filters would always have to set the UpdateExtent to the whole extent.</div><div><br></div><div>For vtkImageReslice, for example, the ResliceTransform is expressed in spatial units (e.g millimeters) so figuring out the relationship between the output extent and the input extent requires that the origin and spacing are known.</div><div><br></div><div>So it seems that the solution is as follows, at least for vtkImageReslice:</div><div>1) if SPACING and ORIGIN are not available, then they are not passed downstream (pretty obvious that injecting bogus information into the pipeline is bad).</div><div>2) also, if they are not available, then the UPDATE_EXTENT required for proper streaming cannot be computed, so the input update extent would have to be set to the whole extent.</div><div><br></div><div>Also, for some filters, the origin and spacing are used to compute the output extent if the caller doesn't set the output extent explicitly.</div><div><br></div><div>Long story short: these filters can be modified so that they don't crap out when ORIGIN and SPACING are missing, but we cannot remove ORIGIN and SPACING from the pipeline completely without removing some nice features and seriously breaking backwards compatibility.</div><div><br></div><div>Cheers,</div><div> - David </div><span class=""><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 21, 2016 at 10:50 AM, Berk Geveci <span dir="ltr"><<a href="mailto:berk.geveci@kitware.com" target="_blank">berk.geveci@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Interesting. This probably sort-of worked previously because the pipeline called vtkImageData::CopyInformationToPipeline() at some point. I am saying sort-of because the pipeline could still have the wrong information at certain stages. In theory, these keys are supposed to be available during RequestInformation(). Otherwise, one can simply used origin and spacing from vtkImageData. The only way for these to be there during RequestInformation() is if the source/filters provided it. So if the source didn't provide it, you would end up with default values during RequestInformation and correct but redundant data during RequestData.<div><br></div><div>Since the pipeline only very partially supports these, I would like to get rid of them OR make them optional. Optional being that filters should check for their existence and not assume they will be always available.</div><div><br></div><div>Best,</div><div>-berk</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On Thu, Jan 21, 2016 at 12:29 PM, David Gobbi <span dir="ltr"><<a href="mailto:david.gobbi@gmail.com" target="_blank">david.gobbi@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div><div dir="ltr"><div>Hi All,</div><div><br></div><div>I was looking through the bugtracker this morning (I know, I shouldn't do that :-)</div><div>and found an interesting one:</div><div><br></div>  <a href="http://www.vtk.org/Bug/view.php?id=15901" target="_blank">http://www.vtk.org/Bug/view.php?id=15901</a><br><div><br></div><div>Basic issue is that most VTK image algorithms do this:</div><div><br></div><div>  double spacing[3], origin[3];<br></div><div>  inputInfo->Get(vtkDataObject::ORIGIN(), origin);</div><div>  inputInfo->Get(vtkDataObject::SPACING(), spacing);</div><div><br></div><div>This seems to have worked fine in VTK 5, but in VTK 6, is there any guarantee</div><div>that the pipeline will have ORIGIN and SPACING for vtkImageData?</div><span><font color="#888888"><div><br></div><div> - David</div></font></span></div></div></div></blockquote></div></div></blockquote></div></div></div></div></span></div>
</blockquote></div><br></div>