<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
Thanks Sergiy!!<br><br>The problem was the manually created image Dsk; I change the lines as you said me and now it runs perfectly.<br><br>Regards,<br>Daniela<br><br>> Date: Fri, 6 Aug 2010 22:16:48 -0700<br>> From: volkovych@gmail.com<br>> To: insight-users@itk.org<br>> Subject: Re: [Insight-users] Iterators: PROBLEM<br>> <br>> <br>> I think the problem appears when the program tries to increment one of the<br>> iterators.<br>> Try to replace the "for" line to this:<br>> <br>> for (DskIt.GoToBegin(), DFltIt.GoToBegin(),<br>> DSubIt.GoToBegin();!DskIt.IsAtEnd() && !DFltIt.IsAtEnd() &&<br>> !DSubIt.IsAtEnd(); ++DskIt, ++DFltIt, ++DSubIt)<br>> <br>> If it doesn't go to the internal part of the loop at all, it means that one<br>> of your images is empty (the region wasn't allocated properly). You may<br>> identify which iterator creates a problem by:<br>> <br>> DskIt.GoToBegin();<br>> if (DskIt.IsAtEnd())<br>> std::cerr << "Not ok ;-("<< std::endl;<br>> <br>> If the problem appeared due to the manually created image Dsk, try to<br>> allocate it with this lines:<br>> <br>> ImageType::Pointer Dsk = ImageType::New(); <br>> Dsk->SetRegions(DFlt->GetLargestPossibleRegion()); <br>> Dsk->Allocate();<br>> <br>> But be aware that DFlt and DSub images should already have been filled by<br>> the values before doing it.<br>> <br>> Also you may initialize iterators based on the LargestPossibleRegion:<br>> <br>> IteratorType DskIt (Dsk, Dsk->GetLargestPossibleRegion()); <br>> ConstIteratorType DFltIt (DFlt, DFlt->GetLargestPossibleRegion()); <br>> ConstIteratorType DSubIt (DSub, DSub->GetLargestPossibleRegion()); <br>> <br>> If it still doesn't work, please, place the larger part of code (I want to<br>> see how all images are obtained to be sure that you haven't errors in the<br>> other part of code).<br>> <br>> Sergiy.<br>> -- <br>> View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Iterators-PROBLEM-tp5381369p5383008.html<br>> Sent from the ITK Insight Users mailing list archive at Nabble.com.<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>> Kitware offers ITK Training Courses, for more information visit:<br>> http://www.kitware.com/products/protraining.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>                                            </body>
</html>