/// <summary> /// Get default parameter map from elastix image filter for registration type. /// </summary> /// <param name="registrationType">registration type</param> /// <returns>default params</returns> private static sitk.ParameterMap GetDefaultRigidParameterMap(RegistrationDefaultParameters registrationType) { using (sitk.ElastixImageFilter elastix = new sitk.ElastixImageFilter()) { sitk.ParameterMap map = elastix.GetDefaultParameterMap(registrationType.ToString()); ChangeOrAddParamIfNotExist(ref map, "Interpolator", GetVectorString("BSplineInterpolator")); ChangeOrAddParamIfNotExist(ref map, "ResampleInterpolator", GetVectorString("FinalBSplineInterpolator")); ChangeOrAddParamIfNotExist(ref map, "FixedImagePyramid", GetVectorString("FixedRecursiveImagePyramid")); ChangeOrAddParamIfNotExist(ref map, "MovingImagePyramid", GetVectorString("MovingRecursiveImagePyramid")); ChangeOrAddParamIfNotExist(ref map, "AutomaticTransformInitialization", GetVectorString("true")); ChangeOrAddParamIfNotExist(ref map, "NumberOfResolutions", GetVectorString("8")); ChangeOrAddParamIfNotExist(ref map, "MaximumNumberOfIterations", GetVectorString("1024")); ChangeOrAddParamIfNotExist(ref map, "NumberOfSpatialSamples", GetVectorString("4096")); ChangeOrAddParamIfNotExist(ref map, "NumberOfSamplesForExactGradient", GetVectorString("4096")); ChangeOrAddParamIfNotExist(ref map, "ImageSampler", GetVectorString("Random")); ChangeOrAddParamIfNotExist(ref map, "BSplineInterpolationOrder", GetVectorString("1")); ChangeOrAddParamIfNotExist(ref map, "FinalBSplineInterpolationOrder", GetVectorString("3")); ChangeOrAddParamIfNotExist(ref map, "Metric", GetVectorString("AdvancedMeanSquares")); return(map); } }
/// <summary> /// Set parameter map to default. /// </summary> /// <param name="type"></param> /// <param name="numberOfResolutions"></param> public virtual void SetDefaultParameterMap(RegistrationDefaultParameters type, uint numberOfResolutions) { parameterMap = elastix.GetDefaultParameterMap(type.ToString(), numberOfResolutions); }