<DIV> Hi,</DIV>
<DIV> When I use the "itkBinaryMask3DMeshSource" to creat a mesh,compliled without error.But it cannot run.There is a warning likes "0x******** cannot be read"and break at the point in the"itkBinaryMask3DMeshSource.txx "</DIV>
<DIV> So I look over the "itkBinaryMask3DMeshSource.txx ",the code below make me confused.</DIV>
<DIV> //////////////////////</DIV>
<DIV> InputImageIterator it1( m_InputImage, m_InputImage->GetBufferedRegion() );<BR> InputImageIterator it2( m_InputImage, m_InputImage->GetBufferedRegion() );<BR> InputImageIterator it3( m_InputImage, m_InputImage->GetBufferedRegion() );<BR> InputImageIterator it4( m_InputImage, m_InputImage->GetBufferedRegion() );</DIV>
<DIV> it1.GoToBegin();<BR> it2.GoToBegin();<BR> it3.GoToBegin();<BR> it4.GoToBegin();</DIV>
<DIV> InputImageSizeType inputImageSize = m_InputImage->GetBufferedRegion().GetSize();<BR> m_ImageWidth = inputImageSize[0];<BR> m_ImageHeight = inputImageSize[1];<BR> m_ImageDepth = inputImageSize[2];<BR> int frame = m_ImageWidth * m_ImageHeight;<BR> int row = m_ImageWidth;</DIV>
<DIV>
<DIV> </DIV></DIV>
<DIV> int i = 0;<BR> int j;</DIV>
<DIV> while ( i < frame )<BR> {<BR> ++it3;<BR> ++it1;<BR> i++;<BR> }</DIV>
<DIV> i = 0;</DIV>
<DIV> while ( i < row )<BR> {<BR> ++it2;<BR> ++it4;<BR> i++;<BR> }</DIV>
<DIV> </DIV>
<DIV>while ( !it4.IsAtEnd() )<BR> {<BR> vertexindex = 0;</DIV>
<DIV> if ( it1.Value() == m_ObjectValue ) vertexindex += 1;<BR> if ( it2.Value() == m_ObjectValue ) vertexindex += 8;<BR> if ( it3.Value() == m_ObjectValue ) vertexindex += 16;<BR> if ( it4.Value() == m_ObjectValue ) vertexindex += 128;<BR> ++it1;<BR> ++it2;<BR> ++it3;<BR> ++it4;<BR>///////////////////////////////////////////////////</DIV>
<DIV>
<DIV>If m_ImageWidth = m_ImageHeight = 512, m_ImageDepth = 1,so frame = 512*512 =262144,row = 512. Well,after</DIV>
<DIV><EM>while ( i < frame )<BR> {<BR> ++it3;<BR> ++it4;<BR> i++;<BR> }</EM></DIV><EM>
<DIV><BR></DIV></EM>the offset of it4 or it3 is <STRONG>262144.</STRONG>then</DIV>
<DIV><EM>while ( i < row )<BR> {<BR> ++it2;<BR> ++it4;<BR> i++;<BR> };</EM><BR>the offset of it4 is <STRONG>262144+512 =262656.</STRONG>but the it4.IsAtEnd() is <STRONG>262144.so the lines </STRONG>while ( !it4.IsAtEnd() )<BR>will run and not stop. and the offsets of the iterators will overflow.<BR>--<BR></DIV>
<DIV>胡宝平</DIV><br><!-- footer --><br><hr/>
<a href="http://www.yeah.net">网易免费邮,全球最大的中文免费邮箱</a>