Commit bafa9375 authored by OTB Bot's avatar OTB Bot
Browse files

STYLE

parent 3c6fc044
......@@ -97,7 +97,7 @@ void BandMathImageFilterX<TImage>
os << indent << "Expressions: " << std::endl;
for (unsigned int i=0; i<m_Expression.size(); i++)
os << indent << m_Expression[i] << std::endl;
os << indent << m_Expression[i] << std::endl;
os << indent << "Computed values follow:" << std::endl;
os << indent << "UnderflowCount: " << m_UnderflowCount << std::endl;
os << indent << "OverflowCount: " << m_OverflowCount << std::endl;
......@@ -154,7 +154,7 @@ void BandMathImageFilterX<TImage>
//Mandatory before call of GetNumberOfComponentsPerPixel
//Really important not to call the filter's UpdateOutputInformation method here:
//this method is not ready until all inputs, variables and expressions are set.
imagebis->UpdateOutputInformation();
imagebis->UpdateOutputInformation();
//imibj
for (int j=0; j<imagebis->GetNumberOfComponentsPerPixel(); j++)
......@@ -247,7 +247,6 @@ void BandMathImageFilterX<TImage>
}
template< typename TImage >
void BandMathImageFilterX<TImage>
::SetMatrix(const std::string& name, const std::string& definition)
......@@ -360,7 +359,7 @@ void BandMathImageFilterX<TImage>
iss << " " << m_VAllowedVarNameAddedByUser[i].value.At(k,0);
for(int p=1; p<m_VAllowedVarNameAddedByUser[i].value.GetCols(); p++)
iss << " , " << m_VAllowedVarNameAddedByUser[i].value.At(k,p);
iss << " ;";
iss << ";";
}
str=iss.str();
str.erase(str.size()-1);
......@@ -551,7 +550,7 @@ void BandMathImageFilterX<TImage>
m_VFinalAllowedVarName.clear();
// m_VFinalAllowedVarName = m_VAllowedVarNameAuto + m_VAllowedVarNameAddedByUser
// m_VFinalAllowedVarName = variable names dictionary
// m_VFinalAllowedVarName = variable names dictionary
for(int i=0; i<m_VAllowedVarNameAddedByUser.size(); i++)
m_VFinalAllowedVarName.push_back(m_VAllowedVarNameAddedByUser[i]);
for(int i=0; i<m_VAllowedVarNameAuto.size(); i++)
......@@ -610,7 +609,7 @@ void BandMathImageFilterX<TImage>
// Important to remember that variables of m_VVarName come from a call of GetExprVar method
// Only useful variables are allocated in this filter
int nbVar = m_VVarName.size();
int nbVar = m_VVarName.size();
m_StatsVarDetected.clear();
......@@ -681,14 +680,14 @@ void BandMathImageFilterX<TImage>
if (m_AImage[i][j].type == 8 ) // global stats
{
m_AImage[i][j].value = ValueType(initValue);
//m_AImage[i][j].info[0] = Image ID : useful to know which images must have their regions set to largest possible region (see GenerateInputRequestedRegion)
m_AImage[i][j].value = ValueType(initValue);
//m_AImage[i][j].info[0] = Image ID : useful to know which images must have their regions set to largest possible region (see GenerateInputRequestedRegion)
bool found = false;
for (int r=0; r<m_StatsVarDetected.size() && !found; r++)
for (int r=0; r<m_StatsVarDetected.size() && !found; r++)
if (m_StatsVarDetected[r] == m_AImage[i][j].info[0])
found = true;
if (!found)
m_StatsVarDetected.push_back(m_AImage[i][j].info[0]);
if (!found)
m_StatsVarDetected.push_back(m_AImage[i][j].info[0]);
}
......@@ -792,14 +791,13 @@ void BandMathImageFilterX< TImage >
ImagePointer inputPtr = const_cast<TImage *>(this->GetInput(m_StatsVarDetected[i]));
inputPtr->SetRequestedRegionToLargestPossibleRegion();
}
else
itkExceptionMacro(<< "Requested input #" << m_StatsVarDetected[i] << ", but only " << this->GetNumberOfInputs() << " inputs are available." << std::endl);
else
itkExceptionMacro(<< "Requested input #" << m_StatsVarDetected[i] << ", but only " << this->GetNumberOfInputs() << " inputs are available." << std::endl);
}
}
template< typename TImage >
void BandMathImageFilterX<TImage>
::BeforeThreadedGenerateData()
......@@ -826,9 +824,9 @@ void BandMathImageFilterX<TImage>
}
}
if (globalStatsDetected())
if (globalStatsDetected())
// Must instantiate stats variables of the parsers
// Note : at this stage, inputs have already been set to largest possible regions.
// Note : at this stage, inputs have already been set to largest possible regions.
for (unsigned int i=0; i<m_StatsVarDetected.size(); i++)
{
......@@ -923,7 +921,7 @@ void BandMathImageFilterX<TImage>
m_OverflowCount += m_ThreadOverflow[i];
}
if((m_UnderflowCount != 0) || (m_OverflowCount!=0))
if((m_UnderflowCount != 0) || (m_OverflowCount!=0))
{
std::stringstream sstm;
sstm << std::endl
......@@ -973,7 +971,7 @@ void BandMathImageFilterX<TImage>
radius[0]=(int) ((m_VVarName[j].info[2]-1)/2); // Size x direction (otb convention)
radius[1]=(int) ((m_VVarName[j].info[3]-1)/2); // Size y direction (otb convention)
VNit.push_back( itk::ConstNeighborhoodIterator<TImage>(radius, this->GetNthInput(m_VVarName[j].info[0]),outputRegionForThread)); // info[0] = Input image ID
VNit.back().NeedToUseBoundaryConditionOn();
VNit.back().NeedToUseBoundaryConditionOn();
}
......
......@@ -38,7 +38,7 @@ void bands::Eval(mup::ptr_val_type &ret, const mup::ptr_val_type *a_pArg, int a_
mup::matrix_type b = a_pArg[1]->GetArray();
int nbrows = b.GetRows();
int nbrows = b.GetRows();
int nbcols = b.GetCols();
assert(a.GetRows()==1); // Bands selection is done on a row vector
......
......@@ -445,7 +445,7 @@ int otbBandMathImageFilterXTxt( int itkNotUsed(argc), char* argv [])
FilterType::Pointer filter = FilterType::New();
filter->ImportContext(inputFilename);
filter->ImportContext(inputFilename);
filter->ExportContext(outputFilename);
return EXIT_SUCCESS;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment