Okay thanks, assuming we document this in some manner (wiki or VTK Journal article) let&#39;s put a placeholder for some other potential algorithms. I know in DTI and other medical applications they are computing &quot;streamlines&quot; so this could be very useful for medical image analysis.<div>

W<br><br><div class="gmail_quote">On Tue, Jul 5, 2011 at 12:51 PM, David Gobbi <span dir="ltr">&lt;<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Hi Will,<br>
<br>
So far I&#39;ve only considered the filters that I use, mainly vtkProbeFilter and<br>
the implicit functions vtkImplicitDataSet and vtkImplicitVolume.  And I&#39;ve<br>
also considered the possibility of a volume mapper that uses it, so that<br>
people can provide their own specialized interpolation algorithms when they<br>
are volume rendering their data.  However, my experience with VTK&#39;s more<br>
sophisticated graphics algorithms like streamlines is close to nil... I would<br>
have to rely on other people&#39;s expertise to make a full list.<br>
<br>
 - David<br>
<br>
<br>
On Tue, Jul 5, 2011 at 10:27 AM, Will Schroeder<br>
<div><div></div><div class="h5">&lt;<a href="mailto:will.schroeder@kitware.com">will.schroeder@kitware.com</a>&gt; wrote:<br>
&gt; Pretty cool idea David, thanks for the explanation.<br>
&gt; There are other potential filter applications that come to mind (as I&#39;m sure<br>
&gt; you&#39;re aware of) such as streamlines, etc. Have you  created a list, or<br>
&gt; thought about, which filters might benefit from this capability?<br>
&gt; W<br>
&gt;<br>
&gt; On Tue, Jul 5, 2011 at 8:26 AM, David Gobbi &lt;<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Hi Will,<br>
&gt;&gt;<br>
&gt;&gt; If I modified the vtkProbeFilter to use the vtkDataSampler, it would<br>
&gt;&gt; allow people to customize the way that vtkProbeFilter interpolates the<br>
&gt;&gt; data.<br>
&gt;&gt;<br>
&gt;&gt; The interface would look like this: a SetDataSampler() method would be<br>
&gt;&gt; added to vtkProbeFilter<br>
&gt;&gt;<br>
&gt;&gt; void vtkProbeFilter::SetDataSampler(vtkDataSampler *);<br>
&gt;&gt;<br>
&gt;&gt; The probe filter would have a default vtkDataSampler object which<br>
&gt;&gt; would use FindCell to interpolate the data (much like the way<br>
&gt;&gt; vtkProbeFilter works now).  But here is where the magic comes.  The<br>
&gt;&gt; user would be able to provide a different data sampler:<br>
&gt;&gt;<br>
&gt;&gt; vtkImageSampler *isample = vtkImageSampler::New();<br>
&gt;&gt; probeFilter-&gt;SetDataSampler(isample);<br>
&gt;&gt;<br>
&gt;&gt; The vtkImageSampler is for image data, it has interpolation code that<br>
&gt;&gt; is specifically written for structured data and is orders of magnitude<br>
&gt;&gt; faster than using FindCell to interpolate the data.  Also, it provides<br>
&gt;&gt; the option of choosing different interpolation modes: nearest, linear,<br>
&gt;&gt; and cubic.<br>
&gt;&gt;<br>
&gt;&gt; So, in a nutshell, adding a SetDataSampler() method would make it<br>
&gt;&gt; possible for users to customize the way that vtkProbeFilter<br>
&gt;&gt; interpolates values from its Input.  The use of vtkImageSampler here<br>
&gt;&gt; is just one example, if a person needs to use vtkProbeFilter on an FEM<br>
&gt;&gt; data set and knows of an efficient way to interpolate their FEM, then<br>
&gt;&gt; they could write a vtkDataSampler class specifically for their FEM.<br>
&gt;&gt;<br>
&gt;&gt; Another way to describe my goal is as follows: I have a whole bunch of<br>
&gt;&gt; image interpolation code that I&#39;ve written and tweaked over the past<br>
&gt;&gt; 10+ years, and I want to be able to use this interpolation code with<br>
&gt;&gt; the VTK graphics pipeline.  The vtkDataSampler class is how I hope to<br>
&gt;&gt; achieve this.<br>
&gt;&gt;<br>
&gt;&gt;  - David<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On Tue, Jul 5, 2011 at 3:49 AM, Will Schroeder<br>
&gt;&gt; &lt;<a href="mailto:will.schroeder@kitware.com">will.schroeder@kitware.com</a>&gt; wrote:<br>
&gt;&gt; &gt; David-<br>
&gt;&gt; &gt; What&#39;s the relationship of this vtkDataSampler class to the<br>
&gt;&gt; &gt; vtkProbeFilter?<br>
&gt;&gt; &gt; W<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; On Mon, Jul 4, 2011 at 1:23 PM, David Gobbi &lt;<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>&gt;<br>
&gt;&gt; &gt; wrote:<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Hi All,<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; I&#39;ve written some new interpolation classes for VTK, both for images<br>
&gt;&gt; &gt;&gt; and for other data sets.  One thing that I want to ensure is that the<br>
&gt;&gt; &gt;&gt; abstract interface is something that people will be satisfied with.<br>
&gt;&gt; &gt;&gt; I use the same ScalarMode constants as vtkMapper, but there might<br>
&gt;&gt; &gt;&gt; be a better way of selecting arrays that I am not aware of:<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; class vtkDataSampler : public vtkObject<br>
&gt;&gt; &gt;&gt; {<br>
&gt;&gt; &gt;&gt;  // set the data to interpolate (does not establish pipeline<br>
&gt;&gt; &gt;&gt; connection)<br>
&gt;&gt; &gt;&gt;  void SetInput(vtkDataObject *);<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;  // update any internal state variables prior to commencing<br>
&gt;&gt; &gt;&gt; interpolation<br>
&gt;&gt; &gt;&gt;  void Update();<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;  // get an interpolated value, return &quot;false&quot; if out of bounds<br>
&gt;&gt; &gt;&gt;  bool GetSample(const double point[3], double *value);<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;  // get an interpolated value (meant for use by wrapper languages)<br>
&gt;&gt; &gt;&gt;  double GetSample(double x, double y, double z, int component);<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;  // set the scalar mode (same as vtkMapper scalar modes)<br>
&gt;&gt; &gt;&gt;  void SetScalarMode(int mode);<br>
&gt;&gt; &gt;&gt;  void SetScalarModeToDefault();<br>
&gt;&gt; &gt;&gt;  void SetScalarModeToUsePointData();<br>
&gt;&gt; &gt;&gt;  void SetScalarModeToUseCellData();<br>
&gt;&gt; &gt;&gt;  void SetScalarModeToUsePointFieldData();<br>
&gt;&gt; &gt;&gt;  void SetScalarModeToUseCellFieldData();<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;  // set the array, if chosen scalar mode is field data<br>
&gt;&gt; &gt;&gt;  void SetArrayName(const char *name);<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;  void SetTolerance(double);<br>
&gt;&gt; &gt;&gt;  void SetLocator(vtkLocator *locator);<br>
&gt;&gt; &gt;&gt; };<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; The changes are on gerrit, if people want to see the full<br>
&gt;&gt; &gt;&gt; implementation:<br>
&gt;&gt; &gt;&gt; <a href="http://review.source.kitware.com/2004" target="_blank">http://review.source.kitware.com/2004</a><br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;  - David<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; William J. Schroeder, PhD<br>
&gt; Kitware, Inc.<br>
&gt; 28 Corporate Drive<br>
&gt; Clifton Park, NY 12065<br>
&gt; <a href="mailto:will.schroeder@kitware.com">will.schroeder@kitware.com</a><br>
&gt; <a href="http://www.kitware.com" target="_blank">http://www.kitware.com</a><br>
&gt; <a href="tel:%28518%29%20881-4902" value="+15188814902">(518) 881-4902</a><br>
&gt;<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>William J. Schroeder, PhD<br>Kitware, Inc.<br>28 Corporate Drive<br>Clifton Park, NY 12065<br><a href="mailto:will.schroeder@kitware.com">will.schroeder@kitware.com</a><br>

<a href="http://www.kitware.com">http://www.kitware.com</a><br>(518) 881-4902<br>
</div>