[vtkusers] VTKPolyData to 3D image
David Welch
dmwelch at engineering.uiowa.edu
Tue Apr 20 13:12:08 EDT 2010
Hi Lars,
I can confirm that there is an offset to the images. The origin is computed
as the lower(?) bounds for x,y, and z. I believe that these should be the
average of the upper and lower bounds so as to obtain the center.
Unfortunately, when I try to implement that in the code,
PolyDataToImageStencil seg faults on it's update. Any idea why that would
be?
I'd also suggest adding additional space around the image so that the
surface voxelization doesn't butt up against the image edges
Dave
On Tue, Apr 20, 2010 at 10:58 AM, David Doria
<daviddoria+vtk at gmail.com<daviddoria%2Bvtk at gmail.com>
> wrote:
> On Tue, Apr 20, 2010 at 11:55 AM, David Welch
> <dmwelch at engineering.uiowa.edu> wrote:
> > This is my CMake file:
> >
> >
> > PROJECT(SurfaceToImage) # Project name
> > CMAKE_MINIMUM_REQUIRED( VERSION 2.6) # This is the minimum version of
> CMake
> >
> #*******************************************************************************
> > FIND_PACKAGE(VTK REQUIRED)
> > IF (VTK_FOUND)
> > INCLUDE(${VTK_USE_FILE})
> > ELSE (VTK_FOUND)
> > MESSAGE(ERROR "Cannot build without a VTK build tree or a VTK
> > installation. Please set VTK_DIR.")
> > ENDIF (VTK_FOUND)
> >
> #*******************************************************************************
> > SET( SurfaceToImage_SOURCE SurfaceToImage.cxx )
> > ADD_LIBRARY(SurfaceToImageLib SHARED ${SurfaceToImage_SOURCE})
> > SET_TARGET_PROPERTIES (SurfaceToImageLib PROPERTIES COMPILE_FLAGS
> > "-Dmain=ModuleEntryPoint")
> > TARGET_LINK_LIBRARIES (SurfaceToImageLib vtkIO vtkFiltering vtkCommon
> > vtkImaging)
> > ADD_EXECUTABLE( SurfaceToImage ${SurfaceToImage_SOURCE})
> > TARGET_LINK_LIBRARIES (SurfaceToImage vtkIO vtkCommon vtkFiltering
> > vtkImaging)
>
> Yep, you need to add vtkHybrid to the list of libraries you are linking to.
>
> Thanks,
>
> David
>
--
David Welch
Graduate Student
Dept. of Biomedical Engineering
University of Iowa
Lab: (319) 335-5279
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100420/94b4685f/attachment.htm>
More information about the vtkusers
mailing list