/*  contrast_mgr.cc

    Mark Woolrich, FMRIB Image Analysis Group

    Copyright (C) 1999-2000 University of Oxford  */

/*  CCOPYRIGHT  */

#include <iostream>
#include <fstream>
#include <sstream>
#define WANT_STREAM
#define WANT_MATH

#include "newmatap.h"
#include "newmatio.h"
#include "miscmaths/volumeseries.h"
#include "miscmaths/volume.h"
#include "ContrastMgr.h"
#include "miscmaths/miscmaths.h"
#include "utils/log.h"
#include "ContrastMgrOptions.h"
#include "utils/tracer_plus.h"
#include <string>

using namespace NEWMAT;
using namespace MISCMATHS;
using namespace FILM;
using namespace Utilities;

int main(int argc, char *argv[])
{
  try{
    
    // Setup logging:
    Log& logger = LogSingleton::getInstance();


    // parse command line
    ContrastMgrOptions& globalopts = ContrastMgrOptions::getInstance();
    globalopts.parse_command_line(argc, argv, logger);

    if(globalopts.debug)
      Tracer_Plus::setrunningstackon();

    ContrastMgr conMgr;
   
    conMgr.run();
    
  }
  catch(Exception& p_excp) 
    {
      cerr << p_excp.what() << endl;
    }
  catch(...)
    {
      cerr << "Uncaught exception!" << endl;
    }

  return 0;
}