Hi szu, don't worry ;) So just to be sure what is going wrong: The tool button is displayed and enabled? I.e. you can activate the tool? But nothing happens, when you draw a contour?
Andreas Von: szu <[email protected]<mailto:[email protected]>> Antworten an: szu <[email protected]<mailto:[email protected]>> Datum: Wednesday 19 August 2015 15:03 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 Hello Anreas, sorry for my lot of questions and misunderstood, but I still can not managed to get a manual drawn contour in my own plugin...I did not find what happens when I turn the Add button and draw a single contour (in the segmentation tool), because what I want is just that funcionality: to click a button and then draw a contour (I can't find this part in the QmitkSegmentationView). Thanks, szu On Monday, August 17, 2015 9:39 AM, "Fetzer, Andreas" <[email protected]<mailto:[email protected]>> wrote: Hi Szu, please keep the conversation on the list so that others can take benefit from your question as well. For using the tools, you will have to set the reference data (your patient image) and the working data (segmentation image) for the toolmanager. You can easily create a new segmentation by using the mitk::Tool::CreateEmptySegmentation (also there is example code in the Segmentation Plugin View). I am not entirely sure regarding the following: If you do not want to create a new segmentation since you just need the delineated contour and not binary image information, it might be possible to set the patient grey value image as both: reference and working image. But note: If you are writing the contour back into the image, your patient image would be modified in this way. Hope this helps! Cheers, 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: Friday 14 August 2015 15:25 An: Andreas Fetzer <[email protected]<mailto:[email protected]><mailto:[email protected]<mailto:[email protected]>>> Betreff: Re: [mitk-users] get coordinates of a manual contour from plugin Hi Andreas, sorry about my previous mail, it contained one of my false experiment. So as you mentioned, I created a QmitkToolSelectionBox(with just one "Add" label), and from the QmitkSegmentationView::CreateQtPartControl I reused the following lines: mitk::ToolManager* toolManager = m_Controls->m_ManualToolSelectionBox->GetToolManager(); toolManager->SetDataStorage( *(this->GetDefaultDataStorage()) ); assert ( toolManager ); m_Controls->m_ManualToolSelectionBox->SetDisplayedToolGroups("Add"); m_Controls->m_ManualToolSelectionBox->SetEnabledMode( QmitkToolSelectionBox::EnabledWithReferenceAndWorkingDataVisible ); But I'm stucked here, what are the next steps? Many thanks, szu On Friday, August 14, 2015 3:00 PM, szu <[email protected]<mailto:[email protected]><mailto:[email protected]<mailto:[email protected]>>> wrote: 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]<mailto:[email protected]><mailto:[email protected]<mailto:[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]><mailto:[email protected]<mailto:[email protected]>><mailto:[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]>><mailto:[email protected]<mailto:[email protected]><mailto:[email protected]<mailto:[email protected]>>>> Datum: Wednesday 12 August 2015 10:09 An: Andreas Fetzer <[email protected]<mailto:[email protected]><mailto:[email protected]<mailto:[email protected]>><mailto:[email protected]<mailto:[email protected]><mailto:[email protected]<mailto:[email protected]>>>>, "[email protected]<mailto:[email protected]><mailto:[email protected]<mailto:[email protected]>><mailto:[email protected]<mailto:[email protected]><mailto:[email protected]<mailto:[email protected]>>>" <[email protected]<mailto:[email protected]><mailto:[email protected]<mailto:[email protected]>><mailto:[email protected]<mailto:[email protected]><mailto:[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]><mailto:[email protected]<mailto:[email protected]>><mailto:[email protected]<mailto:[email protected]><mailto:[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]>><mailto:[email protected]<mailto:[email protected]><mailto:[email protected]<mailto:[email protected]>>><mailto:[email protected]<mailto:[email protected]><mailto:[email protected]<mailto:[email protected]>><mailto:[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]>><mailto:[email protected]<mailto:[email protected]><mailto:[email protected]<mailto:[email protected]>>><mailto:[email protected]<mailto:[email protected]><mailto:[email protected]<mailto:[email protected]>><mailto:[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]>><mailto:[email protected]<mailto:[email protected]><mailto:[email protected]<mailto:[email protected]>>><mailto:[email protected]<mailto:[email protected]><mailto:[email protected]<mailto:[email protected]>><mailto:[email protected]<mailto:[email protected]><mailto:[email protected]<mailto:[email protected]>>>>" <[email protected]<mailto:[email protected]><mailto:[email protected]<mailto:[email protected]>><mailto:[email protected]<mailto:[email protected]><mailto:[email protected]<mailto:[email protected]>>><mailto:mitk-users@lists .sourceforge.net<mailto:[email protected]><mailto:[email protected]<mailto:[email protected]>><mailto:[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
