@@ -47,34 +47,34 @@ namespace Seg3D
4747bool 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
0 commit comments