[Insight-users] Image Registration with Center of rotation outside of image bounds
C.Cagatay Bilgin
bilgic at cs.rpi.edu
Sat Jan 17 17:15:22 EST 2009
Mike,
That exception means that your fixed image
does not line up with any pixels in the moving
image.
You might find these posts helpful:
http://www.itk.org/pipermail/insight-users/2007-January/020565.html
http://www.cmake.org/pipermail/insight-users/2004-January/006174.html
Regards,
Cagatay Bilgin
On Jan 16, 2009, at 5:40 PM, Michael Jackson wrote:
> Hello all,
> I am new to ITK and trying to wade through the software guide. I
> am having pretty good success registering my data but I am currently
> stumbling a bit.
> I have a pair of images the need to be registered. In addition to
> the X,Y translation component there is also a rotational component
> that needs to be taken into account. The problem I am having is that
> the center of rotation seems to be "off" the actual image. For
> example each of image's origin is around (10,10) and has a size of
> (100,100) but the center of rotation is approximately (0,0). I am
> using the example file "ImageRegistration5.cxx" as a starting point.
> I have changed the inputs to read my data files, set the origin and
> spacing. I then change the code to set the center of rotation to
> what I think it should be and run the program. I get an exception
> when running:
>
> 0 3860.12 [0.00834802, 0, 0, 0.0253854, 0.198207]
> ExceptionObject caught !
>
> itk::ExceptionObject (0x56bf10)
> Location: "void itk::MeanSquaresImageToImageMetric<TFixedImage,
> TMovingImage>::GetValueAndDerivative(const typename
> itk::ImageToImageMetric<TFixedImage,
> TMovingImage>::TransformParametersType&, typename
> itk::ImageToImageMetric<TFixedImage, TMovingImage>::MeasureType&,
> typename itk::ImageToImageMetric<TFixedImage,
> TMovingImage>::DerivativeType&) const [with TFixedImage = main(int,
> char**)::FixedImageType, TMovingImage = main(int,
> char**)::MovingImageType]"
> File: /Users/Shared/Toolkits/ITK-3.10.1/include/InsightToolkit/
> Algorithms/itkMeanSquaresImageToImageMetric.txx
> Line: 368
> Description: itk::ERROR: MeanSquaresImageToImageMetric(0x569100):
> All the points mapped to outside of the moving image
>
> Am I going about this the correct way? Any Help or nudges in the
> proper direction would be most appreciated...
>
> Here are the important parts of the code (I think.. )
>
> FixedImageType::PointType fixedOrigin;
> fixedOrigin[0] = 48390.5;
> fixedOrigin[1] = 49977.75;
>
> MovingImageType::PointType movingOrigin;
> movingOrigin[0] = 48390.5;
> movingOrigin[1] = 49977.75;
>
> fixedImageReader->GetOutput()->SetOrigin(fixedOrigin);
> movingImageReader->GetOutput()->SetOrigin(movingOrigin);
>
> //--- Set the Spacing of the images
> FixedImageType::SpacingType fixedSpacing;
> fixedSpacing[0] = 0.207987;
> fixedSpacing[1] = 0.207987;
> MovingImageType::SpacingType movingSpacing;
> movingSpacing[0] = 0.207987;
> movingSpacing[1] = 0.207987;
>
> fixedImageReader->GetOutput()->SetSpacing(fixedSpacing);
> movingImageReader->GetOutput()->SetSpacing(movingSpacing);
>
>
>
> TransformType::InputPointType centerMoving;
> centerMoving[0] = 46979.2;
> centerMoving[1] = 48347.5;
> TransformType::InputPointType centerFixed;
>
> centerFixed[0] = 46979.2;
> centerFixed[1] = 48347.5;
> transform->SetTranslation( centerMoving - centerFixed );
> transform->SetAngle( 0.0 );
> registration->SetInitialTransformParameters( transform-
> >GetParameters() );
>
>
> _________________________________________________________
> Mike Jackson mike.jackson at bluequartz.net
> BlueQuartz Software www.bluequartz.net
> Principal Software Engineer Dayton, Ohio
>
>
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
More information about the Insight-users
mailing list