[vtkusers] Shrinking volume data makes VTK to crash

Mathieu Malaterre mathieu.malaterre at kitware.com
Tue Mar 16 15:19:17 EST 2004


Cristian,

	This works for me (using VTK CVS):

#!/usr/bin/env python

import vtk
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()

reader = vtk.vtkImageReader()
reader.SetDataByteOrderToLittleEndian()
reader.SetDataExtent(0, 63, 0, 63, 1, 93)
reader.SetFilePrefix ( VTK_DATA_ROOT + "/Data/headsq/quarter")

shrink = vtk.vtkShrinkFilter();
shrink.SetInput(reader.GetOutput())
shrink.SetShrinkFactor(0.5)
shrink.Update();


You are doing something funky with your vtkImageReader, I guess this is 
the problem.

HTH
mathieu

Cristian Luciano wrote:
> Hi everyone,
>  
> Have you tried to shrink a volume data (using vtkShrinkFilter)?
> The volume data comes from the visible woman.
> VTK crashes when trying to shrink data. And so does Paraview too!
>  
> The C++ code is as follows:
>  
> //****************************************************************
>  vtkImageReader *BodyVolume = vtkImageReader::New();
>   BodyVolume->SetFilePrefix (fileName);
>   BodyVolume->SetFilePattern ("%s");
>   BodyVolume->SetDataScalarType(4);
>   BodyVolume->SetDataByteOrder(0);
>   BodyVolume->SetFileDimensionality(3);
>   BodyVolume->SetDataOrigin(0, 0, 0);
>   BodyVolume->SetDataSpacing(1, 1, 1);
>   BodyVolume->SetDataExtent(0, 255, 0, 255, 0, 577);
>   BodyVolume->SetNumberOfScalarComponents (1);
>  
>  vtkShrinkFilter *shrink = vtkShrinkFilter::New();
>   shrink->SetInput((vtkDataSet *)BodyVolume ->GetOutput());
>   shrink->SetShrinkFactor(0.5);
>   shrink->Update();
> //****************************************************************
>  
> Any ideas? Thanks in advance.
>  
> Cristian
>  
> __________________________________________________________
>  
> Cristian J. Luciano
> Research Computer Scientist
>  
> Electronic Visualization Laboratory
> Industrial Virtual Reality Institute
>  
> University of Illinois at Chicago
> 842 W. Taylor Street, 2039 ERF
> Chicago, IL, 60607
> ph: (312) 996-0579
> fax: (312) 413-0447
> <http://www.evl.uic.edu>
> __________________________________________________________
>  
>  
>  






More information about the vtkusers mailing list