<!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>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I have been a faithful user of VTK for the past 
year.&nbsp; But lately, I ran into this problem I cannot solve, so I subscribe 
myself to this list&nbsp;asking for help for the first time!&nbsp; </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I&nbsp;try to extract a slice from a&nbsp;3D image 
data.&nbsp;&nbsp;The original data (data) has&nbsp;an extent of (0,&nbsp; 511, 
0, 511, 0, 3)&nbsp;, and I want to extract&nbsp;different slices from&nbsp;a 
volumn (in "data") and store them in two vtkImageData.&nbsp; So, my code 
goes:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
extractS1 = vtk.vtkExtractVOI( )&nbsp;&nbsp;&nbsp; </FONT></DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; 
extractS1.SetInput(data)<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;extractS1.SetVOI(0, 511, 0, 511, 0, 0)<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;extractS1.Update( )</FONT></DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;slice1 
= extractS1.GetOutput( )&nbsp; &lt;-- slice1 has extent (0, 511, 0, 511, 0, 
0)</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
extractS2 = vtk.vtkExtractVOI( )<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;extractS2.SetInput(data)<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;extractS2.SetVOI(0, 511, 0, 511, 2, 2)<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; extractS2.Update( ) 
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; slice2 
= extractS2.GetOutput( )&nbsp; &lt;-- slice1 has extent (0, 511, 0, 511, 2, 
2)</FONT></FONT><FONT face=Arial size=2></DIV></DIV>
<DIV>&nbsp;</DIV>
<DIV>I&nbsp;append these two slices in z direction in different order to create 
two image data:</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; filter = 
vtk.vtkImageAppend()<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
filter.AddInput(slice1)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
filter.AddInput(slice2)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
filter.AddInput(slice1)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
filter.SetAppendAxis(2)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
filter.Update()<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; image1 = 
filter.GetOutput() &lt;--&nbsp;has extent (0, 511, 0, 511, 0, 
2)<BR>&nbsp;&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; filter1 = 
vtk.vtkImageAppend()&nbsp;&nbsp;&nbsp; 
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
filter1.AddInput(slice2)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
filter1.AddInput(slice1)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
filter1.AddInput(slice2)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
filter1.SetAppendAxis(2)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
filter1.Update()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; image2 = filter1.GetOutput() 
&lt;-- has extent(0, 511, 0, 511, 2,4)</DIV>
<DIV>&nbsp;</DIV>
<DIV>When I combine those&nbsp;two image data into one by&nbsp;the following 
code:</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; filter2 = 
vtk.vtkImageAppendComponents()<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
filter2.AddInput(image2)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
filter2.AddInput(image1)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
filter2.Update()<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; image3 = 
filter2.GetOutput()<BR></DIV>
<DIV>I get error message that&nbsp;tells me the&nbsp;extents of the data doesn't 
lie within the whole extent: 
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</DIV>
<DIV>ERROR: In \OCCIviewerSDK10\Vtk42\Common\vtkDataObject.cxx, line 
548<BR>vtkImageData (1B2DBC68): Update extent does not lie within whole 
extent</DIV>
<DIV>&nbsp;</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>&nbsp;</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>&nbsp;</DIV>
<DIV>ERROR: In \OCCIviewerSDK10\Vtk42\Common\vtkDataObject.cxx, line 
548<BR>vtkImageData (1B2DBC68): Update extent does not lie within whole 
extent</DIV>
<DIV>&nbsp;</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>&nbsp;</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>&nbsp;</DIV>
<DIV>How do I fix this problem???&nbsp; Thanx!!</DIV>
<DIV>&nbsp;</DIV>
<DIV>Grace</DIV></FONT>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV></BODY></HTML>