Commit ee124eea authored by Victor Poughon's avatar Victor Poughon

REFAC: remove unnecessary calls to c_str

This was done with this script:

    #!/bin/bash

    set -eou pipefail

    # Use C++11 sstream constructor from string
    # Exclude 'ThirdParty' because it uses ossimFilename type
    find Modules/ Examples/ -not -iwholename "*ThirdParty*" -type f -print0 | xargs -0 sed -i -E "s/std::ifstream (.*)\((.*)\.c_str\(\)/std::ifstream \1\(\2/"
    find Modules/ Examples/ -not -iwholename "*ThirdParty*" -type f -print0 | xargs -0 sed -i -E "s/std::ofstream (.*)\((.*)\.c_str\(\)/std::ofstream \1\(\2/"

    # Use C++11 ::open(const std::string&) of ifstream, ofstream, etc.
    # Exclude ThirdParty because of ossimFilename type
    find Modules/ Examples/ -not -iwholename "*ThirdParty*" -type f -print0 | xargs -0 sed -i -E "s/\.open\((.*).c_str\(\)/\.open\(\1/"

    # No need for c_str when outputing to std::cout and such
    find Modules/ Examples/ -type f -print0 | xargs -0 sed -i -E "s/\.c_str\(\) ?<</ <</"

    # Use itk::ExceptionObject::SetDescription and SetLocation string versions
    find Modules/ Examples/ -type f -print0 | xargs -0 sed -i -E "s/e\.SetDescription\((.*)\.c_str\(\)\)/e\.SetDescription\(\1\)/"
    find Modules/ Examples/ -type f -print0 | xargs -0 sed -i -E "s/e\.SetLocation\((.*)\.c_str\(\)\)/e\.SetLocation\(\1\)/"

    # Use itksys::SystemTool:: string versions
    find Modules/ Examples/ -type f -print0 | xargs -0 sed -i -E "s/itksys::SystemTools::(.*)\((.*)\.c_str\(\)/itksys::SystemTools::\1\(\2/"
    # Exclude otbLogger because it uses GetCurrentDateTime which does not have a string version
    git checkout --  Modules/Core/Common/src/otbLogger.cxx
    # Exclude test/otbOGRLayerStreamStitchingFilter.cxx because there's a double use which is not compatible with the regex
    git checkout -- Modules/Segmentation/OGRProcessing/test/otbOGRLayerStreamStitchingFilter.cxx
parent fc923078
......@@ -71,12 +71,12 @@
int CSVConfusionMatrixFileReader(const std::string fileName, MapOfClassesType &mapOfClassesRefClX, ConfusionMatrixType &confusionMatrixClX)
{
std::ifstream inFile;
inFile.open(fileName.c_str());
inFile.open(fileName);
if (!inFile)
{
std::cerr << "Confusion Matrix File opening problem with file:" << std::endl;
std::cerr << fileName.c_str() << std::endl;
std::cerr << fileName << std::endl;
return EXIT_FAILURE;
}
else
......
......@@ -115,7 +115,7 @@ int main(int itkNotUsed(argc), char * argv[])
vectorSubdatasetDescriptions.size(); itSubDataset++ )
{
std::cout << "Dataset Number " << itSubDataset << " name is: " << vectSubdatasetNames[itSubDataset].c_str()
<< " and description is: " << vectSubdatasetNames[itSubDataset].c_str() << std::endl;
<< " and description is: " << vectSubdatasetNames[itSubDataset] << std::endl;
}
}
}
......
......@@ -63,7 +63,7 @@ int CurlHelperStub::RetrieveFile(const std::ostringstream& urlStream, std::strin
if (urlStream.str().compare("http://api.geonames.org/findNearbyPlaceName?lat=1.29&lng=103.78&username=otbteam") == 0)
{
std::ofstream file;
file.open(filename.c_str());
file.open(filename);
file << "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n"
"<geonames>\n"
"<geoname>\n"
......
......@@ -165,14 +165,14 @@ BOOST_AUTO_TEST_CASE(OGRDataSource_shp_overwrite)
const std::string workingdir = k_name + "/shp";
// Create an empty temporary directory for the test
if ( itksys::SystemTools::FileExists(workingdir.c_str()) )
if ( itksys::SystemTools::FileExists(workingdir) )
{
itksys::SystemTools::RemoveADirectory(workingdir.c_str());
itksys::SystemTools::RemoveADirectory(workingdir);
}
itksys::SystemTools::MakeDirectory(workingdir.c_str());
itksys::SystemTools::MakeDirectory(workingdir);
std::string filename = workingdir + "/" + k_name + ".shp";
filename = itksys::SystemTools::ConvertToOutputPath(filename.c_str());
filename = itksys::SystemTools::ConvertToOutputPath(filename);
const std::string layer1 = k_name;
......@@ -450,14 +450,14 @@ BOOST_AUTO_TEST_CASE(OGRDataSource_sqlite_overwrite)
const std::string workingdir = k_name + "/sqlite";
// Create an empty temporary directory for the test
if ( itksys::SystemTools::FileExists(workingdir.c_str()) )
if ( itksys::SystemTools::FileExists(workingdir) )
{
itksys::SystemTools::RemoveADirectory(workingdir.c_str());
itksys::SystemTools::RemoveADirectory(workingdir);
}
itksys::SystemTools::MakeDirectory(workingdir.c_str());
itksys::SystemTools::MakeDirectory(workingdir);
std::string filename = workingdir + "/" + k_name + ".sqlite";
filename = itksys::SystemTools::ConvertToOutputPath(filename.c_str());
filename = itksys::SystemTools::ConvertToOutputPath(filename);
const std::string layer1 = boost::algorithm::to_lower_copy(k_name);
......
......@@ -105,7 +105,7 @@ int otbOssimElevManagerTest4(int argc, char* argv[])
std::stringstream headerName;
headerName << outfname << ".hdr";
std::ofstream headerFile;
headerFile.open(headerName.str().c_str());
headerFile.open(headerName.str());
headerFile << "ENVI" << std::endl;
headerFile << "samples = " << size[0] << std::endl;
headerFile << "lines = " << size[1] << std::endl;
......
......@@ -221,7 +221,7 @@ private:
void m_WriteContingencyTable(const ContingencyTablePointerType& contingencyTable)
{
std::ofstream outFile;
outFile.open( this->GetParameterString( "out" ).c_str() );
outFile.open( this->GetParameterString( "out" ) );
outFile << contingencyTable->ToCSV();
outFile.close();
}
......@@ -528,7 +528,7 @@ private:
std::ofstream outFile;
outFile.open(this->GetParameterString("out").c_str());
outFile.open(this->GetParameterString("out"));
outFile << std::fixed;
outFile.precision(10);
......
......@@ -182,12 +182,12 @@ private:
int CSVConfusionMatrixFileReader(const std::string fileName, MapOfClassesType &mapOfClassesRefClX, ConfusionMatrixType &confusionMatrixClX)
{
std::ifstream inFile;
inFile.open(fileName.c_str());
inFile.open(fileName);
if (!inFile)
{
std::cerr << "Confusion Matrix File opening problem with file:" << std::endl;
std::cerr << fileName.c_str() << std::endl;
std::cerr << fileName << std::endl;
return EXIT_FAILURE;
}
else
......
......@@ -356,7 +356,7 @@ protected:
bool RemoveFile(const std::string &filePath)
{
bool res = true;
if( itksys::SystemTools::FileExists( filePath.c_str() ) )
if( itksys::SystemTools::FileExists( filePath ) )
{
size_t posExt = filePath.rfind( '.' );
if( posExt != std::string::npos && filePath.compare( posExt, std::string::npos, ".shp" ) == 0 )
......@@ -368,7 +368,7 @@ protected:
RemoveFile( dbfPath );
RemoveFile( prjPath );
}
res = itksys::SystemTools::RemoveFile( filePath.c_str() );
res = itksys::SystemTools::RemoveFile( filePath );
if( !res )
{
//otbAppLogINFO( <<"Unable to remove file "<<filePath );
......
......@@ -213,7 +213,7 @@ void DoUpdateParameters() override
void ParseCSVPredictors(std::string path, ListSampleType* outputList)
{
std::ifstream ifs;
ifs.open(path.c_str());
ifs.open(path);
unsigned int nbCols = 0;
char sep = '\t';
std::istringstream iss;
......@@ -235,24 +235,24 @@ void ParseCSVPredictors(std::string path, ListSampleType* outputList)
// Avoid commented lines or too short ones
if (!line.empty() && line[0] != '#')
{
std::vector<itksys::String> words = itksys::SystemTools::SplitString(line.c_str(),sep);
std::vector<itksys::String> words = itksys::SystemTools::SplitString(line,sep);
if (nbCols == 0)
{
// detect separator and feature size
if (words.size() < 2)
{
sep = ' ';
words = itksys::SystemTools::SplitString(line.c_str(),sep);
words = itksys::SystemTools::SplitString(line,sep);
}
if (words.size() < 2)
{
sep = ';';
words = itksys::SystemTools::SplitString(line.c_str(),sep);
words = itksys::SystemTools::SplitString(line,sep);
}
if (words.size() < 2)
{
sep = ',';
words = itksys::SystemTools::SplitString(line.c_str(),sep);
words = itksys::SystemTools::SplitString(line,sep);
}
if (words.size() < 2)
{
......
......@@ -129,7 +129,7 @@ protected:
{
// Write contingency table
std::ofstream outFile;
outFile.open( this->GetParameterString( "io.confmatout" ).c_str() );
outFile.open( this->GetParameterString( "io.confmatout" ) );
outFile << table->ToCSV();
}
}
......@@ -219,7 +219,7 @@ protected:
}
std::ofstream outFile;
outFile.open( this->GetParameterString( "io.confmatout" ).c_str() );
outFile.open( this->GetParameterString( "io.confmatout" ) );
outFile << std::fixed;
outFile.precision( 10 );
......
......@@ -273,7 +273,7 @@ protected:
bool RemoveFile(std::string &filePath)
{
bool res = true;
if( itksys::SystemTools::FileExists( filePath.c_str() ) )
if( itksys::SystemTools::FileExists( filePath ) )
{
size_t posExt = filePath.rfind( '.' );
if( posExt != std::string::npos && filePath.compare( posExt, std::string::npos, ".shp" ) == 0 )
......@@ -285,7 +285,7 @@ protected:
RemoveFile( dbfPath );
RemoveFile( prjPath );
}
res = itksys::SystemTools::RemoveFile( filePath.c_str() );
res = itksys::SystemTools::RemoveFile( filePath );
if( !res )
{
//otbAppLogINFO( <<"Unable to remove file "<<filePath );
......
......@@ -348,7 +348,7 @@ private:
// Setting up output file
std::ofstream file;
file.open(GetParameterString("out").c_str());
file.open(GetParameterString("out"));
file<<std::fixed;
file.precision(12);
......
......@@ -408,7 +408,7 @@ private:
{
//Write transformation matrix
std::ofstream outFile;
outFile.open(this->GetParameterString("outmatrix").c_str());
outFile.open(this->GetParameterString("outmatrix"));
outFile << std::fixed;
outFile.precision(10);
......
......@@ -757,7 +757,7 @@ private:
{
std::ifstream ifs;
ifs.open(GetParameterString("method.custom.lut").c_str());
ifs.open(GetParameterString("method.custom.lut"));
if (!ifs)
{
......
......@@ -157,14 +157,14 @@ void DoExecute() override
DEMConverter->Convert(tempFilename, output);
// remove the temprorary tif file
if( !itksys::SystemTools::RemoveFile(tempFilename.c_str()) )
if( !itksys::SystemTools::RemoveFile(tempFilename) )
{
itkExceptionMacro("Problem while removing the file " << tempFilename);
}
// remove the geom file if any
if( itksys::SystemTools::FileExists(tempFilenameGeom.c_str())
&& !itksys::SystemTools::RemoveFile(tempFilenameGeom.c_str()))
if( itksys::SystemTools::FileExists(tempFilenameGeom)
&& !itksys::SystemTools::RemoveFile(tempFilenameGeom))
{
itkExceptionMacro("Problem while removing the Geom file " << tempFilenameGeom);
}
......
......@@ -149,11 +149,11 @@ private:
}
// try different filenames
std::string filepath(path+name+HGTExtension);
bool exists = itksys::SystemTools::FileExists(filepath.c_str());
bool exists = itksys::SystemTools::FileExists(filepath);
if (!exists)
{
filepath += ZIPExtension;
exists = itksys::SystemTools::FileExists(filepath.c_str());
exists = itksys::SystemTools::FileExists(filepath);
}
if (!exists)
......@@ -161,11 +161,11 @@ private:
std::string lowerName(name);
std::transform(name.begin(), name.end(), lowerName.begin(), ::tolower);
filepath = path + lowerName + HGTExtension;
exists = itksys::SystemTools::FileExists(filepath.c_str());
exists = itksys::SystemTools::FileExists(filepath);
if (!exists)
{
filepath += ZIPExtension;
exists = itksys::SystemTools::FileExists(filepath.c_str());
exists = itksys::SystemTools::FileExists(filepath);
}
}
return exists;
......@@ -179,9 +179,9 @@ private:
path += Sep;
}
path += "foo";
if( itksys::SystemTools::Touch( path.c_str(), true ) )
if( itksys::SystemTools::Touch( path, true ) )
{
itksys::SystemTools::RemoveFile( path.c_str() );
itksys::SystemTools::RemoveFile( path );
}
else
{
......
......@@ -267,7 +267,7 @@ private:
{
std::string contextPath = GetParameterString("incontext");
// check that file exists
if (itksys::SystemTools::FileExists(contextPath.c_str(),true))
if (itksys::SystemTools::FileExists(contextPath,true))
{
BandMathImageFilterType::Pointer dummyFilter =
BandMathImageFilterType::New();
......
......@@ -610,7 +610,7 @@ private:
// Try to retrieve information from file provided by user
std::string filename(GetParameterString("acqui.gainbias"));
std::ifstream file(filename.c_str(), std::ios::in);
std::ifstream file(filename, std::ios::in);
if(file)
{
std::string line;
......@@ -682,7 +682,7 @@ private:
// Try to retrieve information from file provided by user
std::string filename(GetParameterString("acqui.solarilluminations"));
std::ifstream file(filename.c_str(), std::ios::in);
std::ifstream file(filename, std::ios::in);
if(file)
{
std::string line;
......
......@@ -122,7 +122,7 @@ private:
// Parse the input file for ground control points
std::ifstream ifs;
ifs.open(GetParameterString("inpoints").c_str());
ifs.open(GetParameterString("inpoints"));
TiePointsType tiepoints;
......@@ -185,7 +185,7 @@ private:
ofs.precision(12);
if(IsParameterEnabled("outstat"))
{
ofs.open(GetParameterString("outstat").c_str());
ofs.open(GetParameterString("outstat"));
ofs<<"#ref_lon ref_lat elevation predicted_lon predicted_lat elevation x_error(meters) y_error(meters) global_error(meters)"<<std::endl;
}
......
......@@ -126,7 +126,7 @@ private:
// Parse the input file for ground control points
std::ifstream ifs;
ifs.open(GetParameterString("inpoints").c_str());
ifs.open(GetParameterString("inpoints"));
TiePointsType tiepoints;
......@@ -206,7 +206,7 @@ private:
ofs.precision(12);
if(IsParameterEnabled("outstat"))
{
ofs.open(GetParameterString("outstat").c_str());
ofs.open(GetParameterString("outstat"));
ofs<<"#ref_lon ref_lat elevation predicted_lon predicted_lat predicted_elev x_error_ref(meters) y_error_ref(meters) global_error_ref(meters) x_error(meters) y_error(meters) global_error(meters)"<<std::endl;
}
......
......@@ -102,7 +102,7 @@ private:
std::string CreateFileName(unsigned int row, unsigned int column, std::string label)
{
std::string outfname = GetParameterString("out");
std::string tilesname = itksys::SystemTools::GetFilenameWithoutExtension(outfname.c_str());
std::string tilesname = itksys::SystemTools::GetFilenameWithoutExtension(outfname);
std::stringstream tileOut;
tileOut<<tilesname<<"_"<<row<<"_"<<column<<"_"<<label<<".tif";
......@@ -143,19 +143,19 @@ private:
if(GetParameterInt("cleanup"))
{
// Try to remove the geom file if existing
std::string geomfile = tile.substr(0,tile.size() - itksys::SystemTools::GetFilenameExtension(tile.c_str()).size()).append(".geom");
std::string geomfile = tile.substr(0,tile.size() - itksys::SystemTools::GetFilenameExtension(tile).size()).append(".geom");
if(itksys::SystemTools::FileExists(geomfile.c_str()))
if(itksys::SystemTools::FileExists(geomfile))
{
bool res = itksys::SystemTools::RemoveFile(geomfile.c_str());
bool res = itksys::SystemTools::RemoveFile(geomfile);
if (!res)
{
otbAppLogINFO(<<"Unable to remove file "<<geomfile);
}
}
if(itksys::SystemTools::FileExists(tile.c_str()))
if(itksys::SystemTools::FileExists(tile))
{
bool res = itksys::SystemTools::RemoveFile(tile.c_str());
bool res = itksys::SystemTools::RemoveFile(tile);
if (!res)
{
otbAppLogINFO(<<"Unable to remove file "<<tile);
......@@ -171,7 +171,7 @@ private:
std::string outfname = GetParameterString("out");
std::stringstream vrtfOut;
vrtfOut<<itksys::SystemTools::GetFilenameWithoutExtension(outfname.c_str())<<".vrt";
vrtfOut<<itksys::SystemTools::GetFilenameWithoutExtension(outfname)<<".vrt";
std::vector<std::string> joins;
if(IsParameterEnabled("tmpdir"))
......@@ -189,7 +189,7 @@ private:
std::string vrtfname = itksys::SystemTools::JoinPath(joins);
otbAppLogINFO(<<"Creating temporary vrt file: "<<vrtfname);
std::ofstream ofs(vrtfname.c_str());
std::ofstream ofs(vrtfname);
ofs<<"<VRTDataset rasterXSize=\""<<imageSizeX<<"\" rasterYSize=\""<<imageSizeY<<"\">"<<std::endl;
ofs<<"\t<VRTRasterBand dataType=\"UInt32\" band=\"1\">"<<std::endl;
......@@ -342,12 +342,12 @@ private:
// Ensure that temporary directory exists if activated:
if(IsParameterEnabled("tmpdir"))
{
if(!itksys::SystemTools::FileExists(GetParameterString("tmpdir").c_str()))
if(!itksys::SystemTools::FileExists(GetParameterString("tmpdir")))
{
m_TmpDirCleanup = true;
}
otbAppLogINFO(<<"Temporary directory "<<GetParameterString("tmpdir")<<" will be used");
itksys::SystemTools::MakeDirectory(GetParameterString("tmpdir").c_str());
itksys::SystemTools::MakeDirectory(GetParameterString("tmpdir"));
}
//Three steps :
......@@ -740,7 +740,7 @@ private:
if(IsParameterEnabled("tmpdir") && m_TmpDirCleanup)
{
otbAppLogINFO(<<"Removing tmp directory "<<GetParameterString("tmpdir")<<", since it has been created by the application");
itksys::SystemTools::RemoveADirectory(GetParameterString("tmpdir").c_str());
itksys::SystemTools::RemoveADirectory(GetParameterString("tmpdir"));
}
}
......
......@@ -184,8 +184,8 @@ private:
std::vector<std::string> options;
ogrDS = otb::ogr::DataSource::New(shapefile, otb::ogr::DataSource::Modes::Overwrite);
std::string layername = itksys::SystemTools::GetFilenameName(shapefile.c_str());
std::string extension = itksys::SystemTools::GetFilenameLastExtension(shapefile.c_str());
std::string layername = itksys::SystemTools::GetFilenameName(shapefile);
std::string extension = itksys::SystemTools::GetFilenameLastExtension(shapefile);
layername = layername.substr(0,layername.size()-(extension.size()));
layer = ogrDS->CreateLayer(layername, &oSRS, wkbMultiPolygon, options);
......
......@@ -216,9 +216,9 @@ private:
otbAppLogINFO( <<"Final clean-up ..." );
for (unsigned int i=0 ; i<tmpFilenames.size() ; ++i)
{
if(itksys::SystemTools::FileExists(tmpFilenames[i].c_str()))
if(itksys::SystemTools::FileExists(tmpFilenames[i]))
{
itksys::SystemTools::RemoveFile(tmpFilenames[i].c_str());
itksys::SystemTools::RemoveFile(tmpFilenames[i]);
}
}
}
......
......@@ -255,7 +255,7 @@ private:
interpolator->SetInputImage(colorPtr);
// Start writing ply file
std::ofstream ofs(outfname.c_str());
std::ofstream ofs(outfname);
std::ostringstream oss;
oss<<std::fixed;
oss.precision(12);
......
......@@ -74,7 +74,7 @@ std::string CommandLineArgumentParseResult
std::ostringstream msg;
msg << "GetParameterString(): The following '" << option << "' option is unknown !!";
CommandLineArgumentParserArgumentErrorException e(__FILE__, __LINE__);
e.SetDescription(msg.str().c_str());
e.SetDescription(msg.str());
throw e;
}
OptionMapType::const_iterator it = m_OptionMap.begin();
......
......@@ -77,7 +77,7 @@ UnaryFunctorWithIndexWithOutputSizeImageFilter<TInputImage, TOutputImage, TFunct
std::ostringstream msg;
msg << this->GetNameOfClass()
<< "::GenerateInputRequestedRegion()";
e.SetLocation(msg.str().c_str());
e.SetLocation(msg.str());
e.SetDescription("Requested region is (at least partially) outside the largest possible region.");
e.SetDataObject(inputPtr);
throw e;
......
......@@ -52,7 +52,7 @@ int otbImageRegionAdaptativeSplitter(int itkNotUsed(argc), char * argv[])
requestedNbSplits = atoi(argv[7]);
std::string outfname = argv[8];
std::ofstream outfile(outfname.c_str());
std::ofstream outfile(outfname);
region.SetSize(regionSize);
region.SetIndex(regionIndex);
......
......@@ -393,7 +393,7 @@ ImageMetadataInterfaceBase::GetBandName() const
if (imageKeywordlist.HasKey("support_data.band_name_list"))
{
std::string valueString = imageKeywordlist.GetMetadataByKey("support_data.band_name_list");
itksys::SystemTools::Split(valueString.c_str(), outputValues, ' ');
itksys::SystemTools::Split(valueString, outputValues, ' ');
}
else
return outputValues;
......@@ -401,7 +401,7 @@ ImageMetadataInterfaceBase::GetBandName() const
else
{
std::string valueString = imageKeywordlist.GetMetadataByKey("support_data.band_name");
itksys::SystemTools::Split(valueString.c_str(), outputValues, '/');
itksys::SystemTools::Split(valueString, outputValues, '/');
}
return outputValues;
......
......@@ -114,7 +114,7 @@ LineDetectorImageFilterBase<TInputImage, TOutputImage, TOutputImageDirection, In
std::ostringstream msg;
msg << static_cast<const char *>(this->GetNameOfClass())
<< "::GenerateInputRequestedRegion()";
e.SetLocation(msg.str().c_str());
e.SetLocation(msg.str());
e.SetDescription("Requested region is (at least partially) outside the largest possible region.");
e.SetDataObject(inputPtr);
throw e;
......
......@@ -137,7 +137,7 @@ void PixelSuppressionByDirectionImageFilter<TInputImage, TOutputImage>::Generate
std::ostringstream msg;
msg << static_cast<const char *>(this->GetNameOfClass())
<< "::GenerateInputRequestedRegion()";
e.SetLocation(msg.str().c_str());
e.SetLocation(msg.str());
e.SetDescription("Requested region is (at least partially) outside the largest possible region.");
e.SetDataObject(inputPtr);
throw e;
......
......@@ -88,7 +88,7 @@ void TouziEdgeDetectorImageFilter<TInputImage, TOutputImage,
std::ostringstream msg;
msg << static_cast<const char *>(this->GetNameOfClass())
<< "::GenerateInputRequestedRegion()";
e.SetLocation(msg.str().c_str());
e.SetLocation(msg.str());
e.SetDescription("Requested region is (at least partially) outside the largest possible region.");
e.SetDataObject(inputPtr);
throw e;
......
......@@ -150,7 +150,7 @@ int main(int argc, char * argv[])
std::ofstream file;
if (parseResult->IsOptionPresent("--outputText"))
{
file.open(parseResult->GetParameterString("--outputText").c_str());
file.open(parseResult->GetParameterString("--outputText"));
}
double minSize = -1;
......
......@@ -85,7 +85,7 @@ RadiometricMomentsImageFilter<TInputImage, TOutputImage>
std::ostringstream msg;
msg << this->GetNameOfClass()
<< "::GenerateInputRequestedRegion()";
e.SetLocation(msg.str().c_str());
e.SetLocation(msg.str());
e.SetDescription("Requested region is (at least partially) outside the largest possible region.");
e.SetDataObject(inputPtr);
throw e;
......
......@@ -320,7 +320,7 @@ SFSTexturesImageFilter<TInputImage, TOutputImage>
std::ostringstream msg;
msg << this->GetNameOfClass()
<< "::GenerateInputRequestedRegion()";
e.SetLocation(msg.str().c_str());
e.SetLocation(msg.str());
e.SetDescription("Requested region is (at least partially) outside the largest possible region.");
e.SetDataObject(inputPtr);
throw e;
......
......@@ -142,7 +142,7 @@ BinaryFunctorNeighborhoodJoinHistogramImageFilter<TInputImage1, TInputImage2, TO
std::ostringstream msg;
msg << this->GetNameOfClass()
<< "::GenerateInputRequestedRegion()";
e.SetLocation(msg.str().c_str());
e.SetLocation(msg.str());
e.SetDescription("Requested region is (at least partially) outside the largest possible region of image 1.");
e.SetDataObject(inputPtr1);
throw e;
......@@ -164,7 +164,7 @@ BinaryFunctorNeighborhoodJoinHistogramImageFilter<TInputImage1, TInputImage2, TO
std::ostringstream msg;
msg << this->GetNameOfClass()
<< "::GenerateInputRequestedRegion()";
e.SetLocation(msg.str().c_str());
e.SetLocation(msg.str());
e.SetDescription("Requested region is (at least partially) outside the largest possible region of image 1.");
e.SetDataObject(inputPtr2);
throw e;
......
......@@ -140,7 +140,7 @@ BinaryFunctorNeighborhoodImageFilter<TInputImage1, TInputImage2, TOutputImage, T
std::ostringstream msg;
msg << this->GetNameOfClass()
<< "::GenerateInputRequestedRegion()";