Hi,<br><br>This is an up of this old thread. I have problems with vtkImageResample. I wrote an XML that exposes this filter to ParaView, and vtkImageGaussianSource and vtkImageMagnitude too. Please, could you try that and tell me if you can reproduce this behaviour ?<br>
- Load plugin as XML<br>- Create a Gaussian Source and Apply with default settings<br>- Plug an Image Resample proxy to the Gaussian Source output<br>- Set Spacing to 0.5 0.5 0.5<br>- Apply.<br><br>Then, a normal behaviour would be for ImageResample to produce a volume with Extent twice more than input, so dimension (256, 256, 256). This is not the case. Extent is blocked to 0 127 0 127 0 127. With the given spacing, the bounding box is smaller than the input! You can try with a down-sampling of the input: set Spacing to 2 2 2 in Image Resample object property panel, Apply. Extent is twice less than input, Spacing twice more: bounding box is the same, this behaviour is correct.<br>
<br>It acts like there is a saturation of the output extent according to the input one. I didn&#39;t note that problem within a python script (outside ParaView) and with an VTK-only dependent executable.<br><br>Find attached the XML.<br>
<br>Thanks for your time! <br>Best regards,<br><br>Jerome<br>WIndows XP SP3, ParaView CVS, VS2008X<br><br><div class="gmail_quote">2009/1/30 Bryn Lloyd <span dir="ltr">&lt;<a href="mailto:blloyd@vision.ee.ethz.ch">blloyd@vision.ee.ethz.ch</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi again,<br>
<br>
It seems the vtkImageResample filter (and it&#39;s parent vtkImageReslice probably too) does not give the output array a name (unless no resampling is done).<br>
<br>
This would seem to be a bug. However, I couldn&#39;t follow the code in vtkImageReslice to see where the name could be set or what the problem is.<br>
<br>
Cheers<br><font color="#888888">
Bryn</font><div><div></div><div class="h5"><br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
Bryn Lloyd wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
<br>
I have tried it in a similar way with no success.<br>
<br>
<br>
It works though using following Set-methods:<br>
<br>
//---------------------------------------------------------------------------- <br>
void vtkImageResample2::SetOutputSpacing(double v[3])<br>
{<br>
  this-&gt;SetOutputSpacing(v[0],v[1],v[2]);<br>
}<br>
<br>
//---------------------------------------------------------------------------- <br>
void vtkImageResample2::SetOutputSpacing(double v0,double v1,double v2)<br>
{<br>
  this-&gt;SetAxisOutputSpacing(0,v0);<br>
  this-&gt;SetAxisOutputSpacing(1,v1);<br>
  this-&gt;SetAxisOutputSpacing(2,v2);<br>
}<br>
<br>
<br>
<br>
With standard xml description:<br>
<br>
      &lt;DoubleVectorProperty<br>
         name=&quot;OutputSpacing&quot;<br>
         command=&quot;SetOutputSpacing&quot;<br>
         number_of_elements=&quot;3&quot;<br>
         default_values=&quot;0 0 0&quot; &gt;<br>
      &lt;/DoubleVectorProperty&gt;<br>
<br>
<br>
<br>
I have place the code here:<br>
<br>
<a href="http://www.vision.ee.ethz.ch/%7Eblloyd/vtkImageResample2/" target="_blank">http://www.vision.ee.ethz.ch/~blloyd/vtkImageResample2/</a><br>
<br>
<br>
<br>
This seems to work (extent is changed say for MagnifactionFactos=&quot;0.5 0.5 1.0&quot;). But the image data becomes invisible. I think it converts the PointData-&gt;Arrays to some other form, e.g. image scalars or something, which paraview doesn&#39;t display.<br>

<br>
<br>
--Bryn<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
Jérôme wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
<br>
I tried to do what you talked about, because I need isotropic volumes<br>
for a number of algorithms. I think it is the same for you, right?<br>
<br>
I wrote an xml file that you can load in the plugin manager menu,<br>
according to this wiki page:<br>
   <a href="http://paraview.org/Wiki/Plugin_HowTo#Enabling_a_filter_in_VTK" target="_blank">http://paraview.org/Wiki/Plugin_HowTo#Enabling_a_filter_in_VTK</a><br>
<br>
The problem is that the VTK filter seems not to be paraview-compliant:<br>
it didn&#39;t work, but unfortunately I didn&#39;t have time to describe the<br>
bugs. I joint the xml file, so that you can try and please tell me if<br>
it works for you -then I may guess it is because of my settings...-.<br>
<br>
In a nutshell, here are my problems for a volume of spacing 0.5x0.5x1<br>
that I want to be 0.5x0.5x0.5 ie magnification factor = 0.5 on axis z<br>
(= 2)<br>
- The filter updates, but the extent does not change in the output<br>
- When representation of input is &#39;Slice&#39;, the output dimensionality is 2 !!!<br>
<br>
I hope someone could find the mistake, wherever it comes (my xml,<br>
paraview, or VTK)<br>
<br>
I also write a Cxx class that inherites from vtkImageResample and<br>
computes automatically the magnification factor depending on a<br>
user-chosen reference axis (in my example, x or y). Today, I use an<br>
independent executable that converts an input mhd file into an<br>
isotropic volume, and then I open it in paraview. I would be glad if<br>
this step is part of a paraview pipeline, but my inherited class has<br>
the same behaviour than vtkImageResample (and I think that when I<br>
tried with the parent class vtkImageReslice, the same problem<br>
occured...).<br>
<br>
Jerome<br>
<br>
2009/1/30 Bryn Lloyd &lt;<a href="mailto:blloyd@vision.ee.ethz.ch" target="_blank">blloyd@vision.ee.ethz.ch</a>&gt;:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Dear VTK Developers<br>
<br>
<br>
I would like to use the vtkResampleImage class in Paraview (plugin). For<br>
this purpose it would be helpful if in addition to the methods<br>
<br>
SetAxisMagnificationFactor (int axis, double factor)<br>
SetAxisOutputSpacing (int axis, double spacing)<br>
<br>
<br>
which are valid for axis 0,1 and 2, following new functions could be added:<br>
<br>
SetAxisMagnificationFactor (double, double, double)<br>
SetAxisOutputSpacing (double, double, double)<br>
<br>
<br>
i.e. taking values for all three axis directions simultaneously.<br>
<br>
<br>
Could this be done?<br>
<br>
<br>
Thanks in advance!<br>
<br>
Bryn<br>
<br>
<br>
<br>
<br>
-- <br>
-------------------------------------------------<br>
Bryn Lloyd<br>
Computer Vision Laboratory<br>
ETH Zürich, Sternwartstrasse 7<br>
CH - 8092 Zürich, Switzerland<br>
Tel: +41 44 63 26668<br>
Fax: +41 44 63 21199<br>
-------------------------------------------------<br>
_______________________________________________<br>
ParaView mailing list<br>
<a href="mailto:ParaView@paraview.org" target="_blank">ParaView@paraview.org</a><br>
<a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
<br>
</blockquote></blockquote>
<br>
<br>
</blockquote>
<br>
<br>
-- <br>
-------------------------------------------------<br>
Bryn Lloyd<br>
Computer Vision Laboratory<br>
ETH Zürich, Sternwartstrasse 7<br>
CH - 8092 Zürich, Switzerland<br>
Tel: +41 44 63 26668<br>
Fax: +41 44 63 21199<br>
-------------------------------------------------<br>
</div></div></blockquote></div><br>