How can the image Processing of .tif file of size 763x1023x4 be done?

3 views (last 30 days)
NITIN KUMAR
NITIN KUMAR on 10 May 2022
Commented: NITIN KUMAR on 12 May 2022
I am using SEM files in .tif format for image processing using MATLAB to extract the edge, size, and area of the microstrtucture. The size of the file is 763x1024x4, The image is already in grayscale colour and I am not able to apply the command which I am leaning through Matlab online course. there are many errors showing just using imshow(file) command like
Error using images.internal.imageDisplayValidateParams>validateCData
Multi-plane image inputs must be RGB images of size MxNx3.
Error in images.internal.imageDisplayValidateParams (line 30)
common_args.CData = validateCData(common_args.CData,image_type);
Error in images.internal.imageDisplayParseInputs (line 79)
common_args = images.internal.imageDisplayValidateParams(common_args);
Error in imshow (line 253)
images.internal.imageDisplayParseInputs({'Parent','Border','Reduce'},preparsed_varargin{:});
Error in sample (line 5)
imshow(I)
Kindly help me with solution, since I am stuck at beginning, so could not proceed with image segmentation, detection & analysing texture.
  1 Comment
Image Analyst
Image Analyst on 10 May 2022
What is the format of the file -- what is it's filename extension?
Have you looked for readers for that file type in the File Exchange?
Can you attach the file here?
How did you read in the file to (the badly-named) I? Or is (the badly-named) I a character array that is the filename rather than the image variable itself?

Sign in to comment.

Accepted Answer

DGM
DGM on 10 May 2022
Edited: DGM on 10 May 2022
Imshow() can only represent 1-channel (grayscale) images or 3-channel images (represented as RGB).
So whatever you do to display a 4-channel image will depend on what the channels represent. Normally, if I see a 4-channel image, I expect that it's RGBA or CMYK. Alternatively, it could be some sort of multispectral image, so as with RGBA you'd have to know which channels are which in order to know how to split/view it. Maybe it's just a volumetric image with only 4 z-slices. Maybe it's not even conceptually volumetric, but merely four independent grayscale frames.
I'm not sure what conventions exist for SEM imaging. I'm guessing it's four independent grayscale frames. If that's the case, then you can just show the pages independently:
imshow(A(:,:,1)) % show just the first page/frame
Alternatively, you can use montage for a quick view of all pages.
A = imread('cameraman.tif');
A = cat(3,A,rot90(A,1),rot90(A,2),rot90(A,3)); % make a 4-channel image to test
% swap dim 4 and 3 so that montage correctly treats it as a multiframe image
% montage arranges the images row-wise (left-right, top-bottom)
montage(permute(A,[1 2 4 3]))
  5 Comments
NITIN KUMAR
NITIN KUMAR on 12 May 2022
@DGM thank you so much for zour advice, I have started working on part by part on the image to generate approx vector details so that i can have an approy geometry. I will also check out the link which you sent.

Sign in to comment.

More Answers (1)

Image Analyst
Image Analyst on 10 May 2022
If you have a hyperspectral image and want to know how to process and display as an RGB image, see the attached article.

Community Treasure Hunt

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

Start Hunting!

Translated by