Making a RGB 3D array from multiple 2D colored slices
Afficher commentaires plus anciens
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.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Red dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!