Hi Xabier,
please continue using the PointSetInteractor, since it allows to interact with 
a number of points >=1. The number  can explicitly be set to 1 by handing over 
this number to the constructor:

mitk::PointSetInteractor::Pointer interactor = 
mitk::PointSetInteractor::New("singlepointinteractor", pointSetNode, 1);
    mitk::GlobalInteraction::GetInstance()->AddInteractor( interactor );


The interaction-pattern "singlepointinteractor" does exactly what you want: It 
sets a point at the picked position and replaces this point by a new position 
once a new position is picked / clicked.

The class PointInteractor was written for hierarchical state machines and does 
not work on regular state machines. Sorry for the inconvenience. I will adapt 
the documentation soon...

Best Regards,
Ingmar
 
Dipl.-Inform. Med. Ingmar Wegner 
DKFZ
German Cancer Research Center (Deutsches Krebsforschungszentrum) 
Member of the Helmholtz Association
Division Medical and Biological Informatics E130
Im Neuenheimer Feld 280
D-69120 Heidelberg
Phone: 49-(0)6221-42-3543
Fax: 49-(0)6221-42-2345
E-Mail: [EMAIL PROTECTED]
Web: www.dkfz.de

Confidentiality Note: This message is intended only for the use of the named 
recipient(s) and may obtain confidential and/or privileged information. If you 
are not the intended recipient, please contact the sender and delete the 
message. Any unauthorized use of the information contained in this message is 
prohibited. 

-----Ursprüngliche Nachricht-----
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Xabier 
Artaechevarria Artieda
Gesendet: Dienstag, 10. Juni 2008 15:59
An: [email protected]
Betreff: [mitk-users] problem to add single point

Hi all,

I have an application in which I have to set a seed point. I tried to  
modify the Region Growing functionality by just changing PointSet to  
PointData and PointSetInteractor to PointInteractor.

It compiles, but when executing the program finishes with "MITK  
MainApp caught something like an exception".
If I change back to PointSet and PointSetInteractor there is no problem.
Why can that be? How could I restrict the number of possible seed  
points to only one?

Thanks for your help in advance,
Xabier

void AirwaySegmentation::Activated()
{
   QmitkFunctionality::Activated();

   if (m_SeedNode.IsNull()) // only once create a new DataTreeNode  
containing a PointSet with some interaction
     {
     // new node and data item
     m_SeedNode = mitk::DataTreeNode::New();
        m_SeedNode->GetPropertyList()->SetProperty("name",  
mitk::StringProperty::New("Seedpoint for airway segmentation"));
        m_Seed = mitk::PointData::New();
     m_SeedNode->SetData( m_Seed );
        std::cout << "New node and data item" << std::endl;

     // new behaviour/interaction for the pointset node
     m_Interactor = mitk::PointInteractor::New("pointsetinteractor",  
m_SeedNode);
     mitk::GlobalInteraction::GetInstance()->AddInteractor( m_Interactor );
        std::cout << "Interactor added" << std::endl;

     // add the pointset to the data tree (for rendering)
     GetDataTreeIterator()->Add( m_SeedNode );
        std::cout << "Point added to the data tree" << std::endl;
     }
}
-- 
Xabier Artaechevarria
Cancer Imaging Laboratory
Centre for Applied Medical Research
www.cima.es






----------------------------------------------------------------
Este mensaje ha sido enviado desde https://webmail.unav.es


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to