+++ /dev/null
-# Makefile for libk
-
-!include <ntwin32.mak>
-
-CC=cl
-LD=link
-CFLAGS=-O -nologo -I..\include -I..\getopt -DHAVE_GETOPT_H
-LDFLAGS=..\getopt\getopt.lib ..\libkmath\libkmath.lib ..\libcio\libcio.lib ..\libgraph\libgraph.lib ..\libezplot\libezplot.lib ..\libir\libir.lib ..\libk\libk.lib
-O=.obj
-
-# variables
-OBJ1 = ctrec$(O) phm2rs$(O) phm2if$(O) rs2if$(O) if-1$(O) if-2$(O) if2img$(O) ifinfo$(O)
-
-all: ctrec.exe phm2rs.exe phm2if.exe rs2if.exe if-1.exe if-2.exe if2img.exe ifinfo.exe
-
-.obj: .c
- $(CC) -c $(cvarsdll) $(CFLAGS) $*.c
-
-.obj: .cpp
- $(CC) -c $(cvarsdll) $(CFLAGS) $*.cpp
-
-
-ctrec.exe: ctrec.obj
- link ctrec.obj $(LDFLAGS)
-
-phm2rs.exe: phm2rs.obj
- link phm2rs.obj $(LDFLAGS)
-
-phm2if.exe: phm2if.obj
- link phm2if.obj $(LDFLAGS)
-
-rs2if.exe: rs2if.obj
- link rs2if.obj $(LDFLAGS)
-
-if-1.exe: if-1.obj
- link if-1.obj $(LDFLAGS)
-
-if-2.exe: if-2.obj
- link if-2.obj $(LDFLAGS)
-
-ifinfo.exe: ifinfo.obj
- link ifinfo.obj $(LDFLAGS)
-
-if2img.exe: if2img.obj
- link if2img.obj $(LDFLAGS)
-
-clean:
- echo dummy > a.obj
- echo dummy > a.exe
- echo dummy > a.lib
- del *.obj
- del *.exe
- del *.lib
+++ /dev/null
-/*****************************************************************************
-** FILE IDENTIFICATION
-**
-** Name: mpiworld.cpp
-** Purpose: MPI Support class
-** Programmer: Kevin Rosenberg
-** Date Started: June 2000
-**
-** This is part of the CTSim program
-** Copyright (C) 1983-2000 Kevin Rosenberg
-**
-** $Id: mpiworld.cpp,v 1.2 2000/06/22 10:17:28 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
-** published by the Free Software Foundation.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-******************************************************************************/
-
-#include <mpi++.h>
-#include <mpiworld.h>
-
-
-MPIWorld::MPIWorld (int& argc, char**& argv)
-{
- MPI::Init (argc, argv);
- m_comm = MPI::COMM_WORLD.Dup();
- m_nProcessors = m_comm.Get_size();
- m_myRank = m_comm.Get_rank();
- m_vLocalWorkUnits.reserve (m_nProcessors);
- m_vStartWorkUnit.reserve (m_nProcessors);
- m_vEndWorkUnit.reserve (m_nProcessors);
-}
-
-
-void
-MPIWorld::setTotalWorkUnits(int totalWorkUnits)
-{
- if (m_nProcessors < 1)
- return;
-
- int baseLocalWorkUnits = totalWorkUnits / m_nProcessors;
- int remainderWorkUnits = totalWorkUnits % m_nProcessors;
-
- int currWorkUnits = 0;
- for (int iProc = 0; iProc < m_nProcessors; iProc++) {
- m_vLocalWorkUnits[iProc] = baseLocalWorkUnits;
- if (iProc < remainderWorkUnits)
- m_vLocalWorkUnits[iProc]++;
-
- m_vStartWorkUnit[iProc] = currWorkUnits;
- m_vEndWorkUnit[iProc] = m_vStartWorkUnit[iProc] + m_vLocalWorkUnits[iProc] - 1;
-
- currWorkUnits += m_vLocalWorkUnits[iProc];
- }
-
-}
-
-void
-MPIWorld::BcastString (string& str)
-{
- int len;
-
- if (m_myRank == 0)
- len = str.length();
- m_comm.Bcast (&len, 1, MPI::INT, 0);
- char buf [ len + 1];
-
- if (m_myRank == 0)
- strcpy (buf, str.c_str());
-
- m_comm.Bcast (buf, len + 1, MPI::CHAR, 0);
-
- if (m_myRank > 0)
- str = buf;
-}
--- /dev/null
+#!/bin/sh
+
+if test "$1" != "" ; then
+ bin=$1
+else
+ bin="@prefix@/bin/"
+fi
+
+if test "$1" = "clean" ; then
+ rm -f sample-phm.png sample-phm16.png sample-phm.if sample-pj.pj sample-pj.if sample-pj.png sample-pj16.png sample-rec.if sample-rec.png sample-rec16.png
+ exit
+fi
+
+# Generate phantom image
+
+${bin}phm2if sample-phm.if 256 256 --nsample 2 --phantom herman
+if [ -f sample-phm.if ] ; then
+ ${bin}if2img sample-phm.if sample-phm.png --format png
+ ${bin}if2img sample-phm.if sample-phm16.png --format png16
+fi
+
+# Simulate CT data collection and generate raysum sinugram for display
+${bin}phm2pj sample-pj.pj 367 320 --nray 2 --phantom herman
+if [ -f sample-pj.pj ]; then
+ ${bin}pj2if sample-pj.pj sample-pj.if
+fi
+if [ -f sample-pj.if ]; then
+ ${bin}if2img sample-pj.if sample-pj.png --format png
+ ${bin}if2img sample-pj.if sample-pj16.png --format png16
+fi
+
+# Reconstruct raysums and generate image for display
+${bin}pjrec sample-pj.pj sample-rec.if 256 256
+if [ -f sample-rec.if ]; then
+ ${bin}if2img sample-rec.if sample-rec.png --format png
+ ${bin}if2img sample-rec.if sample-rec16.png --format png16
+
+ ${bin}if-2 sample-phm.if sample-rec.if --comp
+fi
+
+# Files sample-phm.png, sample-pj.png, and sample-rec.png are ready for display