/*=========================================================================

  Program:   Insight Segmentation & Registration Toolkit
  Module:    $RCSfile: ThresholdSettings.h,v $
  Language:  C++
  Date:      $Date: 2003/11/10 00:27:26 $
  Version:   $Revision: 1.4 $
  Copyright (c) 2003 Insight Consortium. All rights reserved.
  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even 
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
     PURPOSE.  See the above copyright notices for more information.
=========================================================================*/
#ifndef __ThresholdSettings_h_
#define __ThresholdSettings_h_

#include "SNAPCommon.h"

// Forward references
class GreyImageWrapper;

/**
 * This class encapsulates the thresholding settings used by the program.
 * for In/Out snake initialization
 */
class ThresholdSettings
{
public:
  irisGetMacro(LowerThreshold,unsigned int);
  irisSetMacro(LowerThreshold,unsigned int);

  irisGetMacro(UpperThreshold,unsigned int);
  irisSetMacro(UpperThreshold,unsigned int);

  irisGetMacro(Smoothness,float);
  irisSetMacro(Smoothness,float);

  irisIsMacro(LowerThresholdEnabled);
  irisSetMacro(LowerThresholdEnabled,bool);

  irisIsMacro(UpperThresholdEnabled);
  irisSetMacro(UpperThresholdEnabled,bool);

  /** Compare two sets of settings */
  bool operator == (const ThresholdSettings &other) const;

  /**
   * Create a default instance of the settings based on an image wrapper
   */
  static ThresholdSettings MakeDefaultSettings(GreyImageWrapper *wrapper);

  /** This will create a slightly less useful settings object with thresholds
   * at 40 and 100.  Before using them, make sure that the image is in range
   * of 40 and 100 */
  static ThresholdSettings MakeDefaultSettingsWithoutImage();

  // Constructor: creates dummy settings
  ThresholdSettings();

private:
  unsigned int m_LowerThreshold;
  unsigned int m_UpperThreshold;
  float m_Smoothness;
  
  bool m_UpperThresholdEnabled;
  bool m_LowerThresholdEnabled;
};

#endif // __ThresholdSettings_h_

