Dear Huang,
sorry for my late answer. Please always reply to
[email protected]<mailto:[email protected]> as well so give
the others the opportunity to take part.
Iterating over points is done as suggested by ITK. Let's say, you have
initialized a mitkPointSet as stated in your last mail and the user has added
some points by interaction (shift + left mouse button click).
By e.g. pushing a button you call a method, that iterates the PointSet and
copies the 3D points into a vector without even using an index.
See the following snippet:
std::vector<PointType> points;
//two iterators
mitk::PointSet::PointsIterator it =
m_Seeds->GetPointSet()->GetPoints()->Begin();
mitk::PointSet::PointsIterator end = m_Seeds->GetPointSet()->GetPoints()->End();
while (it!= end)
{
PointType item = *it;
points.push_back(item);
++it;
}
Results in a copy of the 3D points in a vector... but there a several other
ways...
Does that answer your question?
Best Regards,
Ingmar
Von: Weiyu Huang [mailto:[email protected]]
Gesendet: Mittwoch, 5. Januar 2011 03:27
An: Wegner Ingmar
Betreff: Re: AW: [mitk-users] Get all Points Index in mitk::PointSet
Hi Ingmar:
Thank you for your reply.
Actually I'm working on the base of Step6 in the tutorial of MITK and want to
get the index of every point in class mitk::PointSet and store all the indexes
(the three coordinates of all points) in a vector; both iterate or other
methods are OK.
Here are the source of the part to initialize pointset in Step6:
m_Seeds = mitk::PointSet::New();
mitk::DataNode::Pointer pointSetNode = mitk::DataNode::New();
pointSetNode->SetData(m_Seeds);
pointSetNode->SetProperty("layer", mitk::IntProperty::New(2));
m_DataStorage->Add(pointSetNode);
mitk::GlobalInteraction::GetInstance()->AddInteractor(
mitk::PointSetInteractor::New("pointsetinteractor", pointSetNode));
Regards
Huang
From: Wegner Ingmar<mailto:[email protected]>
Sent: Monday, January 03, 2011 7:59 PM
To: 'Weiyu Huang'<mailto:[email protected]> ;
[email protected]<mailto:[email protected]>
Subject: AW: [mitk-users] Get all Points Index in mitk::PointSet
Hi Huang,
could you explain your question in more detail?
The
PointDataType<http://docs.mitk.org/nightly-qt4/structmitk_1_1PointSet_1_1PointDataType.html>
within mitk::PointSet contains an id which is independent of the position of
the point inside the vector of the
PointSet<http://docs.mitk.org/nightly-qt4/classmitk_1_1PointSet.html>.
Or you you ask for how to iterate over points within the poinset?
Regards,
Ingmar
Von: Weiyu Huang [mailto:[email protected]]
Gesendet: Mittwoch, 29. Dezember 2010 10:15
An: [email protected]<mailto:[email protected]>
Betreff: [mitk-users] Get all Points Index in mitk::PointSet
Dear MITK group:
I'm a new user for MITK and wondering about how to get Index of every point in
mitk::PointSet.
Thanks!
------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand
malware threats, the impact they can have on your business, and how you
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users