[vtkusers] RV: vtkimageactor's SetZSlice

Marcelino Rodriguez Cancio marcelinorc at uclv.edu.cu
Mon Dec 26 12:16:47 EST 2011


You must not get the Extent From the Actor->DisplayExtent but from the vtkImageData->GetWholeExtent() method instead.

Like this:

void SetZSlice(int z)
{

vtkImageData * img = jpgreader-> GetOutputDataObject<file:///D:\ALL%20DOCs\Documentation\TK\VTK\vtkDocHtml-5.4.2\html\a00101.html#4cb9f809072a01646f39a168db7a5b5e>(0)
double * ext = img->GetWholeExtent();
this->SetDisplayExtent(ext [0], ext [1], ext [2], ext [3],  z, z);

}

Cheers
Marcelino

De: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] En nombre de 455535440
Enviado el: domingo, 25 de diciembre de 2011 10:30 a.m.
Para: vtkusers
Asunto: [vtkusers] vtkimageactor's SetZSlice

merry christmas everybody.
I met a problem of vtkimageactor,I used jpegreader to read 12 pictures ,then used vtkimageactor to show it,one of these jpegs was rendered.then i wanted to show another pictures ,So I called SetZSlice but it didn't work. I watch the souce of the method like below:
void SetZSlice(int z)
{this->SetDisplayExtent(
    this->DisplayExtent[0], this->DisplayExtent[1],
    this->DisplayExtent[2], this->DisplayExtent[3], z, z);}
then I debug the program,the vtkimageactor's DisplayExtent is an array of 6 int ,valus -1,0,0,0,0,0, this is strange .Then I watch the vtkImageData which vtkimageactoe setinput,there is an arry named extent in it values 0 383 0 383 0 11, I think this means the picture data is saved,but why the method didn't work?
I google this problem and find some people met the same problem,but there is no solution. Anyone can help us?

________________________________
- XIII Simposio Internacional sobre Pensamiento Latinoamericano, del 26 al 27 de junio de 2012. Universidad Central “Marta Abreu” de Las Villas, Santa Clara, Cuba. http://www.uclv.edu.cu/13simp-pensamiento-latinoamericano
-Universidad Central "Marta Abreu" de Las Villas. http://www.uclv.edu.cu
-Participe en Universidad 2012, del 13 al 17 de febrero de 2012. Habana.Cuba. http://www.congresouniversidad.cu
-Consulte la enciclopedia colaborativa cubana. http://www.ecured.cu/

________________________________
- XIII Simposio Internacional sobre Pensamiento Latinoamericano, del 26 al 27 de junio de 2012. Universidad Central “Marta Abreu” de Las Villas, Santa Clara, Cuba. http://www.uclv.edu.cu/13simp-pensamiento-latinoamericano
-Universidad Central "Marta Abreu" de Las Villas. http://www.uclv.edu.cu
-Participe en Universidad 2012, del 13 al 17 de febrero de 2012. Habana.Cuba. http://www.congresouniversidad.cu
-Consulte la enciclopedia colaborativa cubana. http://www.ecured.cu/


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20111226/f56e4281/attachment.htm>


More information about the vtkusers mailing list