<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-9" http-equiv=Content-Type>
<META content="MSHTML 5.00.2614.3500" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Dear friends,</FONT></DIV>
<DIV><FONT face=Arial size=2>I compute 3d gradient of a volume by using 
vtkImageGradient filter as in the text book.</FONT></DIV>
<DIV><FONT face=Arial size=2>This filter generates an output of float values 
with 3 components. On the other hand,</FONT></DIV>
<DIV><FONT face=Arial size=2>vtkImageGradientFilter gives an output of the type 
vtkImageData.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I want to assign the scalar values of the final 
vtkImageData to three 1-D pointer arrays&nbsp;which these&nbsp;one dimensional 3 
pointers will correspond to each of  3 component's </FONT><FONT face=Arial 
size=2>scalar values. How can I do this?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Briefly I can ask the same question, like 
this:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;If I have a vtkImageData&nbsp; with RGB 
values (in this case, the number of the scalar components is 3 and each of them 
corresponds to Red Green and blue respectively), how can I handle these R, G, B 
values into 3 different pointers which represent R G&nbsp;B values 
individually.</FONT><FONT face=Arial size=2>I tried to implement the ImageData 
as if its scalar components are vtkArrays with tuples. But I couldn't 
succeed.&nbsp;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>To be more clear,&nbsp;I want to show you the following codes:</DIV>
<DIV>&nbsp;</DIV>
<DIV>vtkImageGradient *imGrad=vtkImageGradient::New();</DIV>
<DIV>&nbsp;&nbsp;&nbsp; 
imGrad-&gt;SetInput(TiffReader-&gt;GetOutput)&nbsp;;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; imGrad&nbsp;-&gt;SetDimensionality(3);</DIV>
<DIV>&nbsp;&nbsp;&nbsp; imGrad-&gt;HandleBoundariesOn();</DIV>
<DIV>&nbsp;</DIV>
<DIV>vtkImageData *imageData;</DIV>
<DIV>imageData=imGrad-&gt;GetOutput();&nbsp; /*Here, I think imageData must have 
3 components.</DIV>
<DIV>int *myPointer1,*mypointer2, *myPointer3;/*I want to assign 1st component's 
scalars to myPointer1, 2nd to myPointer2 and so on.</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I know that,&nbsp;the scalar components of 
vtkImageData can be reached by the <STRONG>function&nbsp; (void *) 
GetScalarPointer(int,int,int). </STRONG>But I&nbsp;couldn't understand, how R G 
B components are&nbsp;ordered in this&nbsp;pointer's 
addresses.</FONT>&nbsp;<FONT face=Arial size=2>Are they ordered in the form of 
RGB, RGB, RGB or in another way? I tried to use vtkExtractComponents but still 
couldn't solve my problem.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Please help me.</FONT></DIV>
<DIV><FONT face=Arial size=2>Thanks in advance.</FONT></DIV>
<DIV><FONT face=Arial size=2>Sedat Dogan.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV></BODY></HTML>