How can I know what my image dimension is?

조회 수: 1 (최근 30일)
Shirin
Shirin 2014년 5월 15일
답변: Image Analyst 2014년 5월 15일
Hi guys, I'm trying to register to medical images (CT & Echocardiography) together. while running the code, I faced to this error about "Image Dimension":
"Argument 'MovingImage' failed validation with error: All dimensions of the moving image should be greater than 4."
How can I know what my image dimension is, to set it greater than 4? Thank you in advance

답변 (2개)

Peter Bone
Peter Bone 2014년 5월 15일
If the image matrix is in your workspace, then just look at your workspace pane. It will tell you the dimensions. You could also use the size command to return the size of a matrix. Also, use imshow to make sure your images are correct. It sounds strange that the dimension should be 4 or less. Is it a colour image? Perhaps you have to convert to grayscale first to get a 2D matrix.

Image Analyst
Image Analyst 2014년 5월 15일
Not sure how you're defining dimension but it should be 2 for a grayscale image and 3 for a color image or 3D volumetric image. You can do this
[rows, columns, numberOfColorChannels] = size(yourImage)
numberOfDimensions = ndims(yourImage)

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by