Skip to content
Snippets Groups Projects
ContrastMgrOptions.h 1.35 KiB
Newer Older
Stephen Smith's avatar
Stephen Smith committed
/*  ContrastMgrOptions.h

    Mark Woolrich, FMRIB Image Analysis Group

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

/*  CCOPYRIGHT  */

Mark Woolrich's avatar
Mark Woolrich committed
#if !defined(__ContrastMgrOptions_h)
#define __ContrastMgrOptions_h

#include <string>
#include <math.h>
#include <iostream.h>
#include <fstream.h>
#include <stdlib.h>
#include <stdio.h>
#include "utils/log.h"
Stephen Smith's avatar
Stephen Smith committed

Mark Woolrich's avatar
Mark Woolrich committed
using namespace Utilities;
Stephen Smith's avatar
Stephen Smith committed

Mark Woolrich's avatar
Mark Woolrich committed
namespace FILM {
Stephen Smith's avatar
Stephen Smith committed

class ContrastMgrOptions {
 public:
  static ContrastMgrOptions& getInstance();
  ~ContrastMgrOptions() { delete gopt; }
  
  string contrastfname;
Mark Woolrich's avatar
Mark Woolrich committed
  string fcontrastfname;
Stephen Smith's avatar
Stephen Smith committed
  string datadir;
  string neffsfname;
  string suffix;

Mark Woolrich's avatar
Mark Woolrich committed
  bool debug;
Stephen Smith's avatar
Stephen Smith committed
  bool verbose;
  short maxshort;
  short copenumber;

Mark Woolrich's avatar
Mark Woolrich committed
  void parse_command_line(int argc, char** argv, Log& logger);
Stephen Smith's avatar
Stephen Smith committed

 private:
  ContrastMgrOptions();
  
  const ContrastMgrOptions& operator=(ContrastMgrOptions&);
  ContrastMgrOptions(ContrastMgrOptions&);
      
  static ContrastMgrOptions* gopt;

  void print_usage(int argc, char *argv[]);
  
};

inline ContrastMgrOptions& ContrastMgrOptions::getInstance(){
  if(gopt == NULL)
    gopt = new ContrastMgrOptions();
  
  return *gopt;
}

inline ContrastMgrOptions::ContrastMgrOptions()
{
  // set up defaults
  datadir = "";
  contrastfname = "";
Mark Woolrich's avatar
Mark Woolrich committed
  fcontrastfname = "";
Stephen Smith's avatar
Stephen Smith committed
  suffix = "";

  copenumber = 1;
  maxshort = 32000;
  verbose = false;
Mark Woolrich's avatar
Mark Woolrich committed
  debug = false;
Stephen Smith's avatar
Stephen Smith committed
}