<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2800.1400" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY style="COLOR: #0000ff; FONT-FAMILY: Comic Sans MS" bgColor=#ffffff>
<BLOCKQUOTE id=0><LABEL id=HbSession SessionId="1091748115"></LABEL>
  <DIV><FONT size=2>Hi All,</FONT></DIV>
  <DIV><FONT size=2>I have a C array pointer with 3 displacement fields dx,dy,dz 
  for each voxel of my image volume. I import this pointer using vtkImageImport 
  by using the following piece of code:</FONT></DIV>
  <DIV><FONT size=2>vtkImageImport *importer = 
  vtkImageImport::New();<BR>&nbsp;importer-&gt;SetWholeExtent(0,255,0,255,0,255);<BR>&nbsp;importer-&gt;SetDataExtentToWholeExtent();<BR>&nbsp;importer-&gt;SetDataScalarTypeToUnsignedShort();<BR>&nbsp;importer-&gt;SetDataSpacing(1,1,1);<BR>&nbsp;importer-&gt;SetImportVoidPointer(dr);</FONT></DIV>
  <DIV><FONT size=2></FONT>&nbsp;</DIV>
  <DIV><FONT size=2>where, 'dr' is my array pointer. The dimensions of my image 
  volume are 256x256x256&nbsp;with voxel dimensions of 1mmx1mmx1mm. Hence I have 
  created a vtkImageData with the extent of 0,255,0,255,0,255 as done 
  above.&nbsp;Does this mean that I create a grid of dimensions 256x256x256 and 
  spacing of 1x1x1 and each grid element will carry my 3 displacement vector 
  values dx,dy,dz. ? I&nbsp;am using the following piece of code for 
  transformation:</FONT></DIV>
  <DIV><FONT size=2></FONT>&nbsp;</DIV>
  <DIV><FONT size=2>vtkGridTransform *nrtransf = 
  vtkGridTransform::New();<BR>&nbsp;nrtransf-&gt;SetDisplacementGrid(importer-&gt;GetOutput());<BR>&nbsp;nrtransf-&gt;SetInterpolationModeToCubic();</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT size=2>&nbsp;vtkPolyDataReader *reader = 
  vtkPolyDataReader::New();<BR>&nbsp;reader-&gt;SetFileName("//isotropic/brainstem.vtk");<BR>&nbsp;<BR>&nbsp;vtkTransformPolyDataFilter 
  *def = vtkTransformPolyDataFilter::New();<BR>&nbsp;def-&gt;SetInput( 
  reader-&gt;GetOutput() );<BR>&nbsp;def-&gt;SetTransform( nrtransf 
  );</FONT></DIV><FONT size=2></FONT></BLOCKQUOTE>
<BLOCKQUOTE>
  <DIV><FONT size=2>Is this code correct ? I am getting some error in 
  vtkGridTransform. I am not able to figure out how to fix it. </FONT></DIV>
  <DIV><FONT size=2>Could anyone please help me and guide me in the right 
  direction ?</FONT></DIV>
  <DIV><FONT size=2></FONT>&nbsp;</DIV>
  <DIV><FONT size=2>Thank You very much,</FONT></DIV>
  <DIV><FONT size=2>Pallavi</DIV>
  <DIV><BR>&nbsp;</FONT>&nbsp;</DIV>
  <DIV><FONT size=2></FONT>&nbsp;</DIV>
  <DIV><FONT size=2></FONT>&nbsp;</DIV>
  <DIV><FONT size=2></FONT>&nbsp;</DIV>
  <DIV><FONT size=2></FONT>&nbsp;</DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face="Comic Sans MS" color=#0000ff 
size=2></FONT>&nbsp;</DIV></BLOCKQUOTE>
<P></P></BODY></HTML>