<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi,<br>
    <br>
    maybe morphological closing on your 3D build is also an option.<br>
    <br>
    HTH<br>
    Dominique<br>
    <br>
    On 06.12.2011 19:09, Malsoaz James wrote:
    <blockquote
      cite="mid:1323194951.35316.YahooMailNeo@web28314.mail.ukl.yahoo.com"
      type="cite">
      <div style="color:#000; background-color:#fff; font-family:Courier
        New, courier, monaco, monospace, sans-serif;font-size:10pt">Thank
        you Bill for your answer.<br>
        <br>
        The input vtkImageData is the result of a segmentation process.
        Sometimes, the segmentation is not perfect, part of the object
        can be missing on a slice. For now, I can't know automatically
        if a slice is missing or not before the 3D build. Thus, I can't
        create it manually. I thought Marching cubes was able to deal
        with this kind of problem, apparently not.<br>
        <br>
        I will look at your solution and let you know.<br>
        <br>
        In any case, the resampler solution works, it is just not really
        suitable for bad resolution.<br>
        <br>
        Best.<br>
        <br>
        <div style="font-family: Courier New, courier, monaco,
          monospace, sans-serif; font-size: 10pt;">
          <div style="font-family: times new roman, new york, times,
            serif; font-size: 12pt;"> <font face="Arial" size="2">
              <hr size="1"> <b><span style="font-weight:bold;">De&nbsp;:</span></b>
              Bill Lorensen <a class="moz-txt-link-rfc2396E" href="mailto:bill.lorensen@gmail.com">&lt;bill.lorensen@gmail.com&gt;</a><br>
              <b><span style="font-weight: bold;">&Agrave;&nbsp;:</span></b> Malsoaz
              James <a class="moz-txt-link-rfc2396E" href="mailto:jmalsoaz@yahoo.fr">&lt;jmalsoaz@yahoo.fr&gt;</a> <br>
              <b><span style="font-weight: bold;">Cc&nbsp;:</span></b>
              <a class="moz-txt-link-rfc2396E" href="mailto:vtkusers@vtk.org">"vtkusers@vtk.org"</a> <a class="moz-txt-link-rfc2396E" href="mailto:vtkusers@vtk.org">&lt;vtkusers@vtk.org&gt;</a> <br>
              <b><span style="font-weight: bold;">Envoy&eacute; le :</span></b>
              Mardi 6 D&eacute;cembre 2011 18h19<br>
              <b><span style="font-weight: bold;">Objet&nbsp;:</span></b> Re:
              [vtkusers] Build 3D Mesh from vtkImageData using
              vtkMarchingCubes - holes filling ?<br>
            </font> <br>
            Another possible solution is to convert your image data to a<br>
            rectilinear grid. The rectilinear grid supports non uniform
            spacing.<br>
            Once converted you would use vtkContourFilter rather than
            Marching<br>
            Cubes. It will be slower.<br>
            <br>
            Bill<br>
            <br>
            On Tue, Dec 6, 2011 at 12:16 PM, Bill Lorensen &lt;<a
              moz-do-not-send="true"
              ymailto="mailto:bill.lorensen@gmail.com"
              href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>&gt;
            wrote:<br>
            &gt; Marching Cubes is the correct filter and your results
            look good<br>
            &gt; (except for the missing slice. You could try to create
            a missing slice<br>
            &gt; by creating a new slice. Maybe by averaging the slice
            above and below<br>
            &gt; the missing slice.<br>
            &gt;<br>
            &gt; Why is the data missing?<br>
            &gt;<br>
            &gt; On Tue, Dec 6, 2011 at 12:03 PM, Malsoaz James &lt;<a
              moz-do-not-send="true" ymailto="mailto:jmalsoaz@yahoo.fr"
              href="mailto:jmalsoaz@yahoo.fr">jmalsoaz@yahoo.fr</a>&gt;
            wrote:<br>
            &gt;&gt; Dear VTK users<br>
            &gt;&gt;<br>
            &gt;&gt; I'm trying to build a 3D mesh from a vtkImageData
            using vtkMarchingCubes.<br>
            &gt;&gt; The vtkImageData is build from a list of 2D binary
            slices.<br>
            &gt;&gt;<br>
            &gt;&gt; vtkMarchingCubes works great. But when a slice(s)
            is(are) missing, it<br>
            &gt;&gt; creates a hole in the 3D mesh (see image in
            attachment).<br>
            &gt;&gt;<br>
            &gt;&gt; 1 - How can I fill this kind of hole ? Ideally, I
            would like to link the two<br>
            &gt;&gt; parts of the mesh<br>
            &gt;&gt;<br>
            &gt;&gt; 2 - I found a solution in the use of a resampler
            (vtkImageResample,<br>
            &gt;&gt; vtkImageShrink3D, don't know which one is
            recommanded). Unfortunately, it<br>
            &gt;&gt; sometimes produces ugly mesh with "stair effect"
            when the spacing is too big<br>
            &gt;&gt; (still there after decimate and smooth). Is it a
            good solution ? How to<br>
            &gt;&gt; solve the stair problem ?<br>
            &gt;&gt;<br>
            &gt;&gt; 3 - Browsing the mailing list brings me to the
            notion of "repair hole" for<br>
            &gt;&gt; marching cubes. I don't know a lot about it. But
            should I look into this ?<br>
            &gt;&gt; Some solutions exist for this such as <a
              moz-do-not-send="true" href="http://www.opentopology.org/"
              target="_blank">http://www.opentopology.org/</a><br>
            &gt;&gt;<br>
            &gt;&gt; 4 - Is vtkMarchingCubes the class I should use for
            my purpose or should I<br>
            &gt;&gt; look at vtkVoxelContoursSurfaceFilter or any other
            filter ?<br>
            &gt;&gt;<br>
            &gt;&gt;<br>
            &gt;&gt; Thank you for you help.<br>
            &gt;&gt; Best.<br>
            &gt;&gt;<br>
            &gt;&gt;<br>
            &gt;&gt;<br>
            &gt;&gt;<br>
            &gt;&gt; _______________________________________________<br>
            &gt;&gt; Powered by <a class="moz-txt-link-abbreviated" href="http://www.kitware.com">www.kitware.com</a><br>
            &gt;&gt;<br>
            &gt;&gt; Visit other Kitware open-source projects at<br>
            &gt;&gt; <a moz-do-not-send="true"
              href="http://www.kitware.com/opensource/opensource.html"
              target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
            &gt;&gt;<br>
            &gt;&gt; Please keep messages on-topic and check the VTK FAQ
            at:<br>
            &gt;&gt; <a moz-do-not-send="true"
              href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
            &gt;&gt;<br>
            &gt;&gt; Follow this link to subscribe/unsubscribe:<br>
            &gt;&gt; <a moz-do-not-send="true"
              href="http://www.vtk.org/mailman/listinfo/vtkusers"
              target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
            &gt;&gt;<br>
            &gt;<br>
            &gt;<br>
            &gt;<br>
            &gt; --<br>
            &gt; Unpaid intern in BillsBasement at noware dot com<br>
            <br>
            <br>
            <br>
            -- <br>
            Unpaid intern in BillsBasement at noware dot com<br>
            <br>
            <br>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Powered by <a class="moz-txt-link-abbreviated" href="http://www.kitware.com">www.kitware.com</a>

Visit other Kitware open-source projects at <a class="moz-txt-link-freetext" href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a>

Please keep messages on-topic and check the VTK FAQ at: <a class="moz-txt-link-freetext" href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</a>

Follow this link to subscribe/unsubscribe:
<a class="moz-txt-link-freetext" href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</a>
</pre>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
Dominique T&ouml;pfer, Dipl.-Inform.
Institute of Medical Physics
University of Erlangen</pre>
  </body>
</html>