how can i apply rgb2gray to dicom image...

why cant i apply rgb2gray to dicom image... its giving an error...
>> I = dicomread('\C:\Users\Asad\Documents\MATLAB\1.dcm');
>> I=rgb2gray(I);
??? Error using ==> rgb2gray>parse_inputs at 82
MAP must be a m x 3 array.
Error in ==> rgb2gray at 35
X = parse_inputs(varargin{:});

 採用された回答

Chandra Kurniawan
Chandra Kurniawan 2012 年 1 月 9 日

0 投票

Please tell me the size of your dicom image by typing
size(I) in command window.

5 件のコメント

Usama Javed
Usama Javed 2012 年 1 月 9 日
512 * 512
Chandra Kurniawan
Chandra Kurniawan 2012 年 1 月 9 日
Very clear.
You cannot perform 'rgb2gray' to this image.
Because the size is already 2 dimentional.
No other way.
Usama Javed
Usama Javed 2012 年 1 月 9 日
actually i am applying gabor filter to dicom image by this code..
I = dicomread('\C:\Users\Asad\Documents\MATLAB\1.dcm');
%I=rgb2gray(img);
[G,gabout] = gaborfilter1(I,.9,10,16,pi/3);
will there be any effect on my output image if i am not applying rgb2gray....
Chandra Kurniawan
Chandra Kurniawan 2012 年 1 月 9 日
It seem that gaborfilter1 is not built-in matlab function.
So, you can verify to the author what is input image for gaborfilter1.
Is it two-dimensional arrays?
If yes, then without performing 'rgb2gray', the output should be correct.
Usama Javed
Usama Javed 2012 年 1 月 9 日
al right thanks..... :)

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeDICOM Format についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by