<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><DIV>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><A href="mailto:insight-users@itk.org"><FONT color=#0000ff></FONT></A>&nbsp;</P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p>&nbsp;</o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">Dear All:</P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p>&nbsp;</o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">I am trying to affine register two MR images by /MultiResImageRegistration2 in the ITK registration example.</P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p>&nbsp;</o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">But I got the below error message:</P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">*****************************************</P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">./MultiResImageRegistration2 target.hdr source1.hdr output.hdr<o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">FixedImage schedule: [4, 4, 4]<o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">[2, 2, 2]<o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">[1, 1, 1]<o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p>&nbsp;</o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">MovingImage schedule: [4, 4, 4]<o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">[2, 2, 2]<o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">[1, 1, 1]<o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p>&nbsp;</o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">-------------------------------------<o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">MultiResolution Level : 0<o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p>&nbsp;</o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">0<SPAN style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN>-0.737066<SPAN style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN>[1, 0, 0, 0, 1, 0, nan, nan, 1, 1.47236, -2.75363, -0.781408]<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>0<o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">ExceptionObject caught !<o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p>&nbsp;</o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">itk::ExceptionObject (0xdf71480)<o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">Location: "void itk::MattesMutualInformationImageToImageMetric&lt;TFixedImage, TMovingImage&gt;::GetValueAndDerivative(const typename itk::ImageToImageMetric&lt;TFixedImage, TMovingImage&gt;::ParametersType&amp;, typename itk::ImageToImageMetric&lt;TFixedImage, TMovingImage&gt;::MeasureType&amp;, typename itk::ImageToImageMetric&lt;TFixedImage, TMovingImage&gt;::DerivativeType&amp;) const [with TFixedImage = itk::Image&lt;float, 3u&gt;, TMovingImage = itk::Image&lt;float, 3u&gt;]" <o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">File: /home/gtao/tools/ITK/Source/Code/Algorithms/itkMattesMutualInformationImageToImageMetric.txx<o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">Line: 1138<o:p></o:p></P>
<DIV style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 1pt; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 3pt dotted; mso-element: para-border-div">
<P class=MsoNormal style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; MARGIN: 0in 0in 0pt; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none; mso-border-bottom-alt: dotted windowtext 3.0pt; mso-padding-alt: 0in 0in 1.0pt 0in">Description: itk::ERROR: MattesMutualInformationImageToImageMetric(0xc6b0930): Joint PDF summed to zero</P></DIV>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p>&nbsp;</o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">The two images are all set by the middle of images as origin. And they look already affined together. Only need little change.</P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p>&nbsp;</o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">I have changed the following in the MultiResImageRegistration2.cxx to meet my need</P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p>&nbsp;</o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">1: const<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>unsigned int<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>Dimension = 3;<o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">2: typedef<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>short int<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>PixelType;</P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">3: metric-&gt;SetNumberOfSpatialSamples(5223360); <BR>Since my image are 3D volume. So I set the numberof spatial samples as the fraction of <SPAN style="mso-spacerun: yes">&nbsp;</SPAN>the number of my fixed image voxels. I tried 0.1 percent, 0.2 percent and 0.8 percent. All get the same error.</P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p>&nbsp;</o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">Can somebody help me to figure our this problem.</P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p>&nbsp;</o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p>&nbsp;</o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">Best regards</P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p>&nbsp;</o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">Baoyun</P></DIV></div><br>



      </body></html>