Skip to content
Snippets Groups Projects
Commit 9ed3a60c authored by Otmane Lahlou's avatar Otmane Lahlou
Browse files

ENH : avoid division by zero

parent 907cb3a1
Branches
Tags
No related merge requests found
......@@ -45,7 +45,10 @@ ShiftScaleSampleListFilter<TInputSampleList,TOutputSampleList>
InputMeasurementVectorType invertedScales = m_Scales;
for(unsigned int idx = 0;idx < invertedScales.Size();++idx)
{
invertedScales[idx] = 1 / m_Scales[idx];
if(m_Scales[idx]-1e-10 < 0.)
invertedScales[idx] = 0.;
else
invertedScales[idx] = 1 / m_Scales[idx];
}
// Clear any previous output
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment