Skip to content
Snippets Groups Projects
Commit eaa5cfb7 authored by Julien Michel's avatar Julien Michel
Browse files

BUG: Fixing error in adjacency condition leading to incomplete adjacency table

parent c1203464
No related branches found
No related tags found
No related merge requests found
......@@ -185,10 +185,10 @@ LabelImageToLabelMapWithAdjacencyFilter<TInputImage, TOutputImage>
if(label1 != label2)
{
//Check adjacency
if( ( (start1-offset >= start2) && (start1-offset<=end2) )
|| ( (end1 +offset >= start2) && (end1 +offset<=end2) )
|| ( (start2-offset >= start1) && (start2-offset<=end1) )
|| ( (end2 +offset >= start1) && (end2 +offset<=end1) ))
if( ( (start1 >= start2 - offset) && (start1 <= end2 + offset) )
|| ( (end1 >= start2 - offset) && (end1 <= end2 + offset) )
|| ( (start2 >= start1 - offset) && (start2 <= end1 + offset) )
|| ( (end2 >= start1 - offset) && (end2 <= end1 + offset) ))
{
// Add the adjacency
this->AddAdjacency(label1, label2, threadId);
......@@ -239,7 +239,7 @@ LabelImageToLabelMapWithAdjacencyFilter<TInputImage, TOutputImage>
}
// create the run length object to go in the vector
m_TemporaryImages[threadId]->SetLine( idx, length, v );
currentLine.push_back(RLE(idx, length, v));
currentLine.push_back(RLE(idx, length, v));
}
else
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment