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 ("0, 0, 255") out side of array (max = 3611999999).</div>
<div> Anybody has idea to solve it? I couldn'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->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 < 3; ++idx)</div><div> {</div><div> if (coordinate[idx] < extent[idx*2] ||</div>
<div> coordinate[idx] > extent[idx*2+1])</div><div> {</div><div> vtkErrorMacro(<< "GetPointer: Pixel (" << coordinate[0] << ", "</div><div> << coordinate[1] << ", "</div>
<div> << coordinate[2] << ") not in current extent: ("</div><div> << extent[0] << ", " << extent[1] << ", "</div><div> << extent[2] << ", " << extent[3] << ", "</div>
<div> << extent[4] << ", " << extent[5] << ")");</div><div> return NULL;</div><div> }</div><div> }</div><div><br></div><div> // compute the index of the vector.</div>
<div> this->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 < 0 || idx > array->GetMaxId())</div><div> {</div>
<div> vtkErrorMacro("Coordinate (" << coordinate[0] << ", " << coordinate[1]</div><div> << ", " << coordinate[2] << ") out side of array (max = "</div>
<div> << array->GetMaxId());</div><div> return NULL;</div><div> }</div><div><br></div><div> return array->GetVoidPointer(idx);</div><div>}</div></div><div><br></div><div><br></div><div>
Thanks a lot.</div><div>-cq</div>