<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1479" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi there, </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I have been a faithful user of VTK for the past
year. But lately, I ran into this problem I cannot solve, so I subscribe
myself to this list asking for help for the first time! </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I try to extract a slice from a 3D image
data. The original data (data) has an extent of (0, 511,
0, 511, 0, 3) , and I want to extract different slices from a
volumn (in "data") and store them in two vtkImageData. So, my code
goes:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>
extractS1 = vtk.vtkExtractVOI( ) </FONT></DIV>
<DIV><FONT face=Arial size=2>
extractS1.SetInput(data)<BR>
extractS1.SetVOI(0, 511, 0, 511, 0, 0)<BR>
extractS1.Update( )</FONT></DIV>
<DIV><FONT face=Arial size=2> slice1
= extractS1.GetOutput( ) <-- slice1 has extent (0, 511, 0, 511, 0,
0)</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>
extractS2 = vtk.vtkExtractVOI( )<BR>
extractS2.SetInput(data)<BR>
extractS2.SetVOI(0, 511, 0, 511, 2, 2)<BR>
extractS2.Update( )
<DIV><FONT face=Arial size=2> slice2
= extractS2.GetOutput( ) <-- slice1 has extent (0, 511, 0, 511, 2,
2)</FONT></FONT><FONT face=Arial size=2></DIV></DIV>
<DIV> </DIV>
<DIV>I append these two slices in z direction in different order to create
two image data:</DIV>
<DIV> </DIV>
<DIV> filter =
vtk.vtkImageAppend()<BR>
filter.AddInput(slice1)<BR>
filter.AddInput(slice2)<BR>
filter.AddInput(slice1)<BR>
filter.SetAppendAxis(2)<BR>
filter.Update()<BR> image1 =
filter.GetOutput() <-- has extent (0, 511, 0, 511, 0,
2)<BR> </DIV>
<DIV> filter1 =
vtk.vtkImageAppend()
<BR>
filter1.AddInput(slice2)<BR>
filter1.AddInput(slice1)<BR>
filter1.AddInput(slice2)<BR>
filter1.SetAppendAxis(2)<BR>
filter1.Update()
<BR> image2 = filter1.GetOutput()
<-- has extent(0, 511, 0, 511, 2,4)</DIV>
<DIV> </DIV>
<DIV>When I combine those two image data into one by the following
code:</DIV>
<DIV> </DIV>
<DIV> filter2 =
vtk.vtkImageAppendComponents()<BR>
filter2.AddInput(image2)<BR>
filter2.AddInput(image1)<BR>
filter2.Update()<BR> image3 =
filter2.GetOutput()<BR></DIV>
<DIV>I get error message that tells me the extents of the data doesn't
lie within the whole extent:
<BR> </DIV>
<DIV>ERROR: In \OCCIviewerSDK10\Vtk42\Common\vtkDataObject.cxx, line
548<BR>vtkImageData (1B2DBC68): Update extent does not lie within whole
extent</DIV>
<DIV> </DIV>
<DIV>ERROR: In \OCCIviewerSDK10\Vtk42\Common\vtkDataObject.cxx, line
555<BR>vtkImageData (1B2DBC68): Update extent is: 0, 511, 0, 511, 2, 4</DIV>
<DIV> </DIV>
<DIV>ERROR: In \OCCIviewerSDK10\Vtk42\Common\vtkDataObject.cxx, line
562<BR>vtkImageData (1B2DBC68): Whole extent is: 0, 511, 0, 511, 0, 2</DIV>
<DIV> </DIV>
<DIV>ERROR: In \OCCIviewerSDK10\Vtk42\Common\vtkDataObject.cxx, line
548<BR>vtkImageData (1B2DBC68): Update extent does not lie within whole
extent</DIV>
<DIV> </DIV>
<DIV>ERROR: In \OCCIviewerSDK10\Vtk42\Common\vtkDataObject.cxx, line
555<BR>vtkImageData (1B2DBC68): Update extent is: 0, 511, 0, 511, 2, 4</DIV>
<DIV> </DIV>
<DIV>ERROR: In \OCCIviewerSDK10\Vtk42\Common\vtkDataObject.cxx, line
562<BR>vtkImageData (1B2DBC68): Whole extent is: 0, 511, 0, 511, 0, 2<BR></DIV>
<DIV> </DIV>
<DIV>How do I fix this problem??? Thanx!!</DIV>
<DIV> </DIV>
<DIV>Grace</DIV></FONT></BODY></HTML>