<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Don't use the threshold filter. The output of the threshold filter is
UnstructuredGrid, which will cause your compact imagedata to balloon in
memory size by an enormous amount if the non-zero region is larger than
a small amount.<br>
<br>
There is no existing filter which will search for the good cropping
region for you, but if you write some code<br>
Loop x, loopy, loop z, find the min/max extents that are non zero, then
set the extents into a VOI. You can easily make a new filter which
wraps the ExtractVOI and a bounds check into a new
vtkImageExtractNonZeroVOIFilter<br>
<br>
JB<br>
<br>
<blockquote
 cite="mid:b227a7f80810150503q2b6c866s5d873ea6850b58b0@mail.gmail.com"
 type="cite">
  <pre wrap="">Hello!

On Wed, Oct 15, 2008 at 1:35 PM, Fabio Meneghini
<a class="moz-txt-link-rfc2396E" href="mailto:fab.meneghini@gmail.com">&lt;fab.meneghini@gmail.com&gt;</a> wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">Is there any method to automatically crop out the zeros
    </pre>
  </blockquote>
  <pre wrap=""><!---->
The Threshold-filter may help here:

<a class="moz-txt-link-rfc2396E" href="http://www.vtk.org/doc/nightly/html/classvtkThreshold.html">&lt;http://www.vtk.org/doc/nightly/html/classvtkThreshold.html&gt;</a>

hth

mirko

  </pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="78">-- 
John Biddiscombe,                            email:biddisco @ cscs.ch
<a class="moz-txt-link-freetext" href="http://www.cscs.ch/">http://www.cscs.ch/</a>
CSCS, Swiss National Supercomputing Centre  | Tel:  +41 (91) 610.82.07
Via Cantonale, 6928 Manno, Switzerland      | Fax:  +41 (91) 610.82.82</pre>
</body>
</html>