Hi again,

It seems the vtkImageResample filter (and it's parent vtkImageReslice probably too) does not give the output array a name (unless no resampling is done).

This would seem to be a bug. However, I couldn't follow the code in vtkImageReslice to see where the name could be set or what the problem is.

Cheers
Bryn







Bryn Lloyd wrote:
Hi,

I have tried it in a similar way with no success.


It works though using following Set-methods:

//----------------------------------------------------------------------------
void vtkImageResample2::SetOutputSpacing(double v[3])
{
  this->SetOutputSpacing(v[0],v[1],v[2]);
}

//----------------------------------------------------------------------------
void vtkImageResample2::SetOutputSpacing(double v0,double v1,double v2)
{
  this->SetAxisOutputSpacing(0,v0);
  this->SetAxisOutputSpacing(1,v1);
  this->SetAxisOutputSpacing(2,v2);
}



With standard xml description:

      <DoubleVectorProperty
         name="OutputSpacing"
         command="SetOutputSpacing"
         number_of_elements="3"
         default_values="0 0 0" >
      </DoubleVectorProperty>



I have place the code here:

http://www.vision.ee.ethz.ch/~blloyd/vtkImageResample2/



This seems to work (extent is changed say for MagnifactionFactos="0.5 0.5 1.0"). But the image data becomes invisible. I think it converts the PointData->Arrays to some other form, e.g. image scalars or something, which paraview doesn't display.


--Bryn










Jérôme wrote:
Hi,

I tried to do what you talked about, because I need isotropic volumes
for a number of algorithms. I think it is the same for you, right?

I wrote an xml file that you can load in the plugin manager menu,
according to this wiki page:
   http://paraview.org/Wiki/Plugin_HowTo#Enabling_a_filter_in_VTK

The problem is that the VTK filter seems not to be paraview-compliant:
it didn't work, but unfortunately I didn't have time to describe the
bugs. I joint the xml file, so that you can try and please tell me if
it works for you -then I may guess it is because of my settings...-.

In a nutshell, here are my problems for a volume of spacing 0.5x0.5x1
that I want to be 0.5x0.5x0.5 ie magnification factor = 0.5 on axis z
(= 2)
- The filter updates, but the extent does not change in the output
- When representation of input is 'Slice', the output dimensionality is 2 !!!

I hope someone could find the mistake, wherever it comes (my xml,
paraview, or VTK)

I also write a Cxx class that inherites from vtkImageResample and
computes automatically the magnification factor depending on a
user-chosen reference axis (in my example, x or y). Today, I use an
independent executable that converts an input mhd file into an
isotropic volume, and then I open it in paraview. I would be glad if
this step is part of a paraview pipeline, but my inherited class has
the same behaviour than vtkImageResample (and I think that when I
tried with the parent class vtkImageReslice, the same problem
occured...).

Jerome

2009/1/30 Bryn Lloyd <bll...@vision.ee.ethz.ch>:
Dear VTK Developers


I would like to use the vtkResampleImage class in Paraview (plugin). For
this purpose it would be helpful if in addition to the methods

SetAxisMagnificationFactor (int axis, double factor)
SetAxisOutputSpacing (int axis, double spacing)


which are valid for axis 0,1 and 2, following new functions could be added:

SetAxisMagnificationFactor (double, double, double)
SetAxisOutputSpacing (double, double, double)


i.e. taking values for all three axis directions simultaneously.


Could this be done?


Thanks in advance!

Bryn




--
-------------------------------------------------
Bryn Lloyd
Computer Vision Laboratory
ETH Zürich, Sternwartstrasse 7
CH - 8092 Zürich, Switzerland
Tel: +41 44 63 26668
Fax: +41 44 63 21199
-------------------------------------------------
_______________________________________________
ParaView mailing list
ParaView@paraview.org
http://www.paraview.org/mailman/listinfo/paraview





--
-------------------------------------------------
Bryn Lloyd
Computer Vision Laboratory
ETH Zürich, Sternwartstrasse 7
CH - 8092 Zürich, Switzerland
Tel: +41 44 63 26668
Fax: +41 44 63 21199
-------------------------------------------------
_______________________________________________
ParaView mailing list
ParaView@paraview.org
http://www.paraview.org/mailman/listinfo/paraview

Reply via email to