예제 #1
0
        static void Main(string[] args)
        {
            // connect to the grid
            var engine = new VelocityEngine();

            if (!engine.loginToWorkstation(USER, PASS, WORKSTATION_PATH, true))
            {
                //if (!engine.loginToGrid(USER, PASS, GRID_IP, GRID_PORT, GRID_DB)) {
                throw new System.Exception(engine.getErrorMessage());
            }
            AppDomain.CurrentDomain.ProcessExit += (source, data) => { engine.logout(); };

            // try to list liver patient volumes
            loadAndListVolumes(engine, LIVER_PATIENT_ID);

            var importOps = engine.getImportOperations();

            Console.WriteLine("Importing SPECT, Liver ...");
            if (importOps.importDirectory(LIVER_IMPORT_DIR, true))
            {
                Console.WriteLine("Successfully imported.");
            }
            else
            {
                Console.WriteLine("Import error: {0}", importOps.getErrorMessage());
            }

            // try again to list the volumes for the liver patient
            loadAndListVolumes(engine, LIVER_PATIENT_ID);
        }