How to define, edit and delete ROI in a (scatter) plot?
3 ビュー (過去 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!