[vtkusers] reslice problem
Matei MANCAS
matei.mancas at tcts.fpms.ac.be
Tue Feb 4 09:50:08 EST 2003
Hi all!!!
I use vtkImageReslice to change the view on a set of 348 slices in order to get coronal or sagital views...
My code is :
vtkRenderer *renderer;
vtkTIFFReader *noduleReader;
vtkImageMapper *noduleMapper;
vtkImageActor *noduleActor;
noduleReader = vtkTIFFReader::New();
noduleMapper = vtkImageMapper::New();
renderer = vtkRenderer::New();
noduleActor = vtkImageActor::New();
noduleMapper->SetColorWindow(255.0); // Width -- We are working in 8 bits...
noduleMapper->SetColorLevel(255.0/2); // Center
noduleReader->SetFilePrefix("..........");
noduleReader->SetFilePattern("%s%.4d.tif");
noduleReader->SetFileNameSliceOffset(1);
noduleReader->SetDataExtent(0,511,0,511,0,347);
noduleReader->SetDataSpacing(1,1,0.0);
// reslice
vtkImageReslice *reslice = vtkImageReslice::New();
reslice->SetInput(noduleReader->GetOutput());
reslice->SetResliceAxesDirectionCosines(1,0,0, 0,0,1, 0,1,0); // exchange y and z
reslice->SetOutputSpacing(1, 1, 1);
reslice->SetOutputExtent(0,511,0,511,0,347);
noduleActor->SetInput(reslice->GetOutput());
noduleActor->SetDisplayExtent(0,511,0,511,0,347);
noduleActor->SetZSlice(300);
renderer->AddActor(noduleActor);
It works well (I get the 300th slice when I don't use reslice) but I have a black screen using reslice->SetResliceAxesDirectionCosines(1,0,0, 0,0,1, 0,1,0); for exchanging y and z axes. I would want to see all my slices but
It is possible that it is due to the camera which has no more a view on the new object...
Can anyone help me please?????
Thanks
Matei
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20030204/c0c088fa/attachment.htm>
More information about the vtkusers
mailing list