フィルターのクリア

Can a ROI shape (ie. a Rectangle made by drawRectangle()) be a property of a class?

1 回表示 (過去 30 日間)
Alex
Alex 2024 年 2 月 23 日
コメント済み: Alex 2024 年 2 月 26 日
I am trying to associate a ROI drawn on an image with some other data in an app. So, I made a user defined class "device" that has several properties (a "tag" (the name of the device) and a "shape" (the ROI highlighting the device on an image).
When I try to use the class definition below, I get an error define the shape property:
Error defining property 'shape' of class 'device'. Class named 'Rectangle' is undefined or does not support property
validation. Classes that do not support property validation include Java, COM classes, and MATLAB classes that do not
use the classdef keyword.
See my class definition here:
classdef device
properties
tag string
shape Rectangle
end
methods
end
end

採用された回答

Matt J
Matt J 2024 年 2 月 23 日
編集済み: Matt J 2024 年 2 月 23 日
You need to specify the complete class name:
classdef device
properties
tag string
shape images.roi.Rectangle
end
methods
end
end
  1 件のコメント
Alex
Alex 2024 年 2 月 26 日
thought I did this at some point but probably missed something -- this worked.
Thank you! :)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Data Workflows についてさらに検索

製品


リリース

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by