<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    I think this issue relates to the way the metrics compute gradients.
    It can be reproduced using <br>
    <br>
    Examples/RegistrationITKv4/ImageRegistration1.cxx<br>
    and <br>
    Examples/RegistrationITKv3/ImageRegistration1.cxx<br>
    <br>
    by setting Dimensions to 3, and using 2D images as inputs. <br>
    <br>
    I found using: metric->ComputeGradientOff()<br>
    will allow the registration to proceed for ITKv3 using the
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    MeanSquaresImageToImageMetric, but there is no such function for the
    v4 version. <br>
    Using a metric that does not require gradients (eg Mattes) will
    allow the registration to proceed in both v3 and v4. <br>
    <br>
    I humbly suggest the registration framework and metrics should be
    able to handle this situation. Also of note to those interested, the
    v3 registration on my system goes about twice as fast per iteration.
    <br>
    <br>
    What are your thoughts?<br>
    <br>
    David<br>
    <br>
    <div class="moz-cite-prefix">On 11/12/2015 08:41 PM, Matias
      Montroull wrote:<br>
    </div>
    <blockquote
cite="mid:CAKKNfuJmQ65G_D4ishVM6JoMmWivR7GB1DCpHYKsP_3QhQEukA@mail.gmail.com"
      type="cite">
      <p dir="ltr">David, would you be able to share the code you wrote?</p>
      <div class="gmail_quote">On Nov 12, 2015 10:39 PM, "David Burns"
        <<a moz-do-not-send="true"
          href="mailto:david.mo.burns@gmail.com">david.mo.burns@gmail.com</a>>
        wrote:<br type="attribution">
        <blockquote class="gmail_quote" style="margin:0 0 0
          .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear
          Insight,<br>
          <br>
          I am having the following trouble attempting 2D/3D
          registration of xray/CT with ITK v4 registration framework.<br>
          <br>
          The basics: The moving image is a 3D volume, and the fixed
          image is a 2D projection. An interpolator calculates a
          synthetic cone-beam projection for the moving image (volume)
          and compares to the fixed 2D image.<br>
          <br>
          The v4 registration framework doesn't allow me to use a 2D
          fixed and 3D moving image -> won't compile. So I need to
          setup the fixed image as 3D, even though it is 2D data. I can
          compile, but I get the following error at run time<br>
          <br>
          <br>
          ExceptionObject caught !<br>
          <br>
          itk::ExceptionObject (0x20cfac0)<br>
          Location: "void
          itk::RecursiveSeparableImageFilter<TInputImage,
          TOutputImage>::BeforeThreadedGenerateData() [with
          TInputImage = itk::Image<float, 3u>; TOutputImage =
          itk::Image<float, 3u>]"<br>
          File:
          /usr/local/include/ITK-4.8/itkRecursiveSeparableImageFilter.hxx<br>
          Line: 245<br>
          Description: itk::ERROR:
          RecursiveGaussianImageFilter(0x2089fb0): The number of pixels
          along direction 2 is less than 4. This filter requires a
          minimum of four pixels along the dimension to be processed.<br>
          <br>
          It seems this behavior does not occur in the v3 registration
          framework and 2D/3D registrations were possible, however, I
          want to take advantage of the threading features in v4. How
          would you suggest I proceed?<br>
          <br>
          <br>
          Thanks<br>
          David Burns<br>
          <br>
          <br>
          <br>
          <br>
          <br>
          <br>
          _______________________________________________<br>
          Powered by <a moz-do-not-send="true"
            href="http://www.kitware.com" rel="noreferrer"
            target="_blank">www.kitware.com</a><br>
          <br>
          Visit other Kitware open-source projects at<br>
          <a moz-do-not-send="true"
            href="http://www.kitware.com/opensource/opensource.html"
            rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
          <br>
          Kitware offers ITK Training Courses, for more information
          visit:<br>
          <a moz-do-not-send="true"
            href="http://kitware.com/products/protraining.php"
            rel="noreferrer" target="_blank">http://kitware.com/products/protraining.php</a><br>
          <br>
          Please keep messages on-topic and check the ITK FAQ at:<br>
          <a moz-do-not-send="true"
            href="http://www.itk.org/Wiki/ITK_FAQ" rel="noreferrer"
            target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
          <br>
          Follow this link to subscribe/unsubscribe:<br>
          <a moz-do-not-send="true"
            href="http://public.kitware.com/mailman/listinfo/insight-developers"
            rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/insight-developers</a><br>
          _______________________________________________<br>
          Community mailing list<br>
          <a moz-do-not-send="true" href="mailto:Community@itk.org"
            target="_blank">Community@itk.org</a><br>
          <a moz-do-not-send="true"
            href="http://public.kitware.com/mailman/listinfo/community"
            rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/community</a><br>
        </blockquote>
      </div>
    </blockquote>
    <br>
  </body>
</html>