[Insight-users] Segmentation Fault with ImageIterator
Katharina Losch
k-losch at web.de
Thu Jul 26 18:01:06 EDT 2012
El 25.07.2012 02:36, David Doria escribió:
> On Tue, Jul 24, 2012 at 6:32 PM, Katharina Losch <k-losch at web.de
> <mailto:k-losch at web.de>> wrote:
>
> Dear insight-users,
> I am experiencing cases of 'Segmentation Fault' while running my
> program, and so far I haven't figured out what exactly goes wrong.
> First, I am loading two images, a 3D-tiff file and a 3D-vtk vector
> file (both of the same size), then I'm using ImageIterator to
> displace each point of the tiff-file by the related vector. The
> vtk-file is designed in a way that none of these displacements
> should displace the point out of the image region, so in effect
> this should result in another image of the same size like the others.
> However, almost all the times I have been running the program, the
> ImageIterator stops after a certain number of iterations with a
> 'Segmentation Fault' (with each image it stops at a unique, but
> fixed index). Additionally, after several tries with different
> sizes of the image, and several tries with the same image, it
> seems to work sometimes on some images, but mostly it doesn't. So
> far I haven't been able to find a correlation of imagesize or
> encoding to 'Segmentation Fault'.
> Last but not least, neither debugging nor a memory check helpe to
> find the mistake, but while using the memory check the program
> worked perfectly on an image it never used to work before. Did
> anyone else also experience this problem and could you maybe
> explain it to me or how to find a solution?
> Thanks in advance.
> Sincerely,
> Katharina
>
>
> If you could hard code some demo images and make the simplest possible
> compilable example that demonstrates the problem, that would really
> help here. Reduce everything to 2D, de-randomize the result by hard
> coding the displacements, etc.
>
> David
Hi,
thanks for your answer. I tried out some very simple 2D-images and also
slices of the actual images I'm using. Although the debugger still warns
about a segmentation fault with said slices, right after the
ImageRegionIterator is finished, it doesn't do so with the simple
images. In all the 2D cases the program 'worked well' in the sense that
I got sensible output images even in the cases of segmentation fault.
What do you think should I do next to find the source of the problem?
Thanks a lot,
Katharina
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20120727/fb21a9c1/attachment.htm>
More information about the Insight-users
mailing list