[vtkusers] Re: MarchingCubes
Sean McInerney
seanm at nmr.mgh.harvard.edu
Wed Jul 28 22:09:53 EDT 2004
Jonathan,
I'll check out your code.
In the meantime, I had a quicker and dirtier idea that I decided to
try out using vtkSurfaceReconstructionFilter and vtkImageThreshold to
produce an binary ImageData volume from a PolyData surface. It's rough
but interesting. The output is a volume rendering.
-Sean
Jonathan Bailleul wrote:
> Sean McInerney wrote:
>
>>Jonathan,
>>
>> That's a cool idea!
>>
>> Foreach desired slice plane for the ImageData volume that you will
>>ultimately produce, do something like this:
>>
>>1.) Use vtkClipPolyData to get the 2D contour of the given slice.
>>
>>2.) Use vtkPolyDataToImageStencil to produce ImageStencilData
>>
>>3.) Use vtkImageStencil to produce the ImageData
>> (need to do a little filtering to produce the desired binary image).
>>
>>4.) Use vtkAppendFilter to fuse the 2D binary images into a 3D volume.
>> Hopefully, the ImageStencilData retains a 3D extent.
>>
>>5.) Voila! Binary volume from PolyData ... maybe.
>>
>>-Sean
>
>
>
> Thanks for the help!
>
> If someone is inspirated to actually implement this (or has already
> completed this), please notify me!
> Anyway, here is a stupid but working solution. Code is sometimes ugly,
> but it works (only voxels at border of each slice are "colored"). Output
> is AIR analyse format, recognized on ITK and usable on VTK if you know
> the parameters and consider the .img file as the raw volume.
>
> All personal includes in:
> http://www.greyc.ismra.fr/~bailleul/Ressources/summary.html (see gpl
> code section)
> for those who really want to end up testing the program.
>
> I really should have been more investigating on VTK abilities before
> doing all this by hand, but I was VTK newbie when I coded this and had
> most of the necessary code at hand on my personal libraries.
>
>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: unmarch.cxx
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20040728/f385c7a1/attachment.txt>
More information about the vtkusers
mailing list