@@ -47,34 +47,34 @@ namespace Seg3D
47
47
bool ActionHistogramEqualizationFilter::validate ( Core::ActionContextHandle& context )
48
48
{
49
49
// Make sure that the sandbox exists
50
- if ( !LayerManager::CheckSandboxExistence ( this ->sandbox_ , context ) ) return false ;
50
+ if ( ! LayerManager::CheckSandboxExistence ( this ->sandbox_ , context ) ) return false ;
51
51
52
52
// Check for layer existence and type information
53
53
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 ;
55
55
56
56
// Check for layer availability
57
57
if ( ! LayerManager::CheckLayerAvailability ( this ->target_layer_ ,
58
- this ->replace_ , context, this ->sandbox_ ) ) return false ;
58
+ this ->replace_ , context, this ->sandbox_ ) ) return false ;
59
59
60
60
// Check amount
61
- if ( this ->amount_ < 0.0 || this ->amount_ > 1.0 )
61
+ if ( ( this ->amount_ < 0.0 ) || ( this ->amount_ > 1.0 ) )
62
62
{
63
63
context->report_error ( " Equalization amount needs to be between 0.0 and 1.0." );
64
64
return false ;
65
65
}
66
66
67
67
// Check bins
68
- if ( this ->bins_ < 2 )
68
+ if ( this ->bins_ < 2 )
69
69
{
70
- context->report_error ( " Bins needs to be bigger than 1." );
70
+ context->report_error ( " Number of bins needs to be bigger than 1." );
71
71
return false ;
72
72
}
73
73
74
74
// Check how many bins to ignore
75
- if ( this ->ignore_bins_ < 0 )
75
+ if ( ( this ->ignore_bins_ < 0 ) || ( this -> ignore_bins_ >= this -> bins_ ) )
76
76
{
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 ." );
78
78
return false ;
79
79
}
80
80
0 commit comments