MATLAB: Matlab read and display a .raw files

3d raw filesMATLAB

I have a .raw file of resolution: 150*150*276 and I want to read and display the .raw file in matlab. I'm using the following code snippet:
>>fid= fopen('mouse0.raw','r');
>> I=fread(fid,150*150*276,'uint16');
>> Z=reshape(I,[150 150 276]);
>> imshow(Z);
However, am getting this error: _Error using images.internal.imageDisplayValidateParams>validateCData (line 115) Multi-plane image inputs must be RGB images of size MxNx3.
Error in images.internal.imageDisplayValidateParams (line 27) common_args.CData = validateCData(common_args.CData,image_type);
Error in images.internal.imageDisplayParseInputs (line 78) common_args = images.internal.imageDisplayValidateParams(common_args);
Error in imshow (line 222) images.internal.imageDisplayParseInputs({'Parent','Border','Reduce'},preparsed_varargin{:});_
Please reply at the earliest, if possible 🙂

Best Answer

There is no way in MATLAB to display an image with 276 color channels.
Related Question