Skip to content
Snippets Groups Projects
Commit d4277b1b authored by Guillaume Borrut's avatar Guillaume Borrut
Browse files

ENH: otbUnaryFunctorNeighborhoodWithOffsetImageFilter : radius type is now...

ENH: otbUnaryFunctorNeighborhoodWithOffsetImageFilter : radius type is now SizeType and not any more unsigned int, but SetRadius(unsigned int radius) still exists
parent dbfc3c90
No related branches found
No related tags found
No related merge requests found
......@@ -68,8 +68,16 @@ public:
typedef itk::ProcessObject ProcessObjectType;
/**Set/Get the radius of neighborhood.*/
itkSetMacro(Radius,unsigned int);
itkGetMacro(Radius,unsigned int);
itkSetMacro(Radius,InputImageSizeType);
itkGetMacro(Radius,InputImageSizeType);
/** Set squared radius */
void SetRadius(unsigned int radius)
{
m_Radius.Fill(radius);
}
/** Set/Get the offset */
virtual void SetOffset(InputImageOffsetType off)
{
......@@ -148,7 +156,8 @@ private:
UnaryFunctorNeighborhoodWithOffsetImageFilter(const Self&); //purposely not implemented
void operator=(const Self&); //purposely not implemented
unsigned int m_Radius;
/* unsigned int m_Radius; */
InputImageSizeType m_Radius;
FunctorType m_Functor;
......
......@@ -37,7 +37,8 @@ UnaryFunctorNeighborhoodWithOffsetImageFilter<TInputImage,TOutputImage,TFunction
::UnaryFunctorNeighborhoodWithOffsetImageFilter()
{
this->SetNumberOfRequiredInputs( 1 );
m_Radius = 1;
//m_Radius = 1;
m_Radius.Fill(1);
m_Offset.Fill(1);
m_FunctorList.clear();
}
......@@ -81,8 +82,8 @@ UnaryFunctorNeighborhoodWithOffsetImageFilter<TInputImage,TOutputImage,TFunction
// pad the input requested region by the operator radius
InputImageSizeType maxRad;
maxRad[0] = m_Radius + vcl_abs(m_Offset[0]);
maxRad[1] = m_Radius + vcl_abs(m_Offset[1]);;
maxRad[0] = m_Radius[0] + vcl_abs(m_Offset[0]);
maxRad[1] = m_Radius[1] + vcl_abs(m_Offset[1]);;
inputRequestedRegion.PadByRadius( maxRad );
// crop the input requested region at the input's largest possible region
......@@ -131,8 +132,8 @@ UnaryFunctorNeighborhoodWithOffsetImageFilter<TInputImage, TOutputImage, TFuncti
// Neighborhood+offset iterator
RadiusType rOff;
rOff[0] = m_Radius + vcl_abs(m_Offset[0]);
rOff[1] = m_Radius + vcl_abs(m_Offset[1]);
rOff[0] = m_Radius[0] + vcl_abs(m_Offset[0]);
rOff[1] = m_Radius[1] + vcl_abs(m_Offset[1]);
NeighborhoodIteratorType neighInputOffIt;
// Find the data-set boundary "faces"
typename itk::NeighborhoodAlgorithm::ImageBoundaryFacesCalculator<TInputImage>::FaceListType faceListOff;
......
......@@ -57,8 +57,8 @@ PanTexTextureImageFilter<TInputImage, TOutputImage>
// Neighborhood+offset iterator
RadiusType rOff;
rOff[0] = this->GetRadius() + vcl_abs(this->GetOffset()[0]);
rOff[1] = this->GetRadius() + vcl_abs(this->GetOffset()[1]);
rOff[0] = this->GetRadius()[0] + vcl_abs(this->GetOffset()[0]);
rOff[1] = this->GetRadius()[1] + vcl_abs(this->GetOffset()[1]);
NeighborhoodIteratorType neighInputOffIt;
// Find the data-set boundary "faces"
typename itk::NeighborhoodAlgorithm::ImageBoundaryFacesCalculator<TInputImage>::FaceListType faceListOff;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment