How to define, edit and delete ROI in a (scatter) plot?
6 次查看(过去 30 天)
显示 更早的评论
I have a plot of data of some measurement. I want to define several ROIs in the plot, in order to make fitting, or determine the baseline or whatever reason, and I need these ROIs in a variable (or variables). Is it possible to make it grafically? All the methods I tried (imline, brush, datacursor) are for different task and does not allow editing, deleting the ROIs both from the picture and from the variable, I was not able to follow the changes I have made when tried i.e. change the limits of the ROI.
I think there should be something but I could not find it. It is so essential when someone wants to evaluate the data.
Thanks for any suggestions.
Csaba
0 个评论
回答(2 个)
Debarati Banerjee
2016-4-12
For the function 'imline', you can use the method 'delete' to delete the the ROI object from figure. You may edit the position of the ROI using the method 'setPosition'.
Please refer to the section 'Methods' of the following link for more details: http://in.mathworks.com/help/images/ref/imline.html
Hope this helps!
Cheers, Debarati
Debarati Banerjee
2016-4-13
You may use the 'DeleteFcn' property to call a function when an 'imfill' object is being deleted.
>> set(h,'DeleteFcn',{@fcn}) % where h is an imfill object
In the 'fcn' function you can pass aapropriate display commands which will display messages in Command Window and help you in understanding which object is deleted/ position is changed.
3 个评论
Debarati Banerjee
2016-4-14
Hello Csaba,
Please find the scripts 'mainfcn.m' and 'test.m'. In the mainfcn script I have created a ROI (h) and have added the DeleteFcn callback with the function test. Once the ROI is deleted, the test function is executed. In the test script, I am displaying a message in Command Window. Additionally I am setting the value of h to 0 for understanding purpose.
Its just an idea and I hope this helps!
Cheers Debarati
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!