Making a RGB 3D array from multiple 2D colored slices
이전 댓글 표시
Hello, I have multiple CT Scan slices that I want to add together into a 3D array for processing. I have 2 options now, I can convert the slices to RGB beforehand using threshholding and combine them like this:
if slice == 1
array3d = thisSlice
else
array3d = cat(3, array3d, thisSlice);
end
end
implay(array3d);
save ('3D\3d_array.mat', 'array3d' );
Now, the problem with that is that i don't get an RGB array in implay, it takes every color as it's own slice, so when i add 7, i get 21 slices in implay.
The other option is that i combine them using the code above while still in greyscale, and then convert the stack ionto RGB.
But using this code on the stack:
thresh = multithresh(original,2);
seg_I = imquantize(original,thresh);
RGB = label2rgb(seg_I);
does not work, because label2rgb does only take 2D input. I tried label2rgb3D, but that only puts out a 4D double instead of a matrix that I can work with.
For example, i want to blur it using imfilter and i cant get the 4D-double to work with implay or volumeviewer.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Red에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!