Beispiel #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));
                    }
                }
            }
        }
Beispiel #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);
        }
Beispiel #3
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;
        }
Beispiel #4
0
        private void btnConvert_Click(object sender, EventArgs e)
        {
            IJob zJob;

            // Create an instance for the multi offset job:
            zJob = new MultiOffsetJob(
                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,
                Convert.ToInt32(this.nudMultiOffset_From.Value),
                Convert.ToInt32(this.nudMultiOffset_To.Value),
                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,
                this.mAnglesProjFrom,
                this.mAnglesProjTo
                );

            // 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.nudMultiOffset_To.Value - this.nudMultiOffset_From.Value)) / mDownscaleFactor + 1;

            mJobMonitor.Run(zExecuter, this.mSlicePrefix, zLines);
        }