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();
        }
示例#2
0
        public EditParametersForm(string parameterFilename)
        {
            InitializeComponent();

            filename = parameterFilename;
            sitk.ElastixImageFilter elx = new sitk.ElastixImageFilter();
            Parametermap = elx.ReadParameterFile(filename);
            elx.Dispose();
        }
示例#3
0
 /// <summary>
 /// Set parameter map by filename.
 /// </summary>
 /// <param name="file">filename of parameter map</param>
 public virtual void SetParameterMap(string file)
 {
     elastix.ReadParameterFile(file);
 }