Merge two 3D masks

조회 수: 2 (최근 30일)
Demy
Demy 2023년 3월 30일
답변: Image Analyst 2023년 3월 30일
I have a 3D mask with zero bahground and 3 labels 10 = Ventricles, 20=White matter, 30=Grey matter. I also have a 3D mask with tumour segmentation showing necrosis=1, tumor=2, edema=4.
I would like to merge these two segmentations in a single mask. Any help how to do this?
  댓글 수: 2
Rik
Rik 2023년 3월 30일
Do you just want to add them up? Or do you want to define new numeric labels for each unique combination?
And what have you tried yourself?
Demy
Demy 2023년 3월 30일
편집: Demy 2023년 3월 30일
I have added the two metrices:
brain_mask + tumor mask
But I want to first change the values in tumor segmentation from 1, 2 and 4 to make them 50, 60 and 70 for example. And then add these two matrices

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

답변 (1개)

Image Analyst
Image Analyst 2023년 3월 30일
Try this:
tumor_mask(tumor_mask == 1) = 50;
tumor_mask(tumor_mask == 2) = 60;
tumor_mask(tumor_mask == 4) = 70;
combinedLabeledImage = brain_mask + tumor_mask;
To learn other fundamental concepts, invest 2 hours of your time here:

카테고리

Help CenterFile Exchange에서 Biomedical Imaging에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by