Skip to content
Snippets Groups Projects
Commit 77763f3f authored by Otmane Lahlou's avatar Otmane Lahlou
Browse files

ENH: otbExtractSegmentsImageFilter changes, adding a LineValue attribute

parent eb951924
Branches
Tags
No related merge requests found
......@@ -128,6 +128,9 @@ public:
void SetInputImageDirection( const InputImageType *image);
const InputImageType * GetInputImageDirection(void);
/** Set/Get the value of the drawed line*/
itkGetMacro(LineValue,typename OutputImageType::PixelType );
itkSetMacro(LineValue,typename OutputImageType::PixelType );
protected:
......@@ -147,6 +150,7 @@ private:
ExtractSegmentsImageFilter(const Self&); //purposely not implemented
void operator=(const Self&); //purposely not implemented
typename OutputImageType::PixelType m_LineValue;
typename PixelSuppressionType::Pointer m_PixelSuppression;
typename LocalHoughType::Pointer m_LocalHough;
......
......@@ -39,6 +39,8 @@ ExtractSegmentsImageFilter<TInputImage, TOutputImage>
m_FillGaps = FillGapsType::New();
m_DrawLineList = DrawLineListType::New();
m_Rescaler =RescaleType::New();
m_LineValue = static_cast<typename OutputImageType::PixelType>(255.);
}
/**
......@@ -214,18 +216,19 @@ void
ExtractSegmentsImageFilter<TInputImage, TOutputImage>
::GenerateData()
{
m_Rescaler->SetInput( this->GetInputImage() );
m_PixelSuppression->SetInputImage( m_Rescaler->GetOutput() );
m_PixelSuppression->SetInputImage( this->GetInputImage() );
m_PixelSuppression->SetInputImageDirection( this->GetInputImageDirection() );
m_LocalHough->SetInput( m_PixelSuppression->GetOutput() );
m_Rescaler->SetInput( m_PixelSuppression->GetOutput() );
m_LocalHough->SetInput( m_Rescaler->GetOutput() );
m_FillGaps->SetInput ( m_LocalHough->GetOutput() );
m_DrawLineList->SetInput( /*this->GetInputImage()*/m_Rescaler->GetOutput() );
m_DrawLineList->SetInput( this->GetInputImage() );
m_DrawLineList->SetInputLineSpatialObjectList( m_FillGaps->GetOutput() );
m_DrawLineList->SetValue(0.);
m_DrawLineList->SetValue(m_LineValue);
m_DrawLineList->GraftOutput( this->GetOutput() );
m_DrawLineList->Update();
......
......@@ -196,6 +196,7 @@ int main( int argc, char * argv[] )
detector->SetInput( reader->GetOutput() );
extractor->SetInputImage( detector->GetOutput() );
extractor->SetInputImageDirection( detector->GetOutputDirection() );
extractor->SetLineValue(0.);
rescaler->SetInput( extractor->GetOutput() );
writer->SetInput( rescaler->GetOutput() );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment