[Insight-users] from image to spatial object : how to install VTK

Luis Ibanez luis.ibanez at kitware.com
Sun Aug 5 10:03:39 EDT 2007



Hi Michal,


Please pay attention to the Help messages that CMake display for
you at the bottom of the GUI (MFC in Windows, Curses on Unix).


The message for the VTK_DIR variable tells you the following:



VTK_DIR:

       directory containing VTKConfig.cmake.
       This is either the root of the build tree,
       or PREFIX/lib/vtk for an installation.

       For VTK 4.0, this is the location of UseVTK.cmake.
       This is either the root of the build tree or
       PREFIX/include/vtk for an installation.


Since you are installing VTK, you must provide the directory:

    PREFIX/lib/vtk

where "PREFIX" is the directory where you installed VTK.



   Regards,



      Luis



------------------------------
Michal Plotkowiak wrote:
> but then how should I use Cmake to create a new project?
>  My problem is that i installed InsightApplication and when I try to compile 
> some of the programs it can't open vtk lib (although, in cmake for 
> InsihtApplication I specified the location of VTK dir that I created from 
> source code).
> 
> So if I install VTK from .exe and then cmake a new project that uses itk and 
> vtk lib which dir should I define for VTK_DIR?
> 
> many thanks
> michal
> 
> 
> In message <46AFB839.4090404 at kitware.com> Luis Ibanez 
> <luis.ibanez at kitware.com> writes:
> 
>>Hi Michal,
>>
>>From:
>>http://www.vtk.org/get-software.php#latest
>>
>>One easy way is to run the installer:
>>http://www.vtk.org/files/release/5.0/vtk-5.0.3-win32.exe
>>
>>
>>   Regards,
>>
>>
>>       Luis
>>
>>
>>---------------------------
>>Michal Plotkowiak wrote:
>>
>>>Hi,
>>>
>>>could someone give me detailed instruction how to install vtk?
>>>
>>>many thanks
>>>michal
>>>
>>>
>>>In message 
> 
> <b9e170000707310838u21214002wc042de10061a32e6 at mail.gmail.com> "Dan 
> 
>>>Homerick" <danhomerick at gmail.com> writes:
>>>
>>>
>>>>Hi Michal,
>>>>
>>>>On 7/31/07, Michal Plotkowiak <michal.plotkowiak at bnc.ox.ac.uk> wrote:
>>>>
>>>>
>>>>>thanks Luis for your help. I'm still having some difficulties.
>>>>>
>>>>>trying to compile programs from InsightApplications/Auxiliary/vtk I got
>>>>>the
>>>>>following error: fatal error LNK1104:cannot open file vtkRendering.lib
>>>>
>>>>
>>>>You probably need to download and build a copy of VTK, if you haven't
>>>>already. If you have already, make sure that cmake is looking in the 
> 
> correct
> 
>>>>lib directory.
>>>>
>>>>
>>>>
>>>>
>>>>>I tried another approach. I took SurfaceExtraction code and added the
>>>>>following
>>>>>lines:
>>>>>
>>>>>typedef itk::MeshSpatialObject<MeshType>     MeshSpatialObjectType;
>>>>> MeshSpatialObjectType::Pointer myMeshSpatialObject =
>>>>>                                       MeshSpatialObjectType::New();
>>>>> myMeshSpatialObject->SetMesh(meshSource->GetOutput());
>>>>> myMeshSpatialObject->GetMesh();
>>>>>
>>>>> typedef itk::SpatialObjectWriter<3> WriterType;
>>>>> WriterType::Pointer writer = WriterType::New();
>>>>> writer->SetInput(myMeshSpatialObject);
>>>>> writer->SetFileName("mesh.mha");
>>>>> writer->Update();
>>>>>
>>>>>but the program crashes and I dont get any output.
>>>>>
>>>>>could you give me some suggestions?
>>>>
>>>>
>>>>I'd suggest giving the *exact* error message.
>>>>
>>>>
>>>>
>>>>
>>>>>meny thanks
>>>>>michal
>>>>
>>>>
>>>>Cheers,
>>>>- Dan
>>>>
>>>>
>>>>In message <46AE5DBF.3000201 at kitware.com> Luis Ibanez <
>>>>
>>>>>luis.ibanez at kitware.com>
>>>>>writes:
>>>>>
>>>>>
>>>>>>Hi Michal,
>>>>>>
>>>>>>From the list of file formats listed in:
>>>>>>http://tetgen.berlios.de/fformats.html
>>>>>>
>>>>>>One possibility seems to be for you to use the STL file format.
>>>>>>
>>>>>>ITK doesn't directly write to it, but
>>>>>>you can take your segmented image, save it as a
>>>>>>.vtk or .mhd images, using the itkImageFileWriter.
>>>>>>
>>>>>>Then read the image into VTK and use the vtkContourFilter
>>>>>>http://www.vtk.org/doc/nightly/html/classvtkContourFilter.html
>>>>>>and save the resulting surface as an STL file
>>>>>>using the STL Writer
>>>>>>http://www.vtk.org/doc/nightly/html/classvtkSTLWriter.html
>>>>>>
>>>>>>
>>>>>>You can also do it in a single program mixing ITK and
>>>>>>VTK and converting the ITK image into a vtkImageData.
>>>>>>You will find examples of this conversion in the directory
>>>>>>
>>>>>>
>>>>>>   InsightApplications/Auxiliary/vtk
>>>>>>            itkReadITKImage3DSegmentShowVTK.cxx
>>>>>>            itkReadITKImageSegmentShowVTK.cxx
>>>>>>            itkReadITKImageShowSplineVTK.cxx
>>>>>>            itkReadITKImageShowVTK.cxx
>>>>>>
>>>>>>
>>>>>>  Regards,
>>>>>>
>>>>>>
>>>>>>     Luis
>>>>>>
>>>>>>
>>>>>>------------------------
>>>>>>Michal Plotkowiak wrote:
>>>>>>
>>>>>>
>>>>>>>Hi
>>>>>>>
>>>>>>>could someone tell me how can I convert a segmented image stored in
>>>>>
>>>>>.mha
>>>>>file
>>>>>
>>>>>
>>>>>>>to a spatial object readable by TetGen (FE mesh generator)?
>>>>>>>
>>>>>>>many thanks
>>>>>>>michal
>>>>>>>
>>>>>>>
>>>>>>
>>>>>--
>>>>>Michal Plotkowiak
>>>>>Doctoral Researcher
>>>>>Oxford University LSI DTC
>>>>>
>>>>>_______________________________________________
>>>>>Insight-users mailing list
>>>>>Insight-users at itk.org
>>>>>http://www.itk.org/mailman/listinfo/insight-users
>>>>>
>>>
>>>
> 


More information about the Insight-users mailing list