<div>hi . i have just started some development using vtk. i have to display an slc file, and provide 'user editable' transfer functions. </div> <div>background: <BR>---------------- <BR>i am using the following, and it works fine: </div> <div> colTransFunc->AddRGBPoint ( 0.0, 0.0, 0.0, 0.0); <BR> colTransFunc->AddRGBPoint ( 64.0, 1.0, 0.0, 0.0); <BR> colTransFunc->AddRGBPoint ( 128.0, 0.0, 0.0, 1.0); <BR> colTransFunc->AddRGBPoint ( 192.0, 0.0, 1.0, 0.0); <BR> colTransFunc->AddRGBPoint ( 255.0, 0.0, 0.2, 0.0); </div> <div> opacTransFunc->AddPoint( 20, 0.0); <BR> opacTransFunc->AddPoint( 255, 0.2); </div> <div>this obviousy maps (0 to 255) to (0 to 1). my understanding is that the 0 to 255 represents in xyz plane,
distance of a point from the origin. so if i have a point at say 23, and its corresponding RGB is (1,0,0), that means i am telling the vtk renderer to color all 'innermost' points as red. </div> <div>my questions: <BR>-------------------- <BR>1) is my understanding correct? <BR>2)isnt it wrong to hardcode 255? shudn't i be getting a 'range' for the given slc file? <BR>i tried: </div> <div> poly->ShallowCopy(reader->GetOutput()); <BR> reader->Update(); <BR> poly->GetScalarRange(Range); </div> <div>where poly = vtkPolyData and reader = vtkSLCReader, but then i always get the range as (0 to 1). so then i will be mapping (0 to 1) to (0 to 1). that obviously does not give me correct results. <BR>3) after i figure out the correct mapping, how do i change the transfer functions? say i have sliders for
red , green and blue each, when the user changes the slider, what should happen ? can you give an example of how the above mentioned functions should change ? <BR>4) do the solutions to the above questions also apply to the changing of opacity using vtkPiecewiseFunction? </div> <div>thanks for your patience in reading the long list . hope to get some guidance soon. thanks again. </div> <div>-vishal<BR></div>