<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2900.2604" name=GENERATOR></HEAD>
<BODY>
<DIV>insight-users,您好!</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>MutualInformationImageToImageMetric< TFixedImage,TMovingImage> </DIV>
<DIV>::SampleFixedImageDomain(</DIV>
<DIV> SpatialSampleContainer& samples ) const</DIV>
<DIV>{</DIV>
<DIV>..............................</DIV>
<DIV> for( iter = samples.begin(); iter != end; ++iter )</DIV>
<DIV> {</DIV>
<DIV> // get sampled index</DIV>
<DIV> FixedImageIndexType index = randIter.GetIndex();</DIV>
<DIV> </DIV>
<DIV> // get sampled fixed image value</DIV>
<DIV> (*iter).FixedImageValue = randIter.Get(); </DIV>
<DIV> </DIV>
<DIV> // get moving image value</DIV>
<DIV> m_FixedImage->
TransformIndexToPhysicalPoint( index, </DIV>
<DIV> (*iter).FixedImagePointValue ); </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV><FONT style="BACKGROUND-COLOR: #ffff00"> //here,
Transform should taking movImage to fixImage, why here uses just the
opposite direction.</FONT></DIV>
<DIV> MovingImagePointType mappedPoint = m_Transform->
TransformPoint( (*iter).FixedImagePointValue );</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> if( m_Interpolator->
IsInsideBuffer( mappedPoint ) )</DIV>
<DIV> {</DIV>
<DIV> (*iter).MovingImageValue = m_Interpolator->
Evaluate( mappedPoint ); </DIV>
<DIV> allOutside = false;</DIV>
<DIV> }</DIV>
<DIV> else</DIV>
<DIV> {</DIV>
<DIV> (*iter).MovingImageValue = 0;//出界点</DIV>
<DIV> }</DIV>
<DIV> </DIV>
<DIV> // jump to random position</DIV>
<DIV> ++randIter; </DIV>
<DIV> } </DIV>
<DIV> if( allOutside )</DIV>
<DIV> {</DIV>
<DIV> // if all the samples mapped to the outside throw an exception</DIV>
<DIV> itkExceptionMacro(< <
"All the sampled point mapped to outside of the moving image" );</DIV>
<DIV> } </DIV>
<DIV> } </DIV>
<DIV> </DIV>
<DIV> 致</DIV>
<DIV>礼!</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> 庄吓海</DIV>
<DIV> arhye@163.com</DIV>
<DIV> 2005-04-11</DIV></BODY></HTML>