Commit c4b2eaf4 authored by Antoine Regimbeau's avatar Antoine Regimbeau

REFAC: remove m_ for non member variable

parent b5263f8f
......@@ -172,11 +172,11 @@ private:
void DoExecute() override
{
// Init filters
ExtractROIMonoFilterType::Pointer m_ExtractRefFilter =
ExtractROIMonoFilterType::Pointer extractRefFilter =
ExtractROIMonoFilterType::New();
ExtractROIMonoFilterType::Pointer m_ExtractMeasFilter =
ExtractROIMonoFilterType::Pointer extractMeasFilter =
ExtractROIMonoFilterType::New();
StreamingCompareImageFilterType::Pointer m_CompareFilter =
StreamingCompareImageFilterType::Pointer compareFilter =
StreamingCompareImageFilterType::New();
// Get input image pointers
......@@ -203,35 +203,35 @@ private:
otbAppLogFATAL( << "ROI is not contained in the images regions");
}
m_ExtractRefFilter->SetInput( refIm );
m_ExtractMeasFilter->SetInput( measIm );
extractRefFilter->SetInput( refIm );
extractMeasFilter->SetInput( measIm );
m_ExtractRefFilter->SetExtractionRegion(region);
m_ExtractMeasFilter->SetExtractionRegion(region);
extractRefFilter->SetExtractionRegion(region);
extractMeasFilter->SetExtractionRegion(region);
// Set channels to extract
otbAppLogINFO( << "reference image channel "<<this->GetParameterInt("ref.channel")<<" is compared with measured image channel "<<this->GetParameterInt("meas.channel"));
m_ExtractRefFilter->SetChannel( this->GetParameterInt("ref.channel") );
m_ExtractMeasFilter->SetChannel( this->GetParameterInt("meas.channel") );
extractRefFilter->SetChannel( this->GetParameterInt("ref.channel") );
extractMeasFilter->SetChannel( this->GetParameterInt("meas.channel") );
// Compute comparison
m_CompareFilter->SetInput1(m_ExtractRefFilter->GetOutput());
m_CompareFilter->SetInput2(m_ExtractMeasFilter->GetOutput());
m_CompareFilter->SetPhysicalSpaceCheck(false);
m_CompareFilter->GetStreamer()->SetAutomaticAdaptativeStreaming(GetParameterInt("ram"));
AddProcess(m_CompareFilter->GetStreamer(), "Comparing...");
m_CompareFilter->Update();
compareFilter->SetInput1(extractRefFilter->GetOutput());
compareFilter->SetInput2(extractMeasFilter->GetOutput());
compareFilter->SetPhysicalSpaceCheck(false);
compareFilter->GetStreamer()->SetAutomaticAdaptativeStreaming(GetParameterInt("ram"));
AddProcess(compareFilter->GetStreamer(), "Comparing...");
compareFilter->Update();
// Show result
otbAppLogINFO( << "MSE: " << m_CompareFilter->GetMSE() );
otbAppLogINFO( << "MAE: " << m_CompareFilter->GetMAE() );
otbAppLogINFO( << "PSNR: " << m_CompareFilter->GetPSNR() );
otbAppLogINFO( << "Number of Pixel different: " << m_CompareFilter->GetDiffCount() );
SetParameterFloat( "mse",m_CompareFilter->GetMSE());
SetParameterFloat( "mae",m_CompareFilter->GetMAE());
SetParameterFloat( "psnr",m_CompareFilter->GetPSNR());
SetParameterFloat( "count",m_CompareFilter->GetDiffCount());
otbAppLogINFO( << "MSE: " << compareFilter->GetMSE() );
otbAppLogINFO( << "MAE: " << compareFilter->GetMAE() );
otbAppLogINFO( << "PSNR: " << compareFilter->GetPSNR() );
otbAppLogINFO( << "Number of Pixel different: " << compareFilter->GetDiffCount() );
SetParameterFloat( "mse",compareFilter->GetMSE());
SetParameterFloat( "mae",compareFilter->GetMAE());
SetParameterFloat( "psnr",compareFilter->GetPSNR());
SetParameterFloat( "count",compareFilter->GetDiffCount());
RegisterPipeline();
}
};
......
......@@ -828,19 +828,19 @@ private:
this->CropRegionOfInterest();
ExtractROIFilterType::Pointer m_ExtractROIFilter = ExtractROIFilterType::New();
m_ExtractROIFilter->SetInput(inImage);
m_ExtractROIFilter->SetStartX(GetParameterInt("startx"));
m_ExtractROIFilter->SetStartY(GetParameterInt("starty"));
m_ExtractROIFilter->SetSizeX(GetParameterInt("sizex"));
m_ExtractROIFilter->SetSizeY(GetParameterInt("sizey"));
ExtractROIFilterType::Pointer extractROIFilter = ExtractROIFilterType::New();
extractROIFilter->SetInput(inImage);
extractROIFilter->SetStartX(GetParameterInt("startx"));
extractROIFilter->SetStartY(GetParameterInt("starty"));
extractROIFilter->SetSizeX(GetParameterInt("sizex"));
extractROIFilter->SetSizeY(GetParameterInt("sizey"));
for (unsigned int idx = 0; idx < GetSelectedItems("cl").size(); ++idx)
{
m_ExtractROIFilter->SetChannel(GetSelectedItems("cl")[idx] + 1 );
extractROIFilter->SetChannel(GetSelectedItems("cl")[idx] + 1 );
}
SetParameterOutputImage("out", m_ExtractROIFilter->GetOutput());
SetParameterOutputImage("out", extractROIFilter->GetOutput());
RegisterPipeline();
}
};
......
......@@ -207,29 +207,29 @@ bool CropRegionOfInterest()
{
InputImageType::Pointer inImage = GetParameterImage("in");
ExtractROIFilterType::Pointer m_ExtractROIFilter =
ExtractROIFilterType::Pointer extractROIFilter =
ExtractROIFilterType::New();
ShrinkImageFilterType::Pointer m_ResamplingFilter =
ShrinkImageFilterType::Pointer resamplingFilter =
ShrinkImageFilterType::New();
// The image on which the quicklook will be generated
// Will eventually be the m_ExtractROIFilter output
// Will eventually be the extractROIFilter output
if (HasUserValue("rox") || HasUserValue("roy")
|| HasUserValue("rsx") || HasUserValue("rsy")
|| (GetSelectedItems("cl").size() > 0))
{
m_ExtractROIFilter->SetInput(inImage);
m_ExtractROIFilter->SetStartX(GetParameterInt("rox"));
m_ExtractROIFilter->SetStartY(GetParameterInt("roy"));
m_ExtractROIFilter->SetSizeX(GetParameterInt("rsx"));
m_ExtractROIFilter->SetSizeY(GetParameterInt("rsy"));
extractROIFilter->SetInput(inImage);
extractROIFilter->SetStartX(GetParameterInt("rox"));
extractROIFilter->SetStartY(GetParameterInt("roy"));
extractROIFilter->SetSizeX(GetParameterInt("rsx"));
extractROIFilter->SetSizeY(GetParameterInt("rsy"));
if ((GetSelectedItems("cl").size() > 0))
{
for (unsigned int idx = 0; idx < GetSelectedItems("cl").size(); ++idx)
{
m_ExtractROIFilter->SetChannel(GetSelectedItems("cl")[idx] + 1 );
extractROIFilter->SetChannel(GetSelectedItems("cl")[idx] + 1 );
}
}
else
......@@ -237,14 +237,14 @@ bool CropRegionOfInterest()
unsigned int nbComponents = inImage->GetNumberOfComponentsPerPixel();
for (unsigned int idx = 0; idx < nbComponents; ++idx)
{
m_ExtractROIFilter->SetChannel(idx + 1);
extractROIFilter->SetChannel(idx + 1);
}
}
m_ResamplingFilter->SetInput( m_ExtractROIFilter->GetOutput() );
resamplingFilter->SetInput( extractROIFilter->GetOutput() );
}
else
{
m_ResamplingFilter->SetInput(inImage);
resamplingFilter->SetInput(inImage);
}
unsigned int Ratio = static_cast<unsigned int>(GetParameterInt("sr"));
......@@ -280,10 +280,10 @@ bool CropRegionOfInterest()
}
otbAppLogINFO( << "Ratio used: "<<Ratio << ".");
m_ResamplingFilter->SetShrinkFactor( Ratio );
m_ResamplingFilter->Update();
resamplingFilter->SetShrinkFactor( Ratio );
resamplingFilter->Update();
SetParameterOutputImage("out", m_ResamplingFilter->GetOutput());
SetParameterOutputImage("out", resamplingFilter->GetOutput());
RegisterPipeline();
}
......
......@@ -101,24 +101,24 @@ private:
otbAppLogDEBUG( << "Starting Min/Max computation" )
MinMaxFilterType::Pointer m_MinMaxFilter = MinMaxFilterType::New();
m_MinMaxFilter->SetInput( inImage );
m_MinMaxFilter->GetStreamer()->SetAutomaticAdaptativeStreaming(GetParameterInt("ram"));
MinMaxFilterType::Pointer minMaxFilter = MinMaxFilterType::New();
minMaxFilter->SetInput( inImage );
minMaxFilter->GetStreamer()->SetAutomaticAdaptativeStreaming(GetParameterInt("ram"));
AddProcess(m_MinMaxFilter->GetStreamer(), "Min/Max computing");
m_MinMaxFilter->Update();
AddProcess(minMaxFilter->GetStreamer(), "Min/Max computing");
minMaxFilter->Update();
otbAppLogDEBUG( << "Min/Max computation done : min=" << m_MinMaxFilter->GetMinimum()
<< " max=" << m_MinMaxFilter->GetMaximum() )
otbAppLogDEBUG( << "Min/Max computation done : min=" << minMaxFilter->GetMinimum()
<< " max=" << minMaxFilter->GetMaximum() )
FloatVectorImageType::PixelType inMin, inMax;
RescaleImageFilterType::Pointer m_RescaleFilter =
RescaleImageFilterType::Pointer rescaleFilter =
RescaleImageFilterType::New();
m_RescaleFilter->SetInput( inImage );
m_RescaleFilter->SetAutomaticInputMinMaxComputation(false);
m_RescaleFilter->SetInputMinimum( m_MinMaxFilter->GetMinimum() );
m_RescaleFilter->SetInputMaximum( m_MinMaxFilter->GetMaximum() );
rescaleFilter->SetInput( inImage );
rescaleFilter->SetAutomaticInputMinMaxComputation(false);
rescaleFilter->SetInputMinimum( minMaxFilter->GetMinimum() );
rescaleFilter->SetInputMaximum( minMaxFilter->GetMaximum() );
FloatVectorImageType::PixelType outMin, outMax;
outMin.SetSize( inImage->GetNumberOfComponentsPerPixel() );
......@@ -126,11 +126,11 @@ private:
outMin.Fill( GetParameterFloat("outmin") );
outMax.Fill( GetParameterFloat("outmax") );
m_RescaleFilter->SetOutputMinimum( outMin );
m_RescaleFilter->SetOutputMaximum( outMax );
m_RescaleFilter->UpdateOutputInformation();
rescaleFilter->SetOutputMinimum( outMin );
rescaleFilter->SetOutputMaximum( outMax );
rescaleFilter->UpdateOutputInformation();
SetParameterOutputImage("out", m_RescaleFilter->GetOutput());
SetParameterOutputImage("out", rescaleFilter->GetOutput());
RegisterPipeline();
}
};
......
......@@ -103,13 +103,13 @@ private:
ext = itksys::SystemTools::GetFilenameExtension(ofname);
// Set the extract filter input image
FilterType::Pointer m_Filter = FilterType::New();
m_Filter->SetInput(inImage);
FilterType::Pointer filter = FilterType::New();
filter->SetInput(inImage);
for (unsigned int i = 0; i < inImage->GetNumberOfComponentsPerPixel(); ++i)
{
// Set the channel to extract
m_Filter->SetChannel(i+1);
filter->SetChannel(i+1);
// build the current output filename
std::ostringstream oss;
......@@ -129,7 +129,7 @@ private:
// Set the filename of the current output image
paramOut->SetFileName(oss.str());
otbAppLogINFO(<< "File: "<<paramOut->GetFileName() << " will be written.");
paramOut->SetValue(m_Filter->GetOutput());
paramOut->SetValue(filter->GetOutput());
paramOut->SetPixelType(this->GetParameterOutputImagePixelType("out"));
// Add the current level to be written
paramOut->InitializeWriters();
......
......@@ -95,19 +95,19 @@ private:
itkExceptionMacro("No input Image set...");
}
TileFilterType::Pointer m_FusionFilter = TileFilterType::New();
TileFilterType::Pointer fusionFilter = TileFilterType::New();
TileFilterType::SizeType layout;
layout[0] = this->GetParameterInt("cols");
layout[1] = this->GetParameterInt("rows");
m_FusionFilter->SetLayout(layout);
fusionFilter->SetLayout(layout);
for (unsigned int i=0; i<(layout[0]*layout[1]); i++)
{
m_FusionFilter->SetInput(i,tileList->GetNthElement(i));
fusionFilter->SetInput(i,tileList->GetNthElement(i));
}
SetParameterOutputImage("out", m_FusionFilter->GetOutput());
SetParameterOutputImage("out", fusionFilter->GetOutput());
RegisterPipeline();
}
......
......@@ -709,23 +709,23 @@ private:
otbAppLogINFO(<<"Elapsed time: "<<(double)(toc - tic) / CLOCKS_PER_SEC<<" seconds");
// Final writing
LabelImageReaderType::Pointer m_FinalReader = LabelImageReaderType::New();
m_FinalReader->SetFileName(vrtfile);
LabelImageReaderType::Pointer finalReader = LabelImageReaderType::New();
finalReader->SetFileName(vrtfile);
ImportGeoInformationImageFilterType::Pointer
m_ImportGeoInformationFilter =
importGeoInformationFilter =
ImportGeoInformationImageFilterType::New();
m_ImportGeoInformationFilter->SetInput(m_FinalReader->GetOutput());
m_ImportGeoInformationFilter->SetSource(imageIn);
importGeoInformationFilter->SetInput(finalReader->GetOutput());
importGeoInformationFilter->SetSource(imageIn);
SetParameterOutputImage("out",m_ImportGeoInformationFilter->GetOutput());
SetParameterOutputImage("out",importGeoInformationFilter->GetOutput());
RegisterPipeline();
}
void AfterExecuteAndWriteOutputs() override
{
// Release input files
// m_FinalReader = ITK_NULLPTR;
// finalReader = ITK_NULLPTR;
if(GetParameterInt("cleanup"))
{
......
......@@ -181,21 +181,21 @@ private:
{
FloatVectorImageType* input = GetParameterImage("in");
MSFilterType::Pointer m_Filter = MSFilterType::New();
MSFilterType::Pointer filter = MSFilterType::New();
m_Filter->SetInput(input);
filter->SetInput(input);
m_Filter->SetSpatialBandwidth(GetParameterInt("spatialr"));
m_Filter->SetRangeBandwidth(GetParameterFloat("ranger"));
m_Filter->SetThreshold(GetParameterFloat("thres"));
m_Filter->SetMaxIterationNumber(GetParameterInt("maxiter"));
m_Filter->SetRangeBandwidthRamp(GetParameterFloat("rangeramp"));
m_Filter->SetModeSearch(GetParameterInt("modesearch"));
filter->SetSpatialBandwidth(GetParameterInt("spatialr"));
filter->SetRangeBandwidth(GetParameterFloat("ranger"));
filter->SetThreshold(GetParameterFloat("thres"));
filter->SetMaxIterationNumber(GetParameterInt("maxiter"));
filter->SetRangeBandwidthRamp(GetParameterFloat("rangeramp"));
filter->SetModeSearch(GetParameterInt("modesearch"));
//Compute the margin used to ensure exact results (tile wise smoothing)
//This margin is valid for the default uniform kernel used by the
//MeanShiftSmoothing filter (bandwidth equal to radius in this case)
const unsigned int margin = (m_Filter->GetMaxIterationNumber() * m_Filter->GetSpatialBandwidth()) + 1;
const unsigned int margin = (filter->GetMaxIterationNumber() * filter->GetSpatialBandwidth()) + 1;
otbAppLogINFO(<<"Margin of " << margin << " pixels applied to each tile to stabilized mean shift filtering." << std::endl);
......@@ -204,10 +204,10 @@ private:
otbAppLogWARNING(<<"Margin value exceed the input image size." << std::endl);
}
SetParameterOutputImage("fout", m_Filter->GetOutput());
SetParameterOutputImage("fout", filter->GetOutput());
if (IsParameterEnabled("foutpos") && HasValue("foutpos"))
{
SetParameterOutputImage("foutpos", m_Filter->GetSpatialOutput());
SetParameterOutputImage("foutpos", filter->GetSpatialOutput());
}
if(!GetParameterInt("modesearch"))
{
......
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