[vtkusers] How to avoid model splatting on a ImageData
arturo_caissut at tiscali.it
Mon Mar 9 17:46:45 EDT 2009
I need to read a PolyData 3D model, pass it through two filters
(implicit modeller & image threshold) and then save the resulting image
on a ImageData.
My problem is that I don't want the resulting model image to be
"splatted" all over the ImageData extension (with a deformation as a
collateral result), but I cannot avoid this.
Maybe I'm making some confusion between implicit modeller
SetSampleDimensions and SetModelBounds, but I'm not sure.
I'll try to explain myself with an example: let's say I have a radius=4
circle stored into a polydata. My aim is to create a 50x50x50 MetaImage
file whit a radius 4 " donut"on the center, and a lot of "free space"
all around. I think I should procede with something like:
vtkPolydataReader *reader = vtkPolyDataReader::New();
vtkImplicitModeller *implicit = vtkImplicitModeller::New();
implicit->SetMaximumDistance(1); //I don't want my donut to be
implicit->SetSampleDimensions(50, 50, 50); //Is this correct?
vtkImageData *image = vtkImageData::New();
image->SetDimensions(50, 50, 50);
image->SetOrigin(0.0, 0.0, 0.0);
image = implicit->GetOutput();
vtkMetaImageWriter *miwriter = vtkMetaImageWriter::New();
But this doesn't work.
Can you find any error?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the vtkusers