Hi Andreas,
I'm getting a bit closer to the solution....I created a button(Add), which will
be the activator for the contouring tool (instead of a selection box) and I
renamed and copied the mitkContourTool into my own plugin's directory. But I
couldn't figured out how can I create(with ToolManager?) and use this
ContourTool (if the user click on the Add button). I created a ToolManager
based on the QmitkSegmentationView::CreateQtPartControl:
mitk::ToolManager* toolManager =
mitk::ToolManagerProvider::GetInstance()->GetToolManager(); assert (
toolManager );
toolManager->SetDataStorage( *(this->GetDefaultDataStorage()) );
toolManager->InitializeTools();
m_Controls->pbAdd->SetToolManager( *toolManager );
But how can I use the ContourTool via toolManager?
Best,szu
On Thursday, August 13, 2015 4:42 PM, "Fetzer, Andreas"
<[email protected]> wrote:
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