[vtkusers] Unsatisfied Link Error : vtk.vtkVolumeTextureMapper3D.VTKInit()J

Divye zombi2_84 at yahoo.com
Wed Oct 21 19:34:22 EDT 2009


Hi All,

I am getting the above error while trying to run a program that reads DICOM images and does 3d visualization.
After searching through the mailing list, I found similar posts, but none of them solved the problem .
I included the static code block :
static { 
            System.loadLibrary("vtkCommonJava"); 
            System.loadLibrary("vtkFilteringJava"); 
            System.loadLibrary("vtkIOJava"); 
            System.loadLibrary("vtkImagingJava"); 
            System.loadLibrary("vtkGraphicsJava"); 
            System.loadLibrary("vtkRenderingJava"); 
          }

and made sure the system variables are set correctly. Still no luck :(

Can someone lend a helping hand? Any help is appreciated.
Here is the code :

public class WrapperVtkRenderVolume {
    
    vtkRenderer renderer = new vtkRenderer();
    vtkRenderWindow renderWindow = new vtkRenderWindow();
    vtkRenderWindowInteractor renInteractor = new vtkRenderWindowInteractor();
    vtkImageData imageData = new vtkImageData();
    vtkPiecewiseFunction opacityTransferFunction = new vtkPiecewiseFunction();
    vtkVolumeProperty volumeProperty = new vtkVolumeProperty();
    vtkVolume volume = new vtkVolume();
    vtkVolumeTextureMapper3D volumeMapper = new vtkVolumeTextureMapper3D();
    vtkColorTransferFunction colorTransferFunction = new vtkColorTransferFunction();
    vtkFixedPointVolumeRayCastMapper volumeMapperSoftware = new vtkFixedPointVolumeRayCastMapper();

    public WrapperVtkRenderVolume(int cxWin, int cyWin) {
        
        SetupSceneBasics();
        
        ResetSize(cxWin, cyWin);
    }

    private void ResetSize(int cxWin, int cyWin) {
        renderWindow.SetSize(cxWin, cyWin);
        
    }

    private void SetupSceneBasics() {
        renderer.SetBackground(0, 0, 0);
        renderWindow.AddRenderer(renderer);
        renInteractor.SetRenderWindow(renderWindow);
        
       
    }

    public boolean LoadVolumeFromFolder(String strFolderPath) {
        renderWindow.Render();
        
        vtkDICOMImageReader imageReader = new vtkDICOMImageReader();
        
        switch (imageReader.GetNumberOfScalarComponents()) {
        case 3:
            LoadColorDataset(imageReader.GetOutput());
            SetupRendererVolume();
            break;
        }
        
        imageReader.Delete();
        renderer.ResetCamera();
        
        return true;
    }

    private boolean SetupRendererVolume() {
        opacityTransferFunction.AddPoint(0, 0);
        opacityTransferFunction.AddPoint(255, 1);
        volumeProperty.SetIndependentComponents(0);
        volumeProperty.SetScalarOpacity(opacityTransferFunction);
        volumeProperty.SetInterpolationTypeToLinear();
        volumeProperty.ShadeOff();
        volume.SetProperty(volumeProperty);
        
        volumeMapper.SetInput(imageData);
        if(isRenderSupported()) {
            volumeMapper.SetSampleDistance(1.0);
            volume.SetMapper(volumeMapper);
            renderer.AddVolume(volume);
        } else {
            System.out.println("Your graphics board does not support the vtkVolumeTextureMapper3D class");
            return false;
        }
        
        return true;
        
    }
    private boolean isRenderSupported() {
        return (volumeMapper.IsRenderSupported(volumeProperty) == 1)?true:false;
    }

    private void LoadColorDataset(vtkImageData imageDataFromReader) {
        imageData.SetScalarTypeToUnsignedChar();
        imageData.SetNumberOfScalarComponents(4);
        imageData.SetDimensions(imageDataFromReader.GetDimensions());
        imageData.SetSpacing(imageDataFromReader.GetSpacing());
        imageData.SetOrigin(imageDataFromReader.GetOrigin());
        imageData.AllocateScalars();
        for(int z = 0; z < imageData.GetDimensions()[2]; z++) {
            //TODO : this is incomplete
        }
        
    }

    public void Start() {
        renInteractor.Initialize();
        renInteractor.Start();
        
    }

}



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


More information about the vtkusers mailing list