Esempio n. 1
0
        static void Main(string[] args)
        {
            try {
                if (args.Length < 3)
                {
                    Console.WriteLine("Usage: SimpleGaussian <input> <sigma> <output>");
                    return;
                }
                ImageFileReader reader = new ImageFileReader();
                reader.setFileName(args[0]);
                SmartPointerImage image = reader.execute();

                Console.WriteLine(image.toString());

                Gaussian gaussian = new Gaussian();
                gaussian.setSigma(Double.Parse(args[1]));
                image = gaussian.execute(image);

                Console.WriteLine(image.toString());

                ImageFileWriter writer = new ImageFileWriter();
                writer.setFileName(args[2]);
                writer.execute(image);
            } catch (Exception ex) {
                Console.WriteLine(ex);
            }
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            try {
                if (args.Length < 4)
                {
                    Console.WriteLine("Usage: SimpleElastix <fixedImage> <movingImage> <inputImage> <parameterFile> <output>");
                    return;
                }
                // Make transform
                SimpleElastix   elastix;
                ImageFileReader reader = new ImageFileReader();
                reader.SetFileName(args[0]);
                elastix.SetFixedImage(reader.Execute());
                reader.SetFileName(args[1]);
                elastix.SetMovingImage(reader.Execute());
                elastix.SetParameterMap(ReadParameterFile(args[3]));
                elastix.Execute();

                // Instantiate transformix
                SimpleTransformix transformix;

                // Read input
                reader.SetFileName(args[4]);
                transformix.SetInputImage(reader.execute());
                transformix.SetTransformParameterMapList(elastix.GetTransformParameterMapList());

                // Perform warp
                transformix.LogToConsoleOn();
                transformix.Execute();

                // Write result image
                sitk.WriteImage(transformix.GetResultImage(), args[5]);
            } catch (Exception ex) {
                Console.WriteLine(ex);
            }
        }
Esempio n. 3
0
 static void Main(string[] args)
 {
     try {
       if (args.Length < 3) {
           Console.WriteLine("Usage: SimpleGaussian <input> <sigma> <output>");