<div style="FONT-FAMILY: Arial; COLOR: rgb(0, 0, 0); FONT-SIZE: 12px"><div>&nbsp;Dear VTK Users,</div><div><br /></div><div>I am trying to process the color content of BMP images. &nbsp;I use the following Tcl/Tk script to load and process a BMP file. &nbsp;The scalar data reported from the poly data is shown below the code and the saved poly data shown below that. &nbsp;While the saved poly data has the desired color scalar values the value generated using GetPointData is something I don't understand. &nbsp;Can someone assist me in using the correct command to access the color scalars.</div><div><br /></div><div>Thanks for your help.</div><div><br /></div><div>Patrick</div><div><br /></div><div><div>CODE</div><div># Create the RenderWindow, Renderer and Interactor</div><div>#</div><div>catch {load vtktcl}</div><div><br /></div><div># Get the interactor ui</div><div># VTK 4.0</div><div>package require vtk</div><div>package require vtkinteraction</div><div><br /></div><div>#source voi.tcl</div><div><br /></div><div>vtkRenderer ren1</div><div>vtkRenderWindow renWin</div><div>&nbsp; renWin AddRenderer ren1</div><div>vtkRenderWindowInteractor iren</div><div>&nbsp; iren SetRenderWindow renWin</div><div><br /></div><div>toplevel .debug</div><div>text .debug.t -height 20 -width 60 -background white</div><div>pack .debug.t</div><div>&nbsp;</div><div>vtkBMPReader readBMP</div><div>&nbsp; readBMP SetFileName &quot;TstCore1.bmp&quot;</div><div>&nbsp; readBMP Update</div><div>&nbsp; set dim [[readBMP GetOutput] GetExtent]</div><div>&nbsp; .debug.t insert end &quot;Extent: $dim\n&quot; ; update</div><div>&nbsp;&nbsp;</div><div>vtkDataSetMapper mapBMP</div><div>&nbsp; mapBMP SetInput [readBMP GetOutput]</div><div>&nbsp; mapBMP ScalarVisibilityOn</div><div>vtkActor actorBMP</div><div>&nbsp; actorBMP SetMapper mapBMP</div><div>ren1 AddActor actorBMP &nbsp;</div><div><br /></div><div>vtkImageDataGeometryFilter geomBMP</div><div>&nbsp; geomBMP SetInput [readBMP GetOutput]</div><div>&nbsp; geomBMP SetExtent 0 1000000 0 1000000 0 0</div><div>&nbsp; geomBMP Update</div><div>&nbsp; for {set i 0} {$i &lt; 1000} {incr i} {</div><div>&nbsp; &nbsp; set scalrange [[[[geomBMP GetOutput] GetPointData] GetScalars] GetValue $i]</div><div>&nbsp; &nbsp; .debug.t insert end &quot;Scalar: $i $scalrange\n&quot; ; update</div><div>&nbsp; }</div><div>vtkPolyDataWriter polyWriter</div><div>&nbsp; polyWriter SetInput [geomBMP GetOutput]</div><div>&nbsp; polyWriter SetFileName &quot;OBsurf.vtk&quot;</div><div># &nbsp;polyWriter SetFileTypeToBinary</div><div>&nbsp; polyWriter Write</div><div><br /></div><div>ren1 SetBackground 1.0 1.0 1.0</div><div>renWin SetSize 1000 1000</div><div>[ren1 GetActiveCamera] SetViewUp &nbsp;0.0 &nbsp;1.0 &nbsp;1.0</div><div>[ren1 GetActiveCamera] Elevation &nbsp;0.0</div><div>[ren1 GetActiveCamera] Zoom 1.5</div><div><br /></div><div># render the image</div><div>#</div><div>iren Initialize</div><div>#iren SetUserMethod {wm deiconify .vtkInteract}</div></div><div><br /></div><div>SCALARS OUTPUT FROM CODE</div><div><div>Scalar: 0 70</div><div>Scalar: 1 71</div><div>Scalar: 2 89</div><div>Scalar: 3 78</div><div>Scalar: 4 81</div><div>Scalar: 5 96</div><div>Scalar: 6 118</div><div>Scalar: 7 122</div><div>Scalar: 8 134</div><div>Scalar: 9 139</div><div>Scalar: 10 143</div><div>Scalar: 11 152</div><div>Scalar: 12 130</div><div>Scalar: 13 151</div><div>Scalar: 14 152</div></div><div><br /></div><div>SCALARS IN OUTPUT FILE</div><div><div>POINT_DATA 241902</div><div>COLOR_SCALARS BMPImage 3</div><div>0.27451 0.278431 0.34902 0.305882 0.317647 0.376471 0.462745 0.478431 0.52549&nbsp;</div><div>0.545098 0.560784 0.596078 0.509804 0.592157 0.596078&nbsp;</div><div>0.329412 0.384314 0.388235 0.298039 0.305882 0.301961&nbsp;</div><div>0.313725 0.278431 0.258824 0.286275 0.215686 0.160784&nbsp;</div></div><div><br /></div></div>