Ejemplo n.º 1
0
        private void runRemotePhaseRetrieval(object sender, EventArgs e)
        {
            // Run Job Convert To TDF:
            IJob zJob;

            // Execute with conventional flat fielding:
            mPreProcessOnGoing     = false;
            mReconstructionOnGoing = false;


            string zFileName = Path.GetFileName(mInputTDF);

            zFileName = zFileName.Remove(zFileName.Length - 4) + "_corr.tdf";



            string zString   = string.Empty;
            string pythoncmd = (string.IsNullOrEmpty(Properties.Settings.Default.SYRMEP_HPC_PythonPath)) ? "python " : Properties.Settings.Default.SYRMEP_HPC_PythonPath + "/python ";

            // Unix-like command line:
            zString = pythoncmd + Properties.Settings.Default.SYRMEP_HPC_SourcePath + '/' + Properties.Settings.Default.GetTDFDimensionJob + " " + mInputTDF;
            string zResult = SYRMEP_HPC.Execute(zString);

            string[] zLines       = zResult.Split('\n');
            int      zProjections = Int32.Parse((zLines[0].Split(' '))[1]);
            int      zSlices      = Int32.Parse((zLines[1].Split(' '))[1]);


            int zTo = zProjections - 1;

            int zThreads = Convert.ToInt32(Properties.Settings.Default.SYRMEP_HPC_Processes);

            zJob = new RemotePhaseRetrievalJob(
                zFileName,
                zFileName.Remove(zFileName.Length - 4) + "_phrt.tdf",
                this.mMethod,
                0,
                zTo,
                this.mParam1,
                this.mParam2,
                this.mDistance,
                this.mEnergy,
                this.mPixelsize,
                this.mPad,
                zThreads
                );


            // Create an instance of JobExecuter with the pre processing job:
            IJobExecuter zExecuter = new RemoteJobExecuter(zJob);

            // Execute the job splitting it with several processes (if specified):
            zExecuter.Run();

            mJobMonitor.Run(zExecuter, "tomo");

            // Reset status bar:
            this.toolStripStatusLabel1.Text = string.Empty;

            mPhaseRetrievalOnGoing = true;
        }
Ejemplo n.º 2
0
        private void runRemoteReconstruction(object sender, EventArgs e)
        {
            // Run Job Convert To TDF:
            IJob zJob;

            mPreProcessOnGoing     = false;
            mPhaseRetrievalOnGoing = false;


            string zFileName = Path.GetFileName(mInputTDF);

            zFileName = zFileName.Remove(zFileName.Length - 4) + "_corr_phrt.tdf";

            string zString   = string.Empty;
            string pythoncmd = (string.IsNullOrEmpty(Properties.Settings.Default.SYRMEP_HPC_PythonPath)) ? "python " : Properties.Settings.Default.SYRMEP_HPC_PythonPath + "/python ";

            // Unix-like command line:
            zString = pythoncmd + Properties.Settings.Default.SYRMEP_HPC_SourcePath + '/' + Properties.Settings.Default.GetTDFDimensionJob + " " + mInputTDF;
            string zResult = SYRMEP_HPC.Execute(zString);

            string[] zLines       = zResult.Split('\n');
            int      zProjections = Int32.Parse((zLines[0].Split(' '))[1]);
            int      zSlices      = Int32.Parse((zLines[1].Split(' '))[1]);


            int zTo = zSlices - 1;

            int zThreads = Convert.ToInt32(Properties.Settings.Default.SYRMEP_HPC_Processes);

            // Unix-style:
            string zOutputPath = Properties.Settings.Default.SYRMEP_HPC_OutputPath + '/' + Path.GetFileNameWithoutExtension(mInputTDF) + '/' + @"slices" + '/';

            if (mAngles_ProjTo == 0)
            {
                mAngles_ProjTo = zProjections - 1;
            }



            // Create an instance for the reconstruction job:
            zJob = new RemoteReconstructionJob(
                zFileName,
                zOutputPath,
                false,
                mAirSx,
                mAirDx,
                mFlatEnd,
                mHalfHalf,
                mHalfHalfLine,
                mExtFOV,
                mExtFOVRight,
                mExtFOVOverlap,
                mExtFOVNormalize,
                mExtFOVAverage,
                mRingRemoval,

                mAngles,
                mAngles_ProjFrom,
                mAngles_ProjTo,
                mCenter,
                mReconFunc,
                mReconParam1,
                mScale,
                mOverPaddding,
                mLogTransform,
                mCircle,
                mZeroneMode,
                mCorrectionOffset,
                0,
                zTo,
                zThreads,
                mDecimateFactor,
                mDownscaleFactor,

                mPostProcess,
                mPostProcessPolarFilt,
                mPostProcessConvertArgs,
                mPostProcessCropArgs,
                mDynamicFlatFielding,

                mRolling,
                mRollShift
                );


            // Create an instance of JobExecuter with the pre processing job:
            IJobExecuter zExecuter = new RemoteJobExecuter(zJob);

            // Execute the job splitting it with several processes (if specified):
            zExecuter.Run();

            // Start the monitoring of the job:
            mJobMonitor.Run(zExecuter, "slice");

            this.mReconstructionOnGoing = true;

            // Reset status bar:
            this.toolStripStatusLabel1.Text = string.Empty;
        }
Ejemplo n.º 3
0
        private void btnRun_Click(object sender, EventArgs e)
        {
            // Run Job Convert To TDF:
            IJob zJob;

            string zFileName = Path.GetFileName(mInputTDF);


            string zString   = string.Empty;
            string pythoncmd = (string.IsNullOrEmpty(Properties.Settings.Default.SYRMEP_HPC_PythonPath)) ? "python " : Properties.Settings.Default.SYRMEP_HPC_PythonPath + "/python ";

            // Unix-like command line:
            zString = pythoncmd + Properties.Settings.Default.SYRMEP_HPC_SourcePath + '/' + Properties.Settings.Default.GetTDFDimensionJob + " " + mInputTDF;
            string zResult = SYRMEP_HPC.Execute(zString);

            string[] zLines       = zResult.Split('\n');
            int      zProjections = Int32.Parse((zLines[0].Split(' '))[1]);
            int      zSlices      = Int32.Parse((zLines[1].Split(' '))[1]);

            int zTo = zSlices - 1;


            int zThreads = Convert.ToInt32(Properties.Settings.Default.SYRMEP_HPC_Processes);

            // Execute with conventional flat fielding:
            zJob = new RemotePreProcessingJob(
                // Get combobox selection (in handler)
                zFileName,
                zFileName.Remove(zFileName.Length - 4) + "_corr.tdf",
                0,
                zTo,
                mAirSx,
                mAirDx,
                this.mFlatEnd,    // use flat at the end
                this.mHalfHalf,
                this.mHalfHalfLine,
                this.mExtFOV,
                this.mExtFOVRight,
                this.mExtFOVOverlap,
                this.mExtFOVNormalize,
                this.mExtFOVAverage,
                this.mRingRemoval,
                this.mDynamicFlatFielding,
                zThreads,
                false,
                "-"
                );


            // Create an instance of JobExecuter with the pre processing job:
            IJobExecuter zExecuter = new RemoteJobExecuter(zJob);

            // Execute the job splitting it with several processes (if specified):
            zExecuter.Run();

            // Start the monitoring of the job:
            mJobMonitor.Run(zExecuter, "sino");



            this.mPreProcessOnGoing = true;

            this.lblPreProcessing.Enabled  = true;
            this.lblPhaseRetrieval.Enabled = false;
            this.lblReconstruction.Enabled = false;

            // Reset status bar:
            this.toolStripStatusLabel1.Text = string.Empty;
        }