[Insight-users] masking part of an image

shoosh moosh babygirl_25 at hotmail.com
Sun Apr 19 14:43:30 EDT 2009


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.



_________________________________________________________________
News, entertainment and everything you care about at Live.com. Get it now!
http://www.live.com/getstarted.aspx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090419/d1f09e43/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Mask.cxx
Type: text/x-c++src
Size: 2281 bytes
Desc: not available
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090419/d1f09e43/attachment.cxx>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: CMakeLists.txt
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090419/d1f09e43/attachment.txt>


More information about the Insight-users mailing list