public MultipleParameterFileRegistration(sitk.Image fixedImage, sitk.Image movingImage, RegistrationParameters parameters) : base(parameters) { this.fixedImage = ImageUtils.CastImageToFloat32(fixedImage); this.movingImage = ImageUtils.CastImageToFloat32(movingImage); elastix = new sitk.ElastixImageFilter(); for (int i = 0; i < parameters.ParameterFiles.Count; i++) { if (i == 0) { elastix.SetParameterMap(elastix.ReadParameterFile(parameters.ParameterFiles[i])); } else { elastix.AddParameterMap(elastix.ReadParameterFile(parameters.ParameterFiles[i])); } } // set output dir outputDirectory = Path.Combine(registrationParameters.OutputDirectory, "multiple_" + DateTime.Now.ToShortDateString()); if (!Directory.Exists(outputDirectory)) { Directory.CreateDirectory(outputDirectory); } elastix.SetOutputDirectory(outputDirectory); //elastix.SetLogFileName(Path.Combine(outputDirectory, registrationParameters.ElastixLogFileName)); elastix.LogToFileOn(); }
public EditParametersForm(string parameterFilename) { InitializeComponent(); filename = parameterFilename; sitk.ElastixImageFilter elx = new sitk.ElastixImageFilter(); Parametermap = elx.ReadParameterFile(filename); elx.Dispose(); }
/// <summary> /// Set parameter map by filename. /// </summary> /// <param name="file">filename of parameter map</param> public virtual void SetParameterMap(string file) { elastix.ReadParameterFile(file); }