X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=cgi-bin%2Fctsim.cgi;fp=cgi-bin%2Fctsim.cgi;h=0000000000000000000000000000000000000000;hb=1d7b7b7dbb6c55678a969e1a60b5d340795a13cb;hp=1c2d4a1dea4a8c4124aa00b0e54c0f81d029d821;hpb=0c41eadc2ba97b93d6cfbaa16d8bf0a1e75597e3;p=ctsim.git
diff --git a/cgi-bin/ctsim.cgi b/cgi-bin/ctsim.cgi
deleted file mode 100644
index 1c2d4a1..0000000
--- a/cgi-bin/ctsim.cgi
+++ /dev/null
@@ -1,287 +0,0 @@
-#!/usr/bin/perl
-# Generated automatically from ctsim.cgi.in by configure.
-
-use strict;
-use CGI;
-use File::Basename;
-use Fcntl ':flock';
-
-require './ctsim.conf';
-
-my $opt_d = 0;
-$ENV{'PATH'} = $::bindir;
-
-my $fromhost = $ENV{'REMOTE_HOST'};
-
-my $gmt_start = time();
-my $gmt_end;
-my $execution_time;
-
-my %in;
-CGI::ReadParse(\%in);
-
-# Incoming variables
-# Phantom_Name, Phantom_Nx, Phantom_Ny, Phantom_NSample
-# RS_NDet, RS_NRot, RS_NRay, RS_RotAngle,
-# IR_Nx, IR_Ny, IR_Filter, IR_Filter_Param
-
-my $error = "";
-
-my $Phantom_Name = FilterMetaChars($in{'Phantom_Name'});
-my $Phantom_Nx = FilterToNumber($in{'Phantom_Nx'});
-my $Phantom_Ny = FilterToNumber($in{'Phantom_Ny'});
-my $Phantom_NSample = FilterToNumber($in{'Phantom_NSample'});
-$error .= "Phantom name must not be blank
" if ($Phantom_Name eq "");
-$error .= "Phantom NX and NY must be between 5 and 1024
" if ($Phantom_Nx < 5 || $Phantom_Nx > 1024 || $Phantom_Ny < 5 || $Phantom_Ny > 1024);
-$error .= "Phantom NSample must be between 1 and 10
" if ($Phantom_NSample < 1 || $Phantom_NSample > 10);
-
-my $RS_NDet = FilterToNumber($in{'RS_NDet'});
-my $RS_NRot = FilterToNumber($in{'RS_NRot'});
-my $RS_NRay = FilterToNumber($in{'RS_NRay'});
-my $RS_RotAngle = FilterToNumber($in{'RS_RotAngle'});
-$error .= "Raysum NDet must be between 5 and 1800
" if ($RS_NDet < 5 || $RS_NDet > 1800);
-$error .= "Raysum NRot must be between 5 and 2048
" if ($RS_NRot < 5 || $RS_NRot > 2048);
-$error .= "Raysum RotAngle must be between 0.1 and 2
" if ($RS_RotAngle < 0.1 || $RS_RotAngle > 2);
-
-#my $IR_Nx = FilterToNumber($in{'IR_Nx'});
-#my $IR_Ny = FilterToNumber($in{'IR_Ny'});
-my $IR_Nx = $Phantom_Nx;
-my $IR_Ny = $Phantom_Ny;
-my $IR_Filter = FilterMetaChars($in{'IR_Filter'});
-my $IR_Filter_Param = FilterToNumber($in{'IR_Filter_Param'});
-my $IR_Interp = FilterMetaChars($in{'IR_Interp'});
-my $IR_Backproj = FilterMetaChars($in{'IR_Backproj'});
-
-my $Disp_Min = "auto";
-my $Disp_Max = "auto";
-$Disp_Min = FilterToNumber($in{'Disp_Min'}) if ($in{'Disp_Min'} ne "auto" && $in{'Disp_Min'} ne "");
-$Disp_Max = FilterToNumber($in{'Disp_Max'}) if ($in{'Disp_Max'} ne "auto" && $in{'Disp_Max'} ne "");
-if ($Disp_Min ne 'auto' && ! ($Disp_Min =~ /^[\d\.]+$/)) {
- $error .= "Display Minimum must be 'auto' or numeric (received '$Disp_Min')
";
-}
-if ($Disp_Max ne 'auto' && ! ($Disp_Max =~ /^[\d\.]+$/)) {
- $error .= "Display Maximum must be 'auto' or numeric (received '$Disp_Max')
";
-}
-
-my $MPI_Str = FilterMetaChars($in{'MPI'});
-my $MPI = 0;
-$MPI = 1 if ($MPI_Str eq "yes" && $::mpi_enable ne "");
-
-$error .= "IR Nx and Ny must be between 5 and 1024
" if ($IR_Nx < 5 || $IR_Nx > 1024 || $IR_Ny < 5 || $IR_Ny > 1024);
-$error .= "IR Filter Parameter must be between 0 and 1
" if ($IR_Filter_Param < 0 || $IR_Filter_Param > 1);
-
-
-my $tmpid = $$;
-my $auto_window_img = "std0.1";
-my $auto_window_diff = "std1";
-my $auto_window_rs = "full";
-my $logfile = "$::jobdir/ctsim.log";
-
-my $result_fname = "$::datadir/result-$tmpid.html";
-my $phantom_fname = "$::datadir/phantom-$tmpid.sdf";
-my $rs_fname = "$::datadir/rs-$tmpid.rs";
-my $ir_fname = "$::datadir/ir-$tmpid.sdf";
-my $rs_sdf_fname = "$::datadir/rs-$tmpid.sdf";
-my $diff_fname = "$::datadir/diff-$tmpid.sdf";
-my $phantom_png = "$::datadir/phantom-$tmpid.png";
-my $ir_png = "$::datadir/ir-$tmpid.png";
-my $rs_png = "$::datadir/rs-$tmpid.png";
-my $diff_png = "$::datadir/diff-$tmpid.png";
-
-my $result_url = "$::url_datadir/result-$tmpid.html";
-my $phantom_png_url = "$::url_datadir/phantom-$tmpid.png";
-my $ir_png_url = "$::url_datadir/ir-$tmpid.png";
-my $rs_png_url = "$::url_datadir/rs-$tmpid.png";
-my $diff_png_url = "$::url_datadir/diff-$tmpid.png";
-
-my $ctrec_ver = "$::bindir/ctrec";
-my $phm2rs_ver = "$::bindir/phm2rs";
-my $phm2sdf_ver = "$::bindir/phm2sdf";
-my $diff_ver = "$::bindir/sdf-2";
-$ctrec_ver = "/opt/lam/bin/mpirun N N $::bindir/ctrec-lam" if $MPI;
-$phm2rs_ver = "/opt/lam/bin/mpirun N N $::bindir/phm2rs-lam" if $MPI;
-$phm2sdf_ver = "/opt/lam/bin/mpirun N N $::bindir/phm2sdf-lam" if $MPI;
-
-my $gp_cmd = "$phm2sdf_ver $phantom_fname $Phantom_Nx $Phantom_Ny --phantom $Phantom_Name --nsample $Phantom_NSample";
-my $rs_cmd = "$phm2rs_ver $rs_fname $RS_NDet $RS_NRot --phantom $Phantom_Name --nray $RS_NRay --rotangle $RS_RotAngle";
-my $rs_sdf_cmd = "$::bindir/rs2sdf $rs_fname $rs_sdf_fname";
-my $ir_cmd = "$ctrec_ver $rs_fname $ir_fname $IR_Nx $IR_Ny --filter $IR_Filter --filter-param $IR_Filter_Param --interp $IR_Interp --backproj $IR_Backproj";
-my $diff_cmd = "$diff_ver $phantom_fname $ir_fname $diff_fname --comp";
-
-my $window_options = "--auto $auto_window_img";
-if ($Disp_Min ne 'auto') {
- $window_options .= " --min $Disp_Min";
-}
-if ($Disp_Max ne 'auto') {
- $window_options .= " --max $Disp_Max";
-}
-
-my $png1_cmd = "$::bindir/sdf2img $phantom_fname $phantom_png $window_options --stats --format png";
-my $png2_cmd = "$::bindir/sdf2img $ir_fname $ir_png $window_options --stats --format png";
-my $png3_cmd = "$::bindir/sdf2img $rs_sdf_fname $rs_png --auto $auto_window_rs --stats --format png";
-my $png4_cmd = "$::bindir/sdf2img $diff_fname $diff_png --auto $auto_window_diff --stats --format png";
-
-my $title = "CT Simulation Results";
-
-my $out = head();
-$out .= "
Phantom Image | Reconstructed Image |
$png_gp_out | \n";
- $out .= "$png_ir_out |
Raysum Sinusoid | Phantom/Reconst Error |
$png_rs_out | \n";
- $out .= "$diff_out $png_diff_out |