<!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> </DIV>
<DIV><FONT face=Arial size=2>I want to assign the scalar values of the final
vtkImageData to three 1-D pointer arrays which these 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> </DIV>
<DIV><FONT face=Arial size=2>Briefly I can ask the same question, like
this:</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> If I have a vtkImageData 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 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. </FONT></DIV>
<DIV> </DIV>
<DIV>To be more clear, I want to show you the following codes:</DIV>
<DIV> </DIV>
<DIV>vtkImageGradient *imGrad=vtkImageGradient::New();</DIV>
<DIV>
imGrad->SetInput(TiffReader->GetOutput) ;</DIV>
<DIV> imGrad ->SetDimensionality(3);</DIV>
<DIV> imGrad->HandleBoundariesOn();</DIV>
<DIV> </DIV>
<DIV>vtkImageData *imageData;</DIV>
<DIV>imageData=imGrad->GetOutput(); /*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> </DIV>
<DIV><FONT face=Arial size=2>I know that, the scalar components of
vtkImageData can be reached by the <STRONG>function (void *)
GetScalarPointer(int,int,int). </STRONG>But I couldn't understand, how R G
B components are ordered in this pointer's
addresses.</FONT> <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> </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> </DIV>
<DIV> </DIV></BODY></HTML>