[vtkusers] translation of an imageActor-image

Lars Matthäus lars.matthaeus at web.de
Thu Mar 17 13:50:55 EST 2005


Hi,

I try to stack several images on top of each other by creating several imageActors and having them translated. The docu says that the image produced by imageActor is placed at the origin at the imageData image. So I set the origin for each imageData differently and called imageActor. But that doesn't work. The pictures are placed all the same and overlay.  (I append a fragment of the JAVA-code to make it clearer.) Any ideas?

Thanks

Lars

            for (int i = 40; i < 45; i++) {  //reading pic 40 to 44
                vtkDICOMImageReader dicomImage = new vtkDICOMImageReader();
                dicomImage.SetFileName((String) dicoms.get(i));  //dicoms is a list containing the filenames
                vtkImageData imageData = new vtkImageData();
                imageData = dicomImage.GetOutput();
                
                //needed for correct cast to unsigned char:
                imageData.Update();
                minmax = imageData.GetScalarRange();
                vtkImageShiftScale imageShift = new vtkImageShiftScale();
                imageShift.SetInput(imageData);
                imageShift.SetShift(-1.0*minmax[0]);
                imageShift.SetScale(255.0/(minmax[1]-minmax[0]));
                imageShift.SetOutputScalarTypeToUnsignedChar();

                vtkImageData imageData2 = new vtkImageData();
                imageData2 = imageShift.GetOutput();
                imageData2.SetOrigin(100*i,100*i,100*i);
                
                vtkImageActor imageActor = new vtkImageActor();
                imageActor.SetInput(imageData2);
                renWin.GetRenderer().AddActor(imageActor);
            }
__________________________________________________________
Mit WEB.DE FreePhone mit hoechster Qualitaet ab 0 Ct./Min.
weltweit telefonieren! http://freephone.web.de/?mc=021201




More information about the vtkusers mailing list