[vtkusers] vtkGaussianSplatter problems

Javier Iparraguirre javierip at ieee.org
Mon Apr 2 13:22:44 EDT 2007


Hello,

I am using VTK version 4.2. I am reading a .raw file and the code 
compiles OK. The problem is that it iterates forever. Any ideas? Thank 
you in advance,

Javier.

//read from file
    MRIfile->SetFilePrefix (fileName);
    MRIfile->SetFilePattern ("%s");
    MRIfile->SetDataScalarType(4);
    MRIfile->SetDataByteOrder(0);
    MRIfile->SetFileDimensionality(3);
    MRIfile->SetDataOrigin(0, 0, 0);
    MRIfile->SetDataSpacing(1, 1, 1);
    MRIfile->SetDataExtent(0, samplesX-1, 0, samplesY-1, 0, samplesZ-1);
    MRIfile->SetNumberOfScalarComponents (1);
    MRIfile->SetDataScalarTypeToUnsignedShort ();
    MRIfile->SetDataVOI(xMin, xMax, yMin, yMax, zMin, zMax);
    
    Splatting = vtkGaussianSplatter::New();
        Splatting->SetInput((vtkDataSet *)MRIfile->GetOutput());
        Splatting->SetSampleDimensions(xMax-xMin , yMax-yMin, zMax-zMin);
        Splatting->SetRadius(0.05);
        Splatting->SetScaleFactor(1);
    
    tempFilter = vtkContourFilter::New();
        tempFilter->SetInput((vtkDataSet *)Splatting->GetOutput());
        tempFilter->SetValue(0, 0.01);
    
    tempMapper = vtkPolyDataMapper::New();
        tempMapper->SetInput(tempFilter->GetOutput());
        tempMapper->ScalarVisibilityOn();

    ActorSplatting = vtkActor::New();
        ActorSplatting->SetMapper(tempMapper);
        ActorSplatting->GetProperty()->SetDiffuseColor(1, 0, 0);
        ActorSplatting->SetPosition(0, 10, 0);
        ActorSplatting->VisibilityOn();




More information about the vtkusers mailing list