[vtkusers] Desperate need of help with vtkImageReslice !!

Naoko TAKAYA takaya at cv.cs.ritsumei.ac.jp
Sun Sep 15 19:48:20 EDT 2002


Dear VTK-users!!

I'm trying to extract slice from volume but it's not
working... 

Please tell me what I'm missing out ?

Also, I don't exactly know what SetResliceAxesOrigin
and SetOutputOrigin does...

My brief code is as follows;
------------------------------------------------------------
vtkUnsignedCharArray *vScalars = vtkUnsignedCharArray::New();
vtkRendererer *vRenderer = vtkRenderer::New();
vtkStructuredPoints *vVol = vtkStructuredPoitns::New();
	vVol -> SetDimensions(512,512,300);
	vVol -> SetSpacing(1, 1, 1);
	vVol -> GetPointData()->SetScalars(vScalars);
	vVol -> Update();
vtkImageReslice *vReslice = vtkImageReslice::New();
	vReslice -> SetInput(vVol);
	vReslice -> InterpolateOn();
	vReslice -> SetResliceAxesDirectionCosines(1,0,0, 0,-1,0, 0,0,1);
	vReslice -> SetOutputDimensionality(2);
	vReslice -> SetOutputExtent(0,512,0,0,0,300);
	vReslice -> SetOutputSpacing(1, 1, 1);
	vReslice -> SetResliceAxesOrigin(200,200,50);
	vReslice -> SetOutputOrigin(0, 0, 0);
vtkImageMapper *vImgMapper = vtkImageMapper::New();
	vImgMapper -> SetInput(vReslice->GetOutput());
	vImgMapper -> SetColorWindow(255);
	vImgMapper -> SetColorLevel(127.5);
vtkActor2D *vActor2D = vtkActor2D::New();
	vActor2D -> SetMapper(vImgMapper);
vRenderer -> AddActor2D(vActor2D);
------------------------------------------------------------------

Please give me advice!!
(and please excuse my English....)

Thank you in advance !!

Naoko Takaya

******************************************************

Naoko Takaya 
Computer Vision Laboratory
Department Computer Science
Faculty of Science and Engineering
Ritsumeikan University

e-mail: takaya at cv.cs.ritsumei.ac.jp
HP: http://www.cv.cs.ritsumei.ac.jp/~takaya/

*******************************************************




More information about the vtkusers mailing list