** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: phm2if.cpp,v 1.8 2000/06/13 16:20:31 kevin Exp $
+** $Id: phm2if.cpp,v 1.9 2000/06/15 19:07:10 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
phm2if_main (int argc, char* argv[])
{
ImageFile* imGlobal = NULL;
- PHANTOM *phm = NULL;
+ Phantom phm;
int opt_nx = 0, opt_ny = 0;
int opt_nsample = 1;
int opt_phmnum = -1;
break;
case O_PHMFILE:
strncpy(opt_phmfilename, optarg, sizeof(opt_phmfilename));
- phm = phm_create_from_file(opt_phmfilename);
+ phm.createFromFile(opt_phmfilename);
#ifdef HAVE_MPI
if (mpiWorld.getRank() == 0)
cerr << "Can't use phantom from file in MPI mode" << endl;
}
}
- if (phm == NULL && opt_phmnum == -1 && opt_filter == -1) {
+ if (phm.nPElem() == 0 && opt_phmnum == -1 && opt_filter == -1) {
cerr << "No phantom defined" << endl;
phm2if_usage(argv[0]);
return (1);
#endif
if (opt_phmnum >= 0)
- phm = phm_create (opt_phmnum);
+ phm.create (opt_phmnum);
#ifdef HAVE_MPI
else {
if (mpiWorld.getRank() == 0)
v = imGlobal->getArray ();
- if (phm->type == P_UNIT_PULSE) {
+ if (phm.getComposition() == P_UNIT_PULSE) {
if (mpiWorld.getRank() == 0) {
v[opt_nx/2][opt_ny/2] = 1.;
}
}
#else
v = imGlobal->getArray ();
- if (phm->type == P_UNIT_PULSE) {
+ if (phm.getComposition() == P_UNIT_PULSE) {
v[opt_nx/2][opt_ny/2] = 1.;
} else if (opt_filter != -1) {
image_filter_response (*imGlobal, opt_filter_domain, opt_filter_bw, opt_filter, opt_filter_param, opt_trace);
} else {
#if HAVE_SGP
if (opt_trace >= TRACE_PHM)
- phm_show(phm);
+ phm.show();
#endif
phm_to_imagefile (phm, *imGlobal, 0, opt_nx, opt_nsample, opt_trace);
}
}
}
- phm_free (phm);
-
return (0);
}