256x256 medical image gives me 256x256x3

I need a 256x256 pixels image to use it in my project. I downloaded images from the internet, but when I read the image, it stored in a 256x256x3 variable (color image format PET images). the NSCT fusion algorthms gives me errors (dimension of matrices)
What is the reason for this and what can I do? here is the code to read the image
img1=imread('pet.jpg');
img2=imread('ct.jpg');

 Accepted Answer

You can convert it into gray image using rgb2gray.
I1 = rgb2gray(I) ; % where I is RGB image

2 Comments

Thank you, but I need the color image output not grayscale
You can save the colormap using hsv. Read about it.
Also, you can send each channel seperately, process it and gather into 3D again. If this is the case.

Sign in to comment.

More Answers (0)

Categories

Asked:

on 12 Oct 2020

Commented:

on 12 Oct 2020

Community Treasure Hunt

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

Start Hunting!