strange problem

Tian-Qing Ye tianqing.ye at bruker.co.uk
Wed Nov 17 08:30:01 EST 1999


Dear friends

I run into a funny problem. I would like to
save each slice into an array of 2D actors.

    vtkActor2D *sliceA[32];
    vtkImageViewer *imgviewer;
    imgviewer = new vtkImageViewer();
    imgviewer->SetColorWindow(255);
    imgviewer->SetInput(imgdata);

    for(i = 0; i < 32; i++) 
    {   
        imgviewer->SetZSlice(i); 
        sliceA[i] = imgviewer->GetActor2D(); 
        sliceA[i]->SetDisplayPosition(0, 0);
        rend[i]->AddActor2D(sliceA[i]);
        renW[i]->Render();
    }

It will display all the slices correctly. 
BUT!!! It seems from now on, all the sliceA[i]
are updated to the last slice! For example
if later I try

    for(i = 0; i < imgsize; i++) 
    { 
        removeLastActor(rend[i]);       // remove the previous actor
        rend[i]->AddActor2D(sliceA[i]);
        renW[i]->Render();
    }

what i got are the last slice in all the render windows.

I think it might be something to do with the automatical
update of the pipeline. Anyone can tell me how can I savely
store all the slices to an array of 2D Actors?

Thanks!

Ye


-----------------------------------------------------------------------------
This is the private VTK discussion list.  Please keep messages on-topic.
Check the FAQ at: <http://www.automatrix.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at gsao.med.ge.com>.  For help, send message body containing
"info vtkusers" to the same address.     Live long and prosper.
-----------------------------------------------------------------------------




More information about the vtkusers mailing list