[vtkusers] how to interpolate between few data points in imagedata

Quang Tran quangt.security at gmail.com
Wed Nov 2 21:58:25 EDT 2011


Hi,
You should resample the origin image to have a better image in higher
resolution. I think with your currently solution, the quality of images on
sagittal or coronal not good because the distance between two slices is too
long.

 You should use vtkImageResample to resample the image before displaying
(this is also interpolate too). Here is an example code:

        vtkSmartPointer<vtkImageData> OriginImageData; /** Your origin
image  */
        ...

 // Object for resampling
vtkSmartPointer<vtkImageResample> resample =
vtkSmartPointer<vtkImageResample>::New();
 resample->SetInput(OriginImageData);
resample->SetInterpolationModeToLinear(); // Set type of interpolation here
if you need
 resample->SetAxisMagnificationFactor(2, MagnificationZ); // ex. Change the
resolution along OZ
resample->SetAxisMagnificationFactor(1, MagnificationY); // and OY
 resample->SetAxisMagnificationFactor(0, MagnificationX);
resample->Update();
        ....
       vtkSmartPointer<vtkImageData>
ResampledImageData(resample->GetOutput());

After that, you can use ResampledImageData for further processing.

/Quang

2011/11/2 Hikaruchan <Sandra.Schroetter.fl at ait.ac.at>

> Hi everybody!
>
> I have a little problem, which takes me nearly a week now to find a
> solution. I have an application with four renderviews where I display
> MRI-Data in three 2D Views (sagittal, coronal and axial) and one for a 3D
> View. That works fine.
>
> But now I have some electric density values which I want to visualize. The
> visualization itself is not the problem. The Problem is, that the points
> are
> arround 8-10 pixels away from each other (as I want them to visualize I put
> them into a vtkImageData), and I have tried to interpolate it, but the
> interpolation takes to much time. My last try which brought the best
> resulat
> was:
>
> 1. load the electric density data
> 2. put them into an imagedata and "blow up" the pixel which stands for the
> density value
>
> 3. make a vtkImageGaussianSmooth with dimensionality 3 with
> standarddeviation (3,3,3)
> 4. make a vtkImageMedian3D with kernelsize(5,5,5)
>
> I understand that that takes long, so I desiced to make it in 2D for every
> slice which works "ok". But it is not effective enough. So my question is,
> is there a better way to interpolate the data in vtkImagedata? The reason
> why it must be effective is, that it is time critical, I have around half a
> second before I must interpolate the next electric density data.
>
> Do anybody know what is the way to do it right? I think what I have done,
> is
> far away from the best solution ;-) So I would be glad if somebody could
> help me and give me an idea for a better solution of the problem.
>
> Dear
>
> Hikaruchan
>
> --
> View this message in context:
> http://vtk.1045678.n5.nabble.com/how-to-interpolate-between-few-data-points-in-imagedata-tp4958600p4958600.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20111102/2f69b751/attachment.htm>


More information about the vtkusers mailing list