why my binary image is 3 dimensional?

3 ビュー (過去 30 日間)
engineer
engineer 2018 年 5 月 23 日
コメント済み: Walter Roberson 2018 年 5 月 24 日
Hello everybody
I don't know why but I actually have a binary image when I run the programme, it gives me this error:
Error using images.internal.imageDisplayValidateParams>validateCData (line 119)
If the input is logical (binary), it must be two-dimensional.
imshow(ImprovedbinaryImage, []);
When I check the size, it is 3 dimensional. when I use another image for the programme, I have no issue.
How can I deal with that?

回答 (1 件)

Jan
Jan 2018 年 5 月 23 日
As far as I understand you get a 3D logical array from a program. This is not a valid "binary image" for the used function. The solution seems to be trivial: If you get an input, which cannot be used as input of your function, don't use it as input to your function. Either run the other program such, that you get a logical 2D matrix, or convert the data (perhaps: any(img, 3) ) such, that you get the required dimensions.
If you want a more specific suggestion, explain, which program creates the unusual array and what you have tried to fix this.
  2 件のコメント
engineer
engineer 2018 年 5 月 24 日
I really do not get the reason. When I use png image from the microscope, I have no problem. When I have sequences of images (tiff format and around 200 images). There is no other way to capture png when I have a video recording as a sequences of images. When I change the format from tiff to png and upload in Matlab, it says that it is not logical.
Walter Roberson
Walter Roberson 2018 年 5 月 24 日
You cannot imshow() an image stack. If you want to see the three dimensional volume, try
volumeViewer(double(ImprovedbinaryImage))

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

カテゴリ

Help Center および File ExchangeImage Data についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by