Hi Szu, one way to simply create such a tool, is copying the mitkContourTool and rename it to e.g. MyContourCreationTool (whatever).
Then you can simply remove all the logic, that writes the drawn contour back into the segmentation image and instead of that, you store the drawn contour into a mitk::ContourModelSet and is stored within a data node. If you have a look at the QmitkSegmentationView::CreateQtPartControl, you can see how the segmentation tools are created (via QmitkToolSelectionBox). For your plugin you would have to create a new tool selection box, that just contains your tool. Best, Andreas Von: szu <[email protected]<mailto:[email protected]>> Antworten an: szu <[email protected]<mailto:[email protected]>> Datum: Wednesday 12 August 2015 10:09 An: Andreas Fetzer <[email protected]<mailto:[email protected]>>, "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>> Betreff: Re: [mitk-users] get coordinates of a manual contour from plugin Thank you for your answer. Recently I used PointSet to capture several point on a 2d slice. But now I want to draw a contour (e.g. polygon) like in the segmentation tool (Add button). How can I reuse that modul? I found the mitkContourTool.cpp, but how can I integrate it to my own plugin? Or is it possible to create a simple contouring tool (maybe with contourinteractor) ? Best, usz On Wednesday, August 12, 2015 9:52 AM, "Fetzer, Andreas" <[email protected]<mailto:[email protected]>> wrote: Hi Szu, from within your plugin you will have to find the data node, which contains your 2d contour, in the data storage. You can access the data storage from within your plugin via: mitk::DataStorage::Pointer myDataStorage = this->GetDataStorage() Having the data storage, there are various ways to get a specific data node, e.g. myDataStorage->GetNamedNode(name) myDataStorage->GetSubset(Predicate)) Getting the coordinates then depends on how you have created you 2d contour. Best regards, Andreas Von: szu <[email protected]<mailto:[email protected]><mailto:[email protected]<mailto:[email protected]>>> Antworten an: szu <[email protected]<mailto:[email protected]><mailto:[email protected]<mailto:[email protected]>>> Datum: Monday 10 August 2015 10:27 An: "[email protected]<mailto:[email protected]><mailto:[email protected]<mailto:[email protected]>>" <[email protected]<mailto:[email protected]><mailto:[email protected]<mailto:[email protected]>>> Betreff: [mitk-users] get coordinates of a manual contour from plugin Hello, my question is that how can I get the coordinates of a manully drawn 2d contour in my MITK plugin? Thanks, szu ------------------------------------------------------------------------------ _______________________________________________ mitk-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mitk-users
