crop the base image from the mask
3 ビュー (過去 30 日間)
古いコメントを表示
hi, I have a base image and a mask image (both are 3d medical Images)in .mhd format.I have the code to read my image in the above format. Can anyone provide me help in cropping my base image with the mask.
Thanks
0 件のコメント
採用された回答
Image Analyst
2012 年 1 月 12 日
To crop, you can calculate the top, bottom, left, and right columns of the mask's "true" area by using any(). Then use
croppedImage = fullImage(row1:row2, col1:col2);
or you can use imcrop().
3 件のコメント
Image Analyst
2012 年 1 月 12 日
You might be able to extend that concept to a 3D image, just add a slice1:slice2 dimension to the fullImage() index list. fullImage is the name of your image array, not a function. Please verify that you want cropping (to the maximum extents of the mask), and not simply masking the data with your mask - they're very different things.
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!