Esempio n. 1
0
        private void btnConvert_Click(object sender, EventArgs e)
        {
            string zTDFFile = ((KeyValuePair <string, string>) this.cbxInput.SelectedItem).Key;
            IJob   zJob;

            // Create an instance for the phase retrieval job:
            zJob = new TDF2TIFFJob(
                zTDFFile,
                this.zOutputPathTxb.Text,
                (this.chkConsiderSubset.Checked) ? Convert.ToInt32(this.nudTDFToTIFFFrom.Value) : 0,
                (this.chkConsiderSubset.Checked) ? Convert.ToInt32(this.nudTDFToTIFFTo.Value) : Convert.ToInt32(this.nudTDFToTIFFTo.Maximum),
                (this.chkData.Checked) ? tbxProjectionPrefix.Text : "-",
                (this.tbxFlatPrefix.Enabled) ? ((this.chkDataWhite.Checked) ? tbxFlatPrefix.Text : "-") : "-",
                (this.tbxDarkPrefix.Enabled) ? ((this.chkDataDark.Checked) ? tbxDarkPrefix.Text : "-") : "-",
                this.rbtDirectOrder.Checked,
                this.btnTIFFFormat.Checked,
                1
                );

            // Create an instance of JobExecuter with the Phase Retrieval job
            // splitting it into several processes (if specified):
            JobExecuter zExecuter = new JobExecuter(zJob);

            // Execute the job:
            zExecuter.Run();

            // Start the monitoring of the job:
            if (chkData.Checked)
            {
                mJobMonitor.Run(zExecuter, tbxProjectionPrefix.Text);
            }
            else
            {
                if ((chkDataDark.Checked) && !(chkDataWhite.Checked))
                {
                    // Only darks are created:
                    mJobMonitor.Run(zExecuter, this.tbxDarkPrefix.Text, TDFReader.GetNumberOfDarks(zTDFFile));
                }
                else
                {
                    if (!(chkDataDark.Checked) && (chkDataWhite.Checked))
                    {
                        // Only flats are created:
                        mJobMonitor.Run(zExecuter, this.tbxFlatPrefix.Text, TDFReader.GetNumberOfFlats(zTDFFile));
                    }
                    else
                    {
                        // Both flats and darks are created but STP-Core first creates
                        // flats and then darks, so monitor the dark prefix:
                        mJobMonitor.Run(zExecuter, this.tbxDarkPrefix.Text, TDFReader.GetNumberOfDarks(zTDFFile));
                    }
                }
            }
        }
Esempio n. 2
0
        private void btnConvert_Click(object sender, EventArgs e)
        {
            // Run Job Convert To TDF:
            IMonitoredJob zJob;

            // Check output file:
            if (File.Exists(Properties.Settings.Default.FormSettings_WorkingPath + Path.DirectorySeparatorChar +
                            Path.GetFileNameWithoutExtension(txbOutputTDF.Text) + Properties.Settings.Default.TomoDataFormatExtension))
            {
                if (MessageBox.Show("The specified TDF file already exists. Overwrite it?", "SYRMEP Tomo Project",
                                    MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == System.Windows.Forms.DialogResult.Yes)
                {
                    File.Delete(Properties.Settings.Default.FormSettings_WorkingPath + Path.DirectorySeparatorChar +
                                Path.GetFileNameWithoutExtension(txbOutputTDF.Text) + Properties.Settings.Default.TomoDataFormatExtension);
                }
                else
                {
                    return;
                }
            }

            //mTempOutputName = Properties.Settings.Default.FormSettings_WorkingPath + Path.DirectorySeparatorChar + "_" + Program.GetTimestamp(DateTime.Now) + ".tmp";
            mTempOutputName = Properties.Settings.Default.FormSettings_WorkingPath + Path.DirectorySeparatorChar + txbOutputTDF.Text;

            // Create an instance for the phase retrieval job:
            zJob = new HIS2TDFJob(
                this.txbProjectionHIS.Text,
                this.txbDarkHIS.Text,
                this.txbFlatHIS.Text,
                this.txbPostDarkHIS.Text,
                this.txbPostFlatHIS.Text,
                mTempOutputName,
                (this.chkConsiderSubset.Checked) ? Convert.ToInt32(this.nudConvertToTDFFrom.Value) : 0,
                (this.chkConsiderSubset.Checked) ? Convert.ToInt32(this.nudConvertToTDFTo.Value) : Convert.ToInt32(this.nudConvertToTDFTo.Maximum),
                Convert.ToInt32(this.nudConvertToTDF_CropLeft.Value),
                Convert.ToInt32(this.nudConvertToTDF_CropRight.Value),
                Convert.ToInt32(this.nudConvertToTDF_CropTop.Value),
                Convert.ToInt32(this.nudConvertToTDF_CropBottom.Value),
                true,
                Convert.ToInt32(this.nudOutputCompression.Value)
                );

            // Create an instance of JobExecuter with the Phase Retrieval job
            // splitting it into several processes (if specified):
            JobExecuter zExecuter = new JobExecuter(zJob);

            // Execute the job:
            zExecuter.Run();

            // Start the monitoring of the job:
            mJobMonitor.Run(zExecuter, Properties.Settings.Default.FormSettings_ProjectionPrefix);
        }
Esempio n. 3
0
        private void btnRun_Click(object sender, EventArgs e)
        {
            // Run Job Convert To TDF:
            IJob zJob;

            // Execute with conventional flat fielding:
            zJob = new PreProcessingJob(
                // Get combobox selection (in handler)
                this.mInputTDF,
                this.mInputTDF.Remove(this.mInputTDF.Length - 4) + "_corr.tdf",
                0,
                TDFReader.GetNumberOfSlices(mInputTDF) - 1,
                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,
                Convert.ToInt32(Properties.Settings.Default.FormSettings_NrOfProcesses),
                false,
                "-"
                );


            // Create an instance of JobExecuter with the pre processing job:
            JobExecuter zExecuter = new JobExecuter(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;
        }
Esempio n. 4
0
        private void btnConvert_Click(object sender, EventArgs e)
        {
            // Run Job Convert To TDF:
            IJob zJob;

            //mTempOutputName = Properties.Settings.Default.FormSettings_WorkingPath + Path.DirectorySeparatorChar + "_" + Program.GetTimestamp(DateTime.Now) + ".tmp";
            mTempOutputName = Properties.Settings.Default.FormSettings_WorkingPath + Path.DirectorySeparatorChar + txbOutputTDF.Text;

            // Create an instance for the phase retrieval job:
            zJob = new EDF2TDFJob(
                mInputPath,
                mTempOutputName,
                (this.chkConsiderSubset.Checked) ? Convert.ToInt32(this.nudConvertToTDFFrom.Value) : 0,
                (this.chkConsiderSubset.Checked) ? Convert.ToInt32(this.nudConvertToTDFTo.Value) : Convert.ToInt32(this.nudConvertToTDFTo.Maximum),
                Convert.ToInt32(this.nudConvertToTDF_CropLeft.Value),
                Convert.ToInt32(this.nudConvertToTDF_CropRight.Value),
                Convert.ToInt32(this.nudConvertToTDF_CropTop.Value),
                Convert.ToInt32(this.nudConvertToTDF_CropBottom.Value),
                tbxProjectionPrefix.Text,
                tbxFlatPrefix.Text,
                tbxDarkPrefix.Text,
                (this.rbtInputSinograms.Checked) ? false : true,
                Convert.ToInt32(this.nudOutputCompression.Value),
                Convert.ToInt32(Properties.Settings.Default.FormSettings_NrOfProcesses)
                );

            // Create an instance of JobExecuter with the Phase Retrieval job
            // splitting it into several processes (if specified):
            JobExecuter zExecuter = new JobExecuter(zJob);

            // Execute the job:
            zExecuter.Run();

            // Start the monitoring of the job:
            mJobMonitor.Run(zExecuter, this.tbxProjectionPrefix.Text);

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

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

            // Execute with conventional flat fielding:
            zJob = new PhaseRetrievalJob(
                this.mInputTDF.Remove(this.mInputTDF.Length - 4) + "_corr.tdf",
                this.mInputTDF.Remove(this.mInputTDF.Length - 4) + "_corr_phrt.tdf",
                this.mMethod,
                0,
                TDFReader.GetNumberOfProjections(this.mInputTDF.Remove(this.mInputTDF.Length - 4) + "_corr.tdf") - 1,
                this.mParam1,
                this.mParam2,
                this.mDistance,
                this.mEnergy,
                this.mPixelsize,
                this.mPad,
                Convert.ToInt32(Properties.Settings.Default.FormSettings_NrOfProcesses)
                );


            // Create an instance of JobExecuter with the pre processing job:
            JobExecuter zExecuter = new JobExecuter(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;
        }
Esempio n. 6
0
        private void btnConvert_Click(object sender, EventArgs e)
        {
            // Run GDEI Job:
            IJob zJob;

            string zInputFile_1 = ((KeyValuePair <string, string>) this.cbxGDEI_Input2.SelectedItem).Key;
            string zInputFile_2 = ((KeyValuePair <string, string>) this.cbxGDEI_Input1.SelectedItem).Key;
            string zInputFile_3 = ((KeyValuePair <string, string>) this.cbxGDEI_Input3.SelectedItem).Key;

            String[] zSubStrings   = Path.GetFileName(zInputFile_1).Split('_');
            string   zOutputPrefix = string.Empty;

            for (int i = 0; i < zSubStrings.Length - 1; i++)
            {
                zOutputPrefix += zSubStrings[i];
            }

            string zOutputFile_Abs  = Properties.Settings.Default.FormSettings_WorkingPath + Path.DirectorySeparatorChar + zOutputPrefix + "_abs" + Properties.Settings.Default.TomoDataFormatExtension;
            string zOutputFile_Refr = Properties.Settings.Default.FormSettings_WorkingPath + Path.DirectorySeparatorChar + zOutputPrefix + "_ref" + Properties.Settings.Default.TomoDataFormatExtension;
            string zOutputFile_Sca  = Properties.Settings.Default.FormSettings_WorkingPath + Path.DirectorySeparatorChar + zOutputPrefix + "_sca" + Properties.Settings.Default.TomoDataFormatExtension;

            // Create an instance for the phase retrieval job:
            zJob = new GDEIJob(
                zInputFile_1,
                zInputFile_2,
                zInputFile_3,
                zOutputFile_Abs,
                zOutputFile_Refr,
                zOutputFile_Sca,
                0,                                             //(this.chkConsiderSubset.Checked) ? Convert.ToInt32(this.nudConvertToTDFFrom.Value) : 0,
                TDFReader.GetNumberOfSlices(zInputFile_1) - 1, //-1, //(this.chkConsiderSubset.Checked) ? Convert.ToInt32(this.nudConvertToTDFTo.Value) : -1,
                this.mAirSx,
                this.mAirDx,
                this.mFlatEnd,
                this.mHalfHalf,
                this.mHalfHalfLine,
                this.mExtFOV,
                this.mExtFOVRight,
                this.mExtFOVOverlap,
                this.mExtFOVNormalize,
                this.mExtFOVAverage,
                this.mRingRemoval,
                this.mDynamicFlatFielding,
                Convert.ToInt32(this.nudGDEI_ShiftVert1.Value),
                Convert.ToInt32(this.nudGDEI_ShiftHoriz1.Value),
                Convert.ToInt32(this.nudGDEI_ShiftVert2.Value),
                Convert.ToInt32(this.nudGDEI_ShiftHoriz2.Value),
                Convert.ToInt32(this.nudGDEI_ShiftVert3.Value),
                Convert.ToInt32(this.nudGDEI_ShiftHoriz3.Value),

                Convert.ToDouble(this.nudGDEI_r1.Value) * Math.Pow(10, Convert.ToDouble(this.nudGDEI_r1Exp.Value)),
                Convert.ToDouble(this.nudGDEI_r2.Value) * Math.Pow(10, Convert.ToDouble(this.nudGDEI_r2Exp.Value)),
                Convert.ToDouble(this.nudGDEI_r3.Value) * Math.Pow(10, Convert.ToDouble(this.nudGDEI_r3Exp.Value)),

                Convert.ToDouble(this.nudGDEI_d1.Value) * Math.Pow(10, Convert.ToDouble(this.nudGDEI_d1Exp.Value)),
                Convert.ToDouble(this.nudGDEI_d2.Value) * Math.Pow(10, Convert.ToDouble(this.nudGDEI_d2Exp.Value)),
                Convert.ToDouble(this.nudGDEI_d3.Value) * Math.Pow(10, Convert.ToDouble(this.nudGDEI_d3Exp.Value)),

                Convert.ToDouble(this.nudGDEI_dd1.Value) * Math.Pow(10, Convert.ToDouble(this.nudGDEI_dd1Exp.Value)),
                Convert.ToDouble(this.nudGDEI_dd2.Value) * Math.Pow(10, Convert.ToDouble(this.nudGDEI_dd2Exp.Value)),
                Convert.ToDouble(this.nudGDEI_dd3.Value) * Math.Pow(10, Convert.ToDouble(this.nudGDEI_dd3Exp.Value)),

                Convert.ToInt32(Properties.Settings.Default.FormSettings_NrOfProcesses)
                );

            // Create an instance of JobExecuter with the Phase Retrieval job
            // splitting it into several processes (if specified):
            JobExecuter zExecuter = new JobExecuter(zJob);

            // Execute the job:
            zExecuter.Run();

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

            // Reset status bar:
            this.toolStripStatusLabel1.Text = string.Empty;
        }
Esempio n. 7
0
        private void btnConvert_Click(object sender, EventArgs e)
        {
            IJob zJob;

            // Create an instance for the multi offset job:
            zJob = new MultiAngleJob(
                this.mSlicePrefix,
                this.mImageIndex,
                this.mInputTDF,
                this.zOutputPathTxb.Text,
                this.mPreProcess,
                this.mAirSx,
                this.mAirDx,
                this.mFlatEnd,
                this.mHalfHalf,
                this.mHalfHalfLine,
                this.mExtFOV,
                this.mExtFOVRight,
                this.mExtFOVOverlap,
                this.mExtFOVNormalize,
                this.mExtFOVAverage,
                this.mRingRemoval,
                this.mAngles,
                this.mCenter,
                this.mReconFunc,
                this.mReconParam1,
                this.mScale,
                this.mOverPaddding,
                this.mLogTransform,
                this.mCircle,
                this.mZeroneMode,
                this.mCorrectionOffset,
                this.mDecimateFactor,
                this.mDownscaleFactor,
                this.mPostProcess,
                this.mPostProcessConvertArgs,
                this.mPostProcessCropArgs,
                this.mPhaseRetrieval,
                this.mPhrtMethod,
                this.mParam1,
                this.mParam2,
                this.mDistance,
                this.mEnergy,
                this.mPixelsize,
                this.mPhrtPad,
                Convert.ToInt32(this.nudMultiAngle_From.Value),
                Convert.ToInt32(this.nudMultiAngle_To.Value)
                );

            // Create an instance of JobExecuter with the Phase Retrieval job
            // splitting it into several processes (if specified):
            JobExecuter zExecuter = new JobExecuter(zJob);

            // Execute the job:
            zExecuter.Run();

            // Start the monitoring of the job:
            int zLines = (Convert.ToInt32(this.nudMultiAngle_To.Value - this.nudMultiAngle_From.Value)) + 1;

            mJobMonitor.Run(zExecuter, this.mSlicePrefix, zLines);
        }
Esempio n. 8
0
        private void runReconstruction(object sender, EventArgs e)
        {
            // Run Job Convert To TDF:
            IJob zJob;

            mPreProcessOnGoing     = false;
            mPhaseRetrievalOnGoing = false;

            string zOutputPath = Properties.Settings.Default.FormSettings_OutputPath + Path.DirectorySeparatorChar +
                                 Path.GetFileNameWithoutExtension(this.mInputTDF.Remove(this.mInputTDF.Length - 4) + "_corr_phrt.tdf") +
                                 Path.DirectorySeparatorChar + @"slices" + Path.DirectorySeparatorChar;

            if (mAngles_ProjTo == 0)
            {
                mAngles_ProjTo = TDFReader.GetNumberOfProjections(this.mInputTDF.Remove(this.mInputTDF.Length - 4) + "_corr_phrt.tdf") - 1;
            }

            // Create an instance for the reconstruction job:
            zJob = new ReconstructionJob(
                // Get combobox selection (in handler)
                this.mInputTDF.Remove(this.mInputTDF.Length - 4) + "_corr_phrt.tdf",
                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,
                TDFReader.GetNumberOfSlices(this.mInputTDF.Remove(this.mInputTDF.Length - 4) + "_corr_phrt.tdf") - 1,
                Convert.ToInt32(Properties.Settings.Default.FormSettings_NrOfProcesses),
                mDecimateFactor,
                mDownscaleFactor,

                mPostProcess,
                mPostProcessPolarFilt,
                mPostProcessConvertArgs,
                mPostProcessCropArgs,
                mDynamicFlatFielding,

                mRolling,
                mRollShift
                );


            // Create an instance of JobExecuter with the pre processing job:
            JobExecuter zExecuter = new JobExecuter(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;
        }