[vtkusers] Reslice Question - please help!

jflovell at engmail.uwaterloo.ca jflovell at engmail.uwaterloo.ca
Thu Sep 11 00:55:36 EDT 2003


Hi, vtkusers, I'm sorry, i'm new to vtk and here is yet another vtkimagereslice
question. I've searched the archive and read the documentation, but haven't
found anything to help me.

I need to move slices around a volume quickly. Therefore I create 3 sets of
vtkimagereslice slices (for a total of {xdim + ydim + zdim} slices). Should i be
caching this many vtkimagereslices? Should I be caching their mappers instead? 

Should I be using dimensionality of 2 or 3? vtkImageReslice can output either.
The slices themselves are two dimensional, but they are in a 3D environment.


vtkRenderer* ren = vtkRenderer::New();
vtkimagedata* imagedata = reader->read3Ddatafile();

//many of these slices get created in a loop
{
vtkImageReslice* a_z_slice = vtkImageReslice::New();
a_z_slice ->SetInput->(imagedata ->GetOutput());
a_z_slice ->SetDirectionAxisCosines(1,0,0,0,1,0,0,0,1);
a_z_slice ->SetOutputExtent(0,x,0,y, 0, 0);
a_z_slice ->SetResliceAxisOrigin( a,b,c);//any place in the image
}

//later
vtkDataSetMapper* map = new vtkDataSetMapper::New();
map->SetInput(a_z_slice->GetOutput());
vtkActor* act = vtkActor::New();
act->SetMapper(map);
ren->AddActor(act);
//is this a good way? something is wrong i think.



Thank you for taking the time to read this, any answers will be greatly
appreciated.

Sincerely,
J Lovell



----------------------------------------
This mail sent through www.mywaterloo.ca



More information about the vtkusers mailing list