简体   繁体   中英

Spatial Transform to ROI in MATLAB

I'm looking for a way to apply a spatial transform to multiple ROI's in based off an image.

What I have is a predefined image which has multiple ROI's specified on it, and another image that is not set which we match to the original and transform using cp2tform and 'lwm'.

I want to know if theres a way to use the transform on the set of ROI points and then split up the ROI's again.

If the ROIs are stored as binary images, you can use the tform you get from cp2tform to transform these binary images, just like any other image, using imtransform or imwarp .

If the ROIs are stored as lists of points, you can transform the coordinates using tformfwd . Or, you can make binary images out of these lists using poly2mask and use the approach above.

In either case, note that keeping your coordinate systems straight can be tough. For example, you ROI points might have the origin in the lower left while the image has the origin in the upper left. This can cause the transformations to not line up. Generally you can fix this by carefully reading the help for these functions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM