[Insight-users] Problems converting ImageRegistration2.cxx to C#

Carl Bateman Carl.Bateman at icr.ac.uk
Fri Mar 26 08:51:02 EDT 2010


I'm a new user of Managed-ITK with C# and I'm trying to convert ImageRegistration2.cxx to C# but I'm stuck about half-way through. Specifically, I'm unsure how to convert the following code:

  FixedImageType::RegionType fixedImageRegion = fixedNormalizer->GetOutput()->GetBufferedRegion();
  registration->SetFixedImageRegion( fixedImageRegion );

  typedef RegistrationType::ParametersType ParametersType;
  ParametersType initialParameters( transform->GetNumberOfParameters() );

I've got as far as
  itkImageRegion fixedImageRegion = fixedNormalizer.GetOutput();

but I'm unable ro access the buffered region.

Any advice would be appreciated.



Additionally, I was having problems setting the variance values for fixedSmoother and movingSmoother (these seem to be arrays in C#). So
[C++]
  fixedSmoother->SetVariance( 2.0 );
  movingSmoother->SetVariance( 2.0 );

becomes
[C#]
  fixedSmoother.Variance[0] = 2.0;
  movingSmoother.Variance[0] = 2.0;

Is this the correct approach?

Many thanks in advance.

Carl Bateman


The Institute of Cancer Research: Royal Cancer Hospital, a charitable Company Limited by Guarantee, Registered in England under Company No. 534147 with its Registered Office at 123 Old Brompton Road, London SW7 3RP.

This e-mail message is confidential and for use by the addressee only.  If the message is received by anyone other than the addressee, please return the message to the sender by replying to it and then delete the message from your computer and network.


More information about the Insight-users mailing list