[Insight-developers] PathIterator choosing a step size that is too small?

Ho Cheung hocheung20 at gmail.com
Fri Feb 24 16:59:32 EST 2012


Hi all,

I am currently using a PathIterator to try to move through some pixels
between two indices. My iterator moves successfully most of the way and
then decides to calculate a very small step size, so small that it becomes
#DEN when I look at it with the debugger.
Here is the relevant code:


    ImageType::IndexType node1 = cell->critical_points_queue[node_from];
    ImageType::IndexType node2 = cell->critical_points_queue[node_to];

    typedef itk::PolyLineParametricPath< 3 > PathType;
    PathType::Pointer path = PathType::New();
    path->Initialize();

    std::cout << "Start Index: " << start_index << " " << "End Index: " <<
end_index << std::endl;

    path->AddVertex(node1);
    path->AddVertex(node2);

    typedef itk::PathConstIterator< VesselnessImageType, PathType >
PathIteratorType;
    PathIteratorType path_iter(cell->vesselness_image, path);

    double sum_of_vesselness_values = 0;
    itk::uint64_t path_length = 0;
    path_iter.GoToBegin();
    while (!path_iter.IsAtEnd())
    {
        std::cout << "Path iterator position: " <<
path_iter.GetPathPosition() << std::endl;
        std::cout << "Path iterator index: " << path_iter.GetIndex() <<
std::endl;
        sum_of_vesselness_values += path_iter.Get();
        ++path_iter;
    }


And here is the relevant output:

Start Index: [100, 81, 17] End Index: [114, 81, 17]
Path iterator position: 0
Path iterator index: [100, 81, 17]
Path iterator position: 0.0888889
Path iterator index: [101, 81, 17]
Path iterator position: 0.177778
Path iterator index: [102, 81, 17]
Path iterator position: 0.237037
Path iterator index: [103, 81, 17]
Path iterator position: 0.296296
Path iterator index: [104, 81, 17]
Path iterator position: 0.385185
Path iterator index: [105, 81, 17]
Path iterator position: 0.444444
Path iterator index: [106, 81, 17]
Path iterator position: 0.533333
Path iterator index: [107, 81, 17]
Path iterator position: 0.592593
Path iterator index: [108, 81, 17]
Path iterator position: 0.651852
Path iterator index: [109, 81, 17]
Path iterator position: 0.740741
Path iterator index: [110, 81, 17]
Path iterator position: 0.8
Path iterator index: [111, 81, 17]
<Crash>

Thanks,

Ho Cheung
Research Assistant
Bio-Image Analytics Lab - University of Houston
hocheung20 at gmail.com
Cell: (832) 215-6347
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-developers/attachments/20120224/8e26729d/attachment.htm>


More information about the Insight-developers mailing list