필터 지우기
필터 지우기

overlay mask on sequence of mri images to mark out tumor ROI

조회 수: 1 (최근 30일)
Raheema Al Karim Damani
Raheema Al Karim Damani 2019년 10월 18일
댓글: Image Analyst 2019년 10월 19일
I created a mask based on one frame to mark out my ROI region.
segment_mask = poly2mask(xi, yi, 256, 256);
Is there a way I can overlay this mask onto my sequence of frames stored in a 3d array(256 x 256 x #of frames)?

채택된 답변

Daniel M
Daniel M 2019년 10월 19일
편집: Daniel M 2019년 10월 19일
maskedImg = imgArray.*segment_mask;
% segment_mask is size [256,256]
% maskedImg is same size as imgArray
[256, 256, #of frames]
If you are using an older version of Matlab you may have to use bsxfun().
  댓글 수: 1
Image Analyst
Image Analyst 2019년 10월 19일
Like this:
% Mask the image using bsxfun() function to multiply the mask by each channel individually.
maskedImage3d = bsxfun(@times, image3d, cast(mask, 'like', image3d));

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

태그

Community Treasure Hunt

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

Start Hunting!

Translated by