[Insight-users] question on ManagedITK
Dan Mueller
dan.muel at gmail.com
Wed Jun 29 22:38:56 EDT 2011
Hi Vittorio,
See responses inline below.
On 30 June 2011 02:37, Vittorio Accomazzi <vittorio.accomazzi at gmail.com> wrote:
>
> Hi Dan
>
> Thank you very much for creating managedITK, it is a really nice toolkit. Being able to use ITK with Window's form and WPF is very powerful.
> I have a coupole of questions for you, if you don't mind:
>
> 1 - I'm playing with registration, and I can not get to work the SetFixedImageMask() in image metric. Once I used the 'GetValue' throws and exception:
>
> .....
>
> itkBinaryThresholdImageFilter_IUC2IUC2 mThreshold = itkBinaryThresholdImageFilter_IUC2IUC2.New();
> mThreshold.SetInput(itkMovng);
> mThreshold.LowerThreshold = 1;
> mThreshold.UpperThreshold = 255;
> mThreshold.InsideValue = 1;
> mThreshold.OutsideValue = 0;
> mThreshold.Update();
> mThreshold.GetOutput(itkMskMovng);
> itkMovng.DisconnectPipeline();
>
> MetricType mskMetric = MetricType.New();
> mskMetric.SetFixedImage(itkFixed);
> mskMetric.SetMovingImage(itkMovng);
> mskMetric.SetTransform(transform);
> mskMetric.SetInterpolator(interpolator);
> mskMetric.ComputeGradient = false;
> mskMetric.FixedImageRegion = itkFixed.BufferedRegion;
> mskMetric.SetFixedImageMask(itkMskFixed);
> mskMetric.SetMovingImageMask(itkMskMovng);
> mskMetric.Initialize();
> double valueMsk = mskMetric.GetValue(traslation);
>
> Can you provide any suggestion on what could be wrong ?
>
> Looking at the source code the wrapper is the following :
>
>
>
> ///<summary>Get the moving image mask.</summary>
> ///<param name="mask">The itkImageBase to become the moving image mask.</param>
>
> virtual void GetMovingImageMask( itkImageBase^ mask ) override
> {
> mask->NativePointer = IntPtr((MovingImageMaskType*)m_PointerToNative->GetMovingImageMask());
>
> }
There are known problems with masks+registration in ManagedITK. I
don't have the time to track down or fix the issue(s). Sorry.
>
> 2 - On your web site you mention that ITK 4 provides native .NET wrappers. I was not able to find any trace of them. Can you provide a link ?
The ManagedITK home page says that ITK 4 *will* provide C# wrappers --
these have not yet been implemented. SimpleITK will support C#
wrappers very shortly (I have just sent a changeset). I'm not sure on
the timeline for WrapITK. I have updated the ManagedITK Google Code
page with this information.
HTH
Cheers, Dan
More information about the Insight-users
mailing list