[Insight-users] How to use TriangleMeshToBinaryImageFilter without an input image?

Dženan Zukić dzenanz at gmail.com
Fri Jul 2 04:27:43 EDT 2010


I don't know of what size is your mesh, but 20x20x20 seems too small. Try
1024x1024x1024, with origin -512,-512,-512. Also, do you expect to get a
series of TIFF images or only 1 image? That might be problematic too - try
writing it into "cone_01.mha".

Regards,
Dženan

2010/7/1 <lynx.abraxas at freenet.de>

> On 30/06/10 14:18:20, Dženan Zukić wrote:
> > Hi Lynx,
> >
> > that index mentioned in the error message is filter's internal variable.
> You
> > cannot set it directly. The most likely cause for that is miscalculation
> of
> > your image parameters (origin, size) with regards to mesh's volume. Try
> > playing with parameters you give to your program to see if it makes a
> > difference - try smaller mesh, try smaller image, larger image etc.
>
> Thanks Dženan for Your reply. I tried with different parameters  like
>  smaller
> mesh, smaller image, larger image but nothing helped.
>
> With  a  new  version  of my code (attached) where I allocate the output
> image
> frist the problem remains.
> I figured out though that it has to be a vtk-file not a vtp-file. If I  use
>  a
> vtp-file I get the error (more below):
> terminate called after throwing an instance of 'std::out_of_range'
>
>
> How  would  I have to ajust my code if I just want to specify the dimension
> in
> x,y,z and let the program set origin and extend  and  spacing  such  that
>  the
> whole mesh is just fitting into the output?
>
> Many thanks for any help or hints.
> Lynx
>
>
> __________________________________________________________
>
> ~/itk/simple/voxelizer_itk_02 cone_01.vtp cone_01.tif 20 20 20 -10 -10 -10
> Reading: cone_01.vtp
> terminate called after throwing an instance of 'std::out_of_range'
>  what():  basic_string::basic_string
> Abgebrochen
>
>
> gdb ~/itk/simple/voxelizer_itk_02
> GNU gdb 6.6.50.20070726-cvs
> Copyright (C) 2007 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and you
> are
> welcome to change it and/or distribute copies of it under certain
> conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB.  Type "show warranty" for details.
> This GDB was configured as "x86_64-suse-linux"...
> Using host libthread_db library "/lib64/libthread_db.so.1".
> (gdb) run cone_01.vtp cone_01.tif 20 20 20 10 10 10
> Starting program: /net/home/aaa/itk/simple/voxelizer_itk_02 cone_01.vtp
> cone_01.tif 20 20 20 10 10 10
> [Thread debugging using libthread_db enabled]
> [New Thread 0x2b7ccd2e6df0 (LWP 1330)]
> terminate called after throwing an instance of 'std::out_of_range'
>  what():  basic_string::basic_string
>
> Program received signal SIGABRT, Aborted.
> [Switching to Thread 0x2b7ccd2e6df0 (LWP 1330)]
> 0x00002b7cccb98b45 in raise () from /lib64/libc.so.6
> (gdb) bt
> #0  0x00002b7cccb98b45 in raise () from /lib64/libc.so.6
> #1  0x00002b7cccb9a0e0 in abort () from /lib64/libc.so.6
> #2  0x00002b7ccc716d34 in __gnu_cxx::__verbose_terminate_handler () from
> /usr/lib64/libstdc++.so.6
> #3  0x00002b7ccc714ce6 in ?? () from /usr/lib64/libstdc++.so.6
> #4  0x00002b7ccc714d13 in std::terminate () from /usr/lib64/libstdc++.so.6
> #5  0x00002b7ccc714dfa in __cxa_throw () from /usr/lib64/libstdc++.so.6
> #6  0x00002b7ccc6b111a in std::__throw_out_of_range () from
> /usr/lib64/libstdc++.so.6
> #7  0x00002b7ccc6f2ebd in std::basic_string<char, std::char_traits<char>,
> std::allocator<char> >::basic_string () from /usr/lib64/libstdc++.so.6
> #8  0x00000000004e1e60 in itk::VTKPolyDataReader<itk::Mesh<double, 3u,
> itk::DefaultStaticMeshTraits<double, 3u, 3u, float, float, double> >
> >::GenerateData ()
> #9  0x000000000069234b in itk::ProcessObject::UpdateOutputData ()
> #10 0x000000000069241d in itk::ProcessObject::UpdateOutputData ()
> #11 0x00000000004c02b5 in main ()
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100702/b2ea38be/attachment-0001.htm>


More information about the Insight-users mailing list