[Insight-users] masking part of an image

shoosh moosh babygirl_25 at hotmail.com
Sun Apr 19 15:18:31 EDT 2009


Ok, I added the reader->Update(), but now I'm getting a different error:
Segmentation fault

The program apparently crashes in the for loop. 

I think something might be wrong with lines 64-65, but I'm not sure what.
inputImage=reader1->GetOutput();
inputMaskImage=reader2->GetOutput();

I attached the code again.
Thanks



> Date: Sun, 19 Apr 2009 14:57:47 -0400
> Subject: Re: [Insight-users] masking part of an image
> From: bill.lorensen at gmail.com
> To: babygirl_25 at hotmail.com
> CC: insight-users at itk.org
> 
> Do a reader1->Update() and reader2->Update() before accessing the
> outputs of the reader.
> 
> 2009/4/19 shoosh moosh <babygirl_25 at hotmail.com>:
> > Hi,
> > I wrote up a program that takes as input 2 images - a 3D image, and a 3D
> > binary mask image with 0's in the parts im not interested and 1's in the
> > parts I want to segment out. I want the program to simply multiply each
> > pixel in the original image with the corresponding pixel in the masking
> > image and produce a third image of the same size having only the region
> > specified by 1's in the mask. The code compiles, but when I run it, I get
> > this error:
> >
> > terminate called after throwing an instance of 'itk::ExceptionObject'
> >   what():
> > /home/shoosh/InsightToolkit-3.10.2/Code/IO/itkNrrdImageIO.cxx:951:
> > itk::ERROR: NrrdImageIO(0x8585a50): Write: Error wrapping nrrd for
> > output.nhdr:
> > [nrrd] nrrdWrap_nva:
> > [nrrd] _nrrdSizeCheck: axis 0 size is zero!
> >
> > Can some one tell me how to fix it. the code is attached.
> >
> >
> >
> > ________________________________
> > Get news, entertainment and everything you care about at Live.com. Check it
> > out!
> > _____________________________________
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html
> >
> > Please keep messages on-topic and check the ITK FAQ at:
> > http://www.itk.org/Wiki/ITK_FAQ
> >
> > Follow this link to subscribe/unsubscribe:
> > http://www.itk.org/mailman/listinfo/insight-users
> >
> >

_________________________________________________________________
Show them the way! Add maps and directions to your party invites. 
http://www.microsoft.com/windows/windowslive/products/events.aspx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090419/d5eef8a1/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Mask.cxx
Type: text/x-c++src
Size: 2884 bytes
Desc: not available
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090419/d5eef8a1/attachment-0001.cxx>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: CMakeLists.txt
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090419/d5eef8a1/attachment-0001.txt>


More information about the Insight-users mailing list