Hi Lars,<br>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?<br>
<br>I'd also suggest adding additional space around the image so that the surface voxelization doesn't butt up against the image edges<br><br>Dave<br><br><div class="gmail_quote">On Tue, Apr 20, 2010 at 10:58 AM, David Doria <span dir="ltr"><<a href="mailto:daviddoria%2Bvtk@gmail.com" target="_blank">daviddoria+vtk@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">On Tue, Apr 20, 2010 at 11:55 AM, David Welch<br>
<div><<a href="mailto:dmwelch@engineering.uiowa.edu" target="_blank">dmwelch@engineering.uiowa.edu</a>> wrote:<br>
</div><div>> This is my CMake file:<br>
><br>
><br>
> PROJECT(SurfaceToImage) # Project name<br>
> CMAKE_MINIMUM_REQUIRED( VERSION 2.6) # This is the minimum version of CMake<br>
> #*******************************************************************************<br>
> FIND_PACKAGE(VTK REQUIRED)<br>
> IF (VTK_FOUND)<br>
> INCLUDE(${VTK_USE_FILE})<br>
> ELSE (VTK_FOUND)<br>
> MESSAGE(ERROR "Cannot build without a VTK build tree or a VTK<br>
> installation. Please set VTK_DIR.")<br>
> ENDIF (VTK_FOUND)<br>
> #*******************************************************************************<br>
> SET( SurfaceToImage_SOURCE SurfaceToImage.cxx )<br>
> ADD_LIBRARY(SurfaceToImageLib SHARED ${SurfaceToImage_SOURCE})<br>
> SET_TARGET_PROPERTIES (SurfaceToImageLib PROPERTIES COMPILE_FLAGS<br>
> "-Dmain=ModuleEntryPoint")<br>
> TARGET_LINK_LIBRARIES (SurfaceToImageLib vtkIO vtkFiltering vtkCommon<br>
> vtkImaging)<br>
> ADD_EXECUTABLE( SurfaceToImage ${SurfaceToImage_SOURCE})<br>
> TARGET_LINK_LIBRARIES (SurfaceToImage vtkIO vtkCommon vtkFiltering<br>
> vtkImaging)<br>
<br>
</div>Yep, you need to add vtkHybrid to the list of libraries you are linking to.<br>
<br>
Thanks,<br>
<font color="#888888"><br>
David<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>David Welch<br>Graduate Student<br>Dept. of Biomedical Engineering<br>University of Iowa<br>Lab: (319) 335-5279<br>