hi,<div>    When i use vtkImageMarchingCubes to create 3d image, if I have more than 300 slices, a exception will be thrown from vtkImageData. Say Coordinate (&quot;0, 0, 255&quot;) out side of array (max = 3611999999).</div>
<div>    Anybody has idea to solve it? I couldn&#39;t find where defined the size of this array also.</div><div><br></div><div><br></div><div>vtkImageData.cxx</div><div><div>//----------------------------------------------------------------------------</div>
<div>// This Method returns a pointer to a location in the vtkImageData.</div><div>// Coordinates are in pixel units and are relative to the whole</div><div>// image origin.</div><div>void *vtkImageData::GetArrayPointer(vtkDataArray* array, int coordinate[3])</div>
<div>{</div><div>  vtkIdType incs[3];</div><div>  vtkIdType idx;</div><div><br></div><div>  if (array == NULL)</div><div>    {</div><div>    return NULL;</div><div>    }</div><div><br></div><div>  const int* extent = this-&gt;Extent;</div>
<div>  // error checking: since most acceses will be from pointer arithmetic.</div><div>  // this should not waste much time.</div><div>  for (idx = 0; idx &lt; 3; ++idx)</div><div>    {</div><div>    if (coordinate[idx] &lt; extent[idx*2] ||</div>
<div>        coordinate[idx] &gt; extent[idx*2+1])</div><div>      {</div><div>      vtkErrorMacro(&lt;&lt; &quot;GetPointer: Pixel (&quot; &lt;&lt; coordinate[0] &lt;&lt; &quot;, &quot;</div><div>        &lt;&lt; coordinate[1] &lt;&lt; &quot;, &quot;</div>
<div>        &lt;&lt; coordinate[2] &lt;&lt; &quot;) not in current extent: (&quot;</div><div>        &lt;&lt; extent[0] &lt;&lt; &quot;, &quot; &lt;&lt; extent[1] &lt;&lt; &quot;, &quot;</div><div>        &lt;&lt; extent[2] &lt;&lt; &quot;, &quot; &lt;&lt; extent[3] &lt;&lt; &quot;, &quot;</div>
<div>        &lt;&lt; extent[4] &lt;&lt; &quot;, &quot; &lt;&lt; extent[5] &lt;&lt; &quot;)&quot;);</div><div>      return NULL;</div><div>      }</div><div>    }</div><div><br></div><div>  // compute the index of the vector.</div>
<div>  this-&gt;GetArrayIncrements(array, incs);</div><div>  idx = ((coordinate[0] - extent[0]) * incs[0]</div><div>         + (coordinate[1] - extent[2]) * incs[1]</div><div>         + (coordinate[2] - extent[4]) * incs[2]);</div>
<div>  // I could check to see if the array has the correct number</div><div>  // of tuples for the extent, but that would be an extra multiply.</div><div>  if (idx &lt; 0 || idx &gt; array-&gt;GetMaxId())</div><div>    {</div>
<div>    vtkErrorMacro(&quot;Coordinate (&quot; &lt;&lt; coordinate[0] &lt;&lt; &quot;, &quot; &lt;&lt; coordinate[1]</div><div>                  &lt;&lt; &quot;, &quot; &lt;&lt; coordinate[2] &lt;&lt; &quot;) out side of array (max = &quot;</div>
<div>                  &lt;&lt; array-&gt;GetMaxId());</div><div>    return NULL;</div><div>    }</div><div><br></div><div>  return array-&gt;GetVoidPointer(idx);</div><div>}</div></div><div><br></div><div><br></div><div>
Thanks a lot.</div><div>-cq</div>