Dear All.<div><br></div><div>I'm using Watershed filter on my work about segmentation. But it often crashed and i can not find the reason. Please Help~</div><div><br></div><div>Error message is : "list iterator not dereferencable"</div>
<div><br></div><div>Try my best to explain the problem.</div><div><br></div><div>This is the part of my program</div><div><br></div><div>.....</div><div>//A SigmoidImageFilter executed.</div><div><br></div><div><div>typedef itk::WatershedImageFilter< InternalImageType > WatershedFilterType; // InternalImageType--> image<float, 2>;</div>
<div>WatershedFilterType::Pointer watershedFilter = WatershedFilterType::New();</div><div>watershedFilter->SetInput( sigmoidFilter->GetOutput() );</div><div>watershedFilter->SetThreshold( _threshold );</div><div>
watershedFilter->SetLevel( _level ); //both threshold and level is between 0~1</div><div>watershedFilter->Update();</div></div><div><br clear="all"><div>When going to this step: SegmentTreeGenerator<TScalarType>::CompileMergeList(SegmentTableTypePointer segments, </div>
<div>SegmentTreeTypePointer mergeList)</div><div>{</div><div> //.....</div><div> </div><div> for (segment_ptr = segments->Begin(); segment_ptr != segments->End();</div><div> ++segment_ptr)</div><div> {</div>
<div> labelFROM = (*segment_ptr).first;</div><div> </div><div> labelTO</div><div> = m_MergedSegmentsTable->RecursiveLookup((*segment_ptr).second.edge_list.front().label);</div><div><br></div><div> //.....</div>
<div>}</div><div><br></div><div>then I found that the segment_ptr -> hash_table only have one element. Thus the list crashed.</div><div>the variable segment is copy of the input which is defined " typename SegmentTableType::Pointer input = this->GetInputSegmentTable(); " in the SegmentTreeGenerator::GenerateData() part.</div>
<div><br></div><div>I'm not clear about the internal implement of this function. Therefore i can't find the reason why it crashed.</div><div>Please HELP!</div><div>THANKS.</div><div><br></div><div><br></div>-- <br>
Nothing but a MADAOŁĄ<br><br>
</div>