<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
Ok, I added the reader->Update(), but now I'm getting a different error:<br>Segmentation fault<br><br>The program apparently crashes in the for loop. <br><br>I think something might be wrong with lines 64-65, but I'm not sure what.<br>inputImage=reader1->GetOutput();<br>inputMaskImage=reader2->GetOutput();<br><br>I attached the code again.<br>Thanks<br><br><br><br>> Date: Sun, 19 Apr 2009 14:57:47 -0400<br>> Subject: Re: [Insight-users] masking part of an image<br>> From: bill.lorensen@gmail.com<br>> To: babygirl_25@hotmail.com<br>> CC: insight-users@itk.org<br>> <br>> Do a reader1->Update() and reader2->Update() before accessing the<br>> outputs of the reader.<br>> <br>> 2009/4/19 shoosh moosh <babygirl_25@hotmail.com>:<br>> > Hi,<br>> > I wrote up a program that takes as input 2 images - a 3D image, and a 3D<br>> > binary mask image with 0's in the parts im not interested and 1's in the<br>> > parts I want to segment out. I want the program to simply multiply each<br>> > pixel in the original image with the corresponding pixel in the masking<br>> > image and produce a third image of the same size having only the region<br>> > specified by 1's in the mask. The code compiles, but when I run it, I get<br>> > this error:<br>> ><br>> > terminate called after throwing an instance of 'itk::ExceptionObject'<br>> > what():<br>> > /home/shoosh/InsightToolkit-3.10.2/Code/IO/itkNrrdImageIO.cxx:951:<br>> > itk::ERROR: NrrdImageIO(0x8585a50): Write: Error wrapping nrrd for<br>> > output.nhdr:<br>> > [nrrd] nrrdWrap_nva:<br>> > [nrrd] _nrrdSizeCheck: axis 0 size is zero!<br>> ><br>> > Can some one tell me how to fix it. the code is attached.<br>> ><br>> ><br>> ><br>> > ________________________________<br>> > Get news, entertainment and everything you care about at Live.com. Check it<br>> > out!<br>> > _____________________________________<br>> > Powered by www.kitware.com<br>> ><br>> > Visit other Kitware open-source projects at<br>> > http://www.kitware.com/opensource/opensource.html<br>> ><br>> > Please keep messages on-topic and check the ITK FAQ at:<br>> > http://www.itk.org/Wiki/ITK_FAQ<br>> ><br>> > Follow this link to subscribe/unsubscribe:<br>> > http://www.itk.org/mailman/listinfo/insight-users<br>> ><br>> ><br><br /><hr />See all the ways you can stay connected <a href='http://www.microsoft.com/windows/windowslive/default.aspx' target='_new'>to friends and family</a></body>
</html>