Skip to content

Commit b973fd6

Browse files
author
Ayla Khan
authored
Merge pull request #218 from SCIInstitute/hist_eq_fix
Increase bins to ignore to same number as bins. Value will need to be…
2 parents 2257c65 + 7cf7482 commit b973fd6

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/Application/Filters/Actions/ActionHistogramEqualizationFilter.cc

+8-8
Original file line numberDiff line numberDiff line change
@@ -47,34 +47,34 @@ namespace Seg3D
4747
bool ActionHistogramEqualizationFilter::validate( Core::ActionContextHandle& context )
4848
{
4949
// Make sure that the sandbox exists
50-
if ( !LayerManager::CheckSandboxExistence( this->sandbox_, context ) ) return false;
50+
if ( ! LayerManager::CheckSandboxExistence( this->sandbox_, context ) ) return false;
5151

5252
// Check for layer existence and type information
5353
if ( ! LayerManager::CheckLayerExistenceAndType( this->target_layer_,
54-
Core::VolumeType::DATA_E, context, this->sandbox_ ) ) return false;
54+
Core::VolumeType::DATA_E, context, this->sandbox_ ) ) return false;
5555

5656
// Check for layer availability
5757
if ( ! LayerManager::CheckLayerAvailability( this->target_layer_,
58-
this->replace_, context, this->sandbox_ ) ) return false;
58+
this->replace_, context, this->sandbox_ ) ) return false;
5959

6060
// Check amount
61-
if( this->amount_ < 0.0 || this->amount_ > 1.0 )
61+
if ( ( this->amount_ < 0.0 ) || (this->amount_ > 1.0 ) )
6262
{
6363
context->report_error( "Equalization amount needs to be between 0.0 and 1.0." );
6464
return false;
6565
}
6666

6767
// Check bins
68-
if( this->bins_ < 2 )
68+
if ( this->bins_ < 2 )
6969
{
70-
context->report_error( "Bins needs to be bigger than 1." );
70+
context->report_error( "Number of bins needs to be bigger than 1." );
7171
return false;
7272
}
7373

7474
// Check how many bins to ignore
75-
if( this->ignore_bins_ < 0 )
75+
if ( ( this->ignore_bins_ < 0 ) || ( this->ignore_bins_ >= this->bins_ ) )
7676
{
77-
context->report_error( "Number of bins to ignore needs to be bigger than or equal to 0." );
77+
context->report_error( "Number of bins to ignore must be greater than 0 and less than number of bins." );
7878
return false;
7979
}
8080

src/Application/Tools/HistogramEqualizationFilter.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ HistogramEqualizationFilter::HistogramEqualizationFilter( const std::string& too
5050
this->add_state( "replace", this->replace_state_, false );
5151
this->add_state( "amount", this->amount_state_, 1.0, 0.0, 1.0, 0.01 );
5252
this->add_state( "bins", this->bins_state_, 3000, 10, 10000, 1 );
53-
this->add_state( "ignore_bins", this->ignore_bins_state_, 1, 0, 10, 1 );
53+
this->add_state( "ignore_bins", this->ignore_bins_state_, 1, 0, 10000, 1 );
5454
}
5555

5656
HistogramEqualizationFilter::~HistogramEqualizationFilter()

0 commit comments

Comments
 (0)