[vtkusers] vtkPolyDataReader setting all entries in lookup table to 0, 0, 1, 1

jarv0075 jarv0075 at umn.edu
Fri Jul 30 12:56:14 EDT 2004


 
I'm reading in a vtk file containing point data, scalardata, and a lookup
table (no polygons)

The reader seems to do 'ok' (lookup table is the right size, it's "there")
but then all scalar values are set to solid red, even though the file
definitely shows otherwise.

Any help you could offer would be greatly appreciated

File:
---------------------
# vtk DataFile Version 3.0
vtk output
ASCII
DATASET POLYDATA
POINTS 35733 float
          89         129          38
          92         133          38
         109         134          38
          92         137          38
 ...

POINT_DATA 35733
SCALARS fissure float
LOOKUP_TABLE lut
      1.33378      2.53017      4.06563      5.40733      3.96479     
2.62759
      3.41413      5.15682      3.77362      1.58374      1.22385     
4.84766
      2.56611      2.34867      4.97052      1.62656      4.36051     
1.86560

 ...

LOOKUP_TABLE lut 100
      0.00000      0.00000      1.00000      1.00000
      0.00000    0.0404040      1.00000      1.00000
      0.00000    0.0808081      1.00000      1.00000

...

-------------------------

Code:
proc PointOverlay {} {
	set types {
		{{Scalar Point Data}  {*.spd}  }
		{{All Files }                          *           }
	}

    set filename [tk_getOpenFile -filetypes $types]

	vtkPolyDataReader reader
	reader SetFileName $filename
	reader SetScalarsName "fissure"
        reader SetLookupTableName "lut"

  	reader SetStartMethod {StartProgress reader "Reading..."}
        reader SetProgressMethod {ShowProgress reader "Reading..."}
 	reader SetEndMethod EndProgress
        reader Update

vtkSphereSource sphere
     sphere SetThetaResolution 6
     sphere SetPhiResolution 5
     sphere SetRadius 1.0
    
    glyph SetInput [reader GetOutput]
    glyph SetSource [arrow GetOutput]
	glyph SetVectorModeToUseNormal 
	glyph SetScaleModeToScaleByVector 
	glyph SetScaleFactor 2.0
	

spikeMapper SetLookupTable [[[[reader GetOutput] GetPointData] GetScalars]
GetLookupTable]

	spikeMapper SetScalarModeToUsePointData
	spikeMapper SetScalarVisibility 1
    
polyData Modified
	spikeMapper SetInput [glyph GetOutput] 

     puts [[[[[reader GetOutput] GetPointData] GetScalars] GetLookupTable]
GetColor 3]


	spikeActor SetMapper spikeMapper
	ren AddActor spikeActor

}



---------------------------------------
 Timothy R. Jarvis                   
---------------------------------------
Graduate Research Assistant 
International Neuroimaging Consortium
VA Medical Center
612-467-2619
http://www.neurovia.umn.edu
---------------------------------------




More information about the vtkusers mailing list