diff --git a/src/Application/Filters/Actions/ActionHistogramEqualizationFilter.cc b/src/Application/Filters/Actions/ActionHistogramEqualizationFilter.cc index 312e41335..9b181af15 100644 --- a/src/Application/Filters/Actions/ActionHistogramEqualizationFilter.cc +++ b/src/Application/Filters/Actions/ActionHistogramEqualizationFilter.cc @@ -47,34 +47,34 @@ namespace Seg3D bool ActionHistogramEqualizationFilter::validate( Core::ActionContextHandle& context ) { // Make sure that the sandbox exists - if ( !LayerManager::CheckSandboxExistence( this->sandbox_, context ) ) return false; + if ( ! LayerManager::CheckSandboxExistence( this->sandbox_, context ) ) return false; // Check for layer existence and type information if ( ! LayerManager::CheckLayerExistenceAndType( this->target_layer_, - Core::VolumeType::DATA_E, context, this->sandbox_ ) ) return false; + Core::VolumeType::DATA_E, context, this->sandbox_ ) ) return false; // Check for layer availability if ( ! LayerManager::CheckLayerAvailability( this->target_layer_, - this->replace_, context, this->sandbox_ ) ) return false; + this->replace_, context, this->sandbox_ ) ) return false; // Check amount - if( this->amount_ < 0.0 || this->amount_ > 1.0 ) + if ( ( this->amount_ < 0.0 ) || (this->amount_ > 1.0 ) ) { context->report_error( "Equalization amount needs to be between 0.0 and 1.0." ); return false; } // Check bins - if( this->bins_ < 2 ) + if ( this->bins_ < 2 ) { - context->report_error( "Bins needs to be bigger than 1." ); + context->report_error( "Number of bins needs to be bigger than 1." ); return false; } // Check how many bins to ignore - if( this->ignore_bins_ < 0 ) + if ( ( this->ignore_bins_ < 0 ) || ( this->ignore_bins_ >= this->bins_ ) ) { - context->report_error( "Number of bins to ignore needs to be bigger than or equal to 0." ); + context->report_error( "Number of bins to ignore must be greater than 0 and less than number of bins." ); return false; } diff --git a/src/Application/Tools/HistogramEqualizationFilter.cc b/src/Application/Tools/HistogramEqualizationFilter.cc index 86953879e..854ed5dc2 100644 --- a/src/Application/Tools/HistogramEqualizationFilter.cc +++ b/src/Application/Tools/HistogramEqualizationFilter.cc @@ -50,7 +50,7 @@ HistogramEqualizationFilter::HistogramEqualizationFilter( const std::string& too this->add_state( "replace", this->replace_state_, false ); this->add_state( "amount", this->amount_state_, 1.0, 0.0, 1.0, 0.01 ); this->add_state( "bins", this->bins_state_, 3000, 10, 10000, 1 ); - this->add_state( "ignore_bins", this->ignore_bins_state_, 1, 0, 10, 1 ); + this->add_state( "ignore_bins", this->ignore_bins_state_, 1, 0, 10000, 1 ); } HistogramEqualizationFilter::~HistogramEqualizationFilter()