Okay thanks, assuming we document this in some manner (wiki or VTK Journal article) let's put a placeholder for some other potential algorithms. I know in DTI and other medical applications they are computing "streamlines" 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"><<a href="mailto:david.gobbi@gmail.com">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;">

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