Commit 325152ca authored by OTB Bot's avatar OTB Bot

STYLE

parent 06bdfd0f
......@@ -72,7 +72,7 @@ private:
"Always keep in mind that this application only addresses mathematically well-defined formulas.\n"
"For instance, it is not possible to add vectors of different dimensions (this implies the addition of a row vector with a column vector),\n"
"or add a scalar to a vector or a matrix, or divide two vectors, and so on...\n"
"Thus, it is important to remember that a pixel of n components is always represented as a row vector.\n"
"Thus, it is important to remember that a pixel of n components is always represented as a row vector.\n"
"\n"
"Example :\n\n"
" im1 + im2 \n"
......@@ -84,7 +84,7 @@ private:
" im1b2 + im2b2 \n"
" ...."
"\n\nNevertheless, the first expression is by far much pleaseant. We call this new functionnality the 'batch mode'\n"
"(performing the same operation in a band-to-band fashion).\n"
"(performing the same operation in a band-to-band fashion).\n"
"\n\n"
"- Operations involving neighborhoods of pixels:\n\n"
......
......@@ -296,13 +296,13 @@ void BandMathImageFilterX<TImage>
template< typename TImage >
void BandMathImageFilterX<TImage>
::exportContext(const std::string& filename)
::exportContext(const std::string& filename)
{
std::vector< std::string > vectI,vectF,vectM, vectFinal;
for(int i=0; i<m_VAllowedVarNameAddedByUser.size(); i++)
{
{
std::ostringstream iss;
std::string str;
......@@ -310,12 +310,12 @@ void BandMathImageFilterX<TImage>
{
case 'i':
iss << "#I " << m_VAllowedVarNameAddedByUser[i].name << " " << m_VAllowedVarNameAddedByUser[i].value.GetInteger();
str=iss.str();
str=iss.str();
vectI.push_back(str);
break;
case 'f':
iss << "#F " << m_VAllowedVarNameAddedByUser[i].name << " " << m_VAllowedVarNameAddedByUser[i].value.GetFloat();
str=iss.str();
iss << "#F " << m_VAllowedVarNameAddedByUser[i].name << " " << m_VAllowedVarNameAddedByUser[i].value.GetFloat();
str=iss.str();
vectF.push_back(str);
break;
case 'c':
......@@ -328,23 +328,23 @@ 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=iss.str();
str.erase(str.size()-1);
str.push_back('}');
vectM.push_back(str);
break;
}
}
}
// Sorrting : I F M and E at the end
for(int i=0;i<vectI.size();++i)
for(int i=0; i<vectI.size(); ++i)
vectFinal.push_back(vectI[i]);
for(int i=0;i<vectF.size();++i)
for(int i=0; i<vectF.size(); ++i)
vectFinal.push_back(vectF[i]);
for(int i=0;i<vectM.size();++i)
for(int i=0; i<vectM.size(); ++i)
vectFinal.push_back(vectM[i]);
for(int i=0; i < m_Expression.size(); ++i)
{
......@@ -355,20 +355,20 @@ void BandMathImageFilterX<TImage>
}
std::ofstream exportFile(filename.c_str(), std::ios::out | std::ios::trunc);
if(exportFile)
if(exportFile)
{
for(int i=0; i<vectFinal.size(); ++i)
exportFile << vectFinal[i] << std::endl;
exportFile.close();
}
else
else
itkExceptionMacro(<< "Could not open " << filename << "." << std::endl);
}
template< typename TImage >
void BandMathImageFilterX<TImage>
::importContext(const std::string& filename)
::importContext(const std::string& filename)
{
std::ifstream importFile(filename.c_str(), std::ios::in);
......@@ -376,7 +376,7 @@ void BandMathImageFilterX<TImage>
int pos,pos2,lineID=0;
double value;
if(importFile)
if(importFile)
{
while(std::getline(importFile,line))
......@@ -394,17 +394,17 @@ void BandMathImageFilterX<TImage>
sub = line.substr(pos);
pos = sub.find_first_of(' ');
name = sub.substr(0,pos);
name = sub.substr(0,pos);
if (sub.find_first_of('{',pos) != std::string::npos)
itkExceptionMacro(<< "In file '"<< filename << "', line " << lineID
itkExceptionMacro(<< "In file '"<< filename << "', line " << lineID
<< " : symbol #F found, but find vector/matrix definition. Please, set an integer or a float number." << std::endl);
if (sub.find_first_not_of(' ',pos) == std::string::npos )
itkExceptionMacro(<< "In file '"<< filename << "', line " << lineID << " : please, set the value of the constant." << std::endl)
std::istringstream iss( sub.substr(pos) );
iss >> value;
iss >> value;
SetConstant(name,value);
......@@ -446,7 +446,7 @@ void BandMathImageFilterX<TImage>
importFile.close();
}
else
else
itkExceptionMacro(<< "Could not open " << filename << "." << std::endl);
}
......@@ -571,7 +571,7 @@ void BandMathImageFilterX<TImage>
m_AImage[i][j].info[t]=m_VVarName[j].info[t];
//bool isAConstant = false;
//bool isAConstant = false;
if ( (m_AImage[i][j].type == 0 ) || (m_AImage[i][j].type == 1) ) // indices (idxX & idxY)
{
......@@ -622,7 +622,7 @@ void BandMathImageFilterX<TImage>
/* if (isAConstant)
m_VParser.at(i)->DefineConst(m_AImage[i][j].name, &(m_AImage[i][j].value));
else
m_VParser.at(i)->DefineVar(m_AImage[i][j].name, &(m_AImage[i][j].value));*/
m_VParser.at(i)->DefineVar(m_AImage[i][j].name, &(m_AImage[i][j].value)); */
initValue += 0.001;
if (initValue>1.0)
......
......@@ -65,7 +65,7 @@ public:
int GetMinute();
/** Seconds Accessor*/
double GetSeconds() const;
double GetSeconds() const;
/** Set the date and time from an Iso8601 string
* Return true if the date is valid
......
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