[vtkusers] vtkExtractROI wrong bounds ??
Adeline Joliet
adeline_joli at hotmail.com
Mon Feb 22 11:01:41 EST 2010
Hello everyone,
I ran into a problem using vtkExtractROI filter. It seems that the bounds I set using "SetVOI" are not correct... They are too big.
To test I did something like that. I created a VOI with this bounds (30,106,0,80,0,60) and I displayed the obtained dataset. Then
I create a vtkCubeSource with the same bounds (except for the x like that the 2 objects are not overlapping and we can see who is who) and when I displayed
it we clearly see that the Z dimension are not the same !?!?! here a the piece of code to see what I'm doing
///// Creation of the VOI
vtkExtractVOI * extractor = vtkExtractVOI::New();
vtkImageData * originalMaskVtkImageData = GetMyImageData ();
extractor->SetInput(originalMaskVtkImageData);
extractor->SetVOI(30,106,0,80,0,60);
extractor->Update();
vtkDataSetMapper *m = vtkDataSetMapper::New();
m->SetInput(vtkDataSet::SafeDownCast(extractor->GetOutput()));
vtkActor * v = vtkActor::New();
v->SetMapper(m);
m_renderer->AddActor(v);
////// Creation of the Cube
vtkCubeSource * cube = vtkCubeSource::New();
b[0] = 0;
b[1] = 106;
b[2] = 0;
b[3] = 80;
b[4] = 0;
b[5] = 60;
cube->SetBounds(b);
vtkPolyDataMapper *m2 = vtkPolyDataMapper::New();
m2->SetInput(cube->GetOutput ());
vtkActor * v2 = vtkActor::New();
v2->SetMapper(m2);
m_renderer->AddActor(v2);
here a screenshot showing the problem
<a target='_blank' title='ImageShack - Image And Video Hosting' href='http://img186.imageshack.us/i/errorpf.jpg/'><img src='http://img186.imageshack.us/img186/882/errorpf.jpg' border='0'/></a>
http://img186.imageshack.us/img186/882/errorpf.jpg
Does someone know why and how can I have the correct bounds ?
Regards,
Adeline
_________________________________________________________________
Tchattez en direct en en vidéo avec vos amis !
http://www.windowslive.fr/messenger/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100222/f7cca3cb/attachment.htm>
More information about the vtkusers
mailing list