Commit 448a826a authored by Remi Cresson's avatar Remi Cresson
Browse files

ADD: output background value

parent 36a2d1a6
2 merge requests!88Release v4.1.0,!83Tfmodelserve nodata
Pipeline #46458 passed with stages
in 18 minutes and 29 seconds
Showing with 24 additions and 11 deletions
+24 -11
......@@ -192,7 +192,12 @@ public:
SetDefaultParameterFloat ("output.spcscale", 1.0);
SetParameterDescription ("output.spcscale", "The output image size/scale and spacing*scale where size and spacing corresponds to the first input");
AddParameter(ParameterType_StringList, "output.names", "Names of the output tensors");
MandatoryOff ("output.names");
MandatoryOff ("output.names");
// Output background value
AddParameter(ParameterType_Float, "output.bv", "Output background value");
SetDefaultParameterFloat ("output.bv", 0.0);
SetParameterDescription ("output.bv", "The value used when one input has only no-data values in its receptive field");
// Output Field of Expression
AddParameter(ParameterType_Int, "output.efieldx", "The output expression field (width)");
......@@ -297,6 +302,11 @@ public:
m_TFFilter->SetFullyConvolutional(true);
}
// Output background value
const float outBV = GetParameterFloat("output.bv");
otbAppLogINFO("Setting background value to " << outBV);
m_TFFilter->SetOutputBackgroundValue(outBV);
// Output field of expression
FloatVectorImageType::SizeType foe;
foe[0] = GetParameterInt("output.efieldx");
......
......@@ -132,6 +132,8 @@ public:
itkGetMacro(FullyConvolutional, bool);
itkSetMacro(OutputSpacingScale, float);
itkGetMacro(OutputSpacingScale, float);
itkSetMacro(OutputBackgroundValue, OutputInternalPixelType);
itkGetMacro(OutputBackgroundValue, OutputInternalPixelType);
protected:
TensorflowMultisourceModelFilter();
......@@ -162,17 +164,18 @@ private:
void
operator=(const Self &); // purposely not implemented
SizeType m_OutputGridSize; // Output grid size
bool m_ForceOutputGridSize; // Force output grid size
bool m_FullyConvolutional; // Convolution mode
float m_OutputSpacingScale; // scaling of the output spacings
SizeType m_OutputGridSize; // Output grid size
bool m_ForceOutputGridSize; // Force output grid size
bool m_FullyConvolutional; // Convolution mode
float m_OutputSpacingScale; // scaling of the output spacings
OutputInternalPixelType m_OutputBackgroundValue; // Output background value
// Internal
SpacingType m_OutputSpacing; // Output image spacing
PointType m_OutputOrigin; // Output image origin
SizeType m_OutputSize; // Output image size
PixelType m_NullPixel; // Pixel filled with zeros
SpacingType m_OutputSpacing; // Output image spacing
PointType m_OutputOrigin; // Output image origin
SizeType m_OutputSize; // Output image size
PixelType m_NullPixel; // Pixel filled with zeros
}; // end class
......
......@@ -302,7 +302,7 @@ TensorflowMultisourceModelFilter<TInputImage, TOutputImage>::GenerateOutputInfor
// Set null pixel
m_NullPixel.SetSize(outputPtr->GetNumberOfComponentsPerPixel());
m_NullPixel.Fill(0);
m_NullPixel.Fill(m_OutputBackgroundValue);
//////////////////////////////////////////////////////////////////////////////////////////
// Set the tiling layout hint in metadata
......
Supports Markdown
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