How do I use sliceViewer with RGB images?

5 ビュー (過去 30 日間)
Prashant Verma
Prashant Verma 2022 年 1 月 24 日
コメント済み: Prashant Verma 2022 年 1 月 25 日
1 have a number of 2D RGB image arrays (slices), each with dimensions (x,y,3).
I have collated them in an array of teh form (x,y,3,nslice). Where nslice is the number of slices. I am trying to vew these colour slices using sliceViwer but it isn't working. If I try and view just one slice I get 3 images in the figure, one for each of R,G abd B. If I have more than one slice in the array I just get an error:-
"sliceViewer requires 3-D grayscale(MxNxP) or 3-D RGB volume(MxNxPx3) with no singleton dimensions."
Trying to re-arrange the data to the foramt suggested doesnt work and doesnt make sense really.
Can anyone help?

採用された回答

Cris LaPierre
Cris LaPierre 2022 年 1 月 24 日
Try using the permute function to swap your 3rd and 4th dimensions.
newRGB = permute(RGB,[1,2,4,3]);
  1 件のコメント
Prashant Verma
Prashant Verma 2022 年 1 月 25 日
Cris, Thank you so much !

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeConvert Image Type についてさらに検索

タグ

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by