<!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> importer->SetWholeExtent(0,255,0,255,0,255);<BR> importer->SetDataExtentToWholeExtent();<BR> importer->SetDataScalarTypeToUnsignedShort();<BR> importer->SetDataSpacing(1,1,1);<BR> importer->SetImportVoidPointer(dr);</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>where, 'dr' is my array pointer. The dimensions of my image
volume are 256x256x256 with voxel dimensions of 1mmx1mmx1mm. Hence I have
created a vtkImageData with the extent of 0,255,0,255,0,255 as done
above. 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 am using the following piece of code for
transformation:</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>vtkGridTransform *nrtransf =
vtkGridTransform::New();<BR> nrtransf->SetDisplacementGrid(importer->GetOutput());<BR> nrtransf->SetInterpolationModeToCubic();</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2> vtkPolyDataReader *reader =
vtkPolyDataReader::New();<BR> reader->SetFileName("//isotropic/brainstem.vtk");<BR> <BR> vtkTransformPolyDataFilter
*def = vtkTransformPolyDataFilter::New();<BR> def->SetInput(
reader->GetOutput() );<BR> def->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> </DIV>
<DIV><FONT size=2>Thank You very much,</FONT></DIV>
<DIV><FONT size=2>Pallavi</DIV>
<DIV><BR> </FONT> </DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV> </DIV>
<DIV><FONT face="Comic Sans MS" color=#0000ff
size=2></FONT> </DIV></BLOCKQUOTE>
<P></P></BODY></HTML>