r653: *** empty log message ***
authorKevin M. Rosenberg <kevin@rosenberg.net>
Fri, 30 Mar 2001 22:09:09 +0000 (22:09 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Fri, 30 Mar 2001 22:09:09 +0000 (22:09 +0000)
cgi-bin/ctsim.cgi.in
include/interpolator.h
libctsim/imagefile.cpp

index a497dd908502f1dcc3988137fc196b99161bf5b7..ae32a901553285ae9a2155f50d36825dc428d58d 100755 (executable)
@@ -28,17 +28,14 @@ CGI::ReadParse(\%in);
 my $error = "";
 
 if ($::single_process_only > 0) {
-  my @processes = '/bin/ps -A';
+  my @processes = `/bin/ps -A`;
   my $running = 0;
-  foreach $p (@processes) {
-    if ($p ~= /ctsimtext/) {
-      $running = 1;
-      break;
-    }
-    if ($running > 0) {
-      $error .= "Another online simulation is currently running.<p>Click your browser's <i>Refresh</i> button to resubmit your simulation<br>";
-      exit(0);
+  foreach my $p (@processes) {
+    if ($p =~ m/ctsimtext/) {
+      $error .= "Another online simulation is currently running.<br>You may wait a moment and then click your browser's <b>Refresh</b> button to resubmit your simulation<br>";
+      last;
     }
+  }
 }
 
 my $Phantom_Name = FilterMetaChars($in{'Phantom_Name'});
@@ -111,10 +108,10 @@ my $ir_png_url = "$::url_datadir/ir-$tmpid.png";
 my $pj_png_url = "$::url_datadir/pj-$tmpid.png";
 my $sub_png_url = "$::url_datadir/sub-$tmpid.png";
 
-my $pjrec_ver = "$::bindir/pjrec";
-my $phm2pj_ver = "$::bindir/phm2pj";
-my $phm2if_ver = "$::bindir/phm2if";
-my $diff_ver = "$::bindir/if2";
+my $pjrec_ver = "$::bindir/ctsimtext pjrec";
+my $phm2pj_ver = "$::bindir/ctsimtext phm2pj";
+my $phm2if_ver = "$::bindir/ctsimtext phm2if";
+my $diff_ver = "$::bindir/ctsimtext if2";
 
 $pjrec_ver = "/opt/lam/bin/mpirun N N $::lamrundir/pjrec-lam" if $MPI;
 $phm2pj_ver = "/opt/lam/bin/mpirun N N $::lamrundir/phm2pj-lam" if $MPI;
@@ -185,6 +182,12 @@ if ($error ne "") {
       }
     }
   }
+  # Delete image files and projection files
+  unlink($phantom_fname);
+  unlink($ir_fname);
+  unlink($pj_fname);
+  unlink($pj_if_fname);
+  unlink($sub_fname);
 
   $cmdout = "$gp_cmd\n $gp_out $pj_cmd\n $pj_out $pj_if_cmd\n $pj_if_out $pjrec_cmd\n $pjrec_out $diff_cmd\n $diff_out $png1_cmd\n $png_gp_out $png2_cmd\n $png_pjrec_out $png3_cmd\n $png_pj_out $png4_cmd\n $png_sub_out";
   if (open(LOGFILE,">> $logfile")) {
@@ -222,8 +225,7 @@ if ($error ne "") {
 }
 
 $out .= "<HR>\n";
-$out .= "Return to <A HREF=\"/ctsim/index.html\">CT Simulation Designer</a>.<br>\n";
-$out .= "Return to <A HREF=\"www.med-info.com\">Med-Info</a>.\n";
+$out .= "Return to <A HREF=\"http://www.ctsim.org\">CTSim</a>.<br>\n";
 $out .= "</BODY> </HTML>";
 $out .= "\n";
 
index 1b1fc484b2fc24b63f382dff5cd522e10ecce587..c6a34d69792b1c43f7e04be8e67a83775225bd83 100644 (file)
@@ -2,7 +2,7 @@
 **  This is part of the CTSim program
 **  Copyright (c) 1983-2001 Kevin Rosenberg
 **
-**  $Id: interpolator.h,v 1.4 2001/03/24 05:28:28 kevin Exp $
+**  $Id: interpolator.h,v 1.5 2001/03/30 22:09:09 kevin Exp $
 **
 **  This program is free software; you can redistribute it and/or modify
 **  it under the terms of the GNU General Public License (version 2) as
@@ -63,8 +63,8 @@ public:
   
   T interpolate (double dXPos, double dYPos)
   {
-    int iFloorX = floor (dXPos);
-    int iFloorY = floor (dYPos);
+    int iFloorX = static_cast<int>(floor(dXPos));
+    int iFloorY = static_cast<int>(floor (dYPos));
     double dXFrac = dXPos - iFloorX;
     double dYFrac = dYPos - iFloorY;
 
index 9fa905725ec0883b269e3b072d95c1b946a94521..356e48904e3f3e5591d285c746beb6c75b82c4be 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (c) 1983-2001 Kevin Rosenberg
 **
-**  $Id: imagefile.cpp,v 1.43 2001/03/28 16:53:43 kevin Exp $
+**  $Id: imagefile.cpp,v 1.44 2001/03/30 22:09:09 kevin Exp $
 **
 **  This program is free software; you can redistribute it and/or modify
 **  it under the terms of the GNU General Public License (version 2) as
@@ -1815,7 +1815,7 @@ ImageFile::writeImagePNG (const char* const outfile, int bitdepth, int nxcell, i
   
   png_init_io(png_ptr, fp);
   
-  png_set_IHDR (png_ptr, info_ptr, nx * nxcell, ny * nycell, bitdepth, PNG_COLOR_TYPE_GRAY, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_DEFAULT);
+  png_set_IHDR (png_ptr, info_ptr, nx * nxcell, ny * nycell, bitdepth, PNG_COLOR_TYPE_GRAY, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
   
   png_write_info(png_ptr, info_ptr);
   for (int irow = ny - 1; irow >= 0; irow--) {