フィルターのクリア

save .TIFF file

3 ビュー (過去 30 日間)
Soum
Soum 2016 年 6 月 8 日
回答済み: Walter Roberson 2016 年 6 月 11 日
I have an image (medical image) stocked as .TIFF file, when I read it I’ve found 4 matrix the first, the second and the third one are the RGB components of my image the fourth one is a binary matrix (contains only 1 values), I dont know what is it. I’ve denoised it but the problem is : -when I save it I got 000 values (black image) but when I open it under matlab I see that it is not an empty matrix this is my code :
t = Tiff([source2,'',num2str(v)],'w');
tagstruct.ImageLength = 1000;
tagstruct.ImageWidth = 1024;
tagstruct.Photometric = Tiff.Photometric.RGB;
tagstruct.BitsPerSample = 32;
tagstruct.SamplesPerPixel = 4;
tagstruct.RowsPerStrip = 1000;
tagstruct.ExtraSamples =Tiff.ExtraSamples.AssociatedAlpha;
tagstruct.PlanarConfiguration = Tiff.PlanarConfiguration.Chunky;
tagstruct.Software = 'MATLAB';
tagstruct.SampleFormat=Tiff.SampleFormat.IEEEFP;
t.setTag(tagstruct);
t.write(single(Iy_d));
t.close();
I want to read the head of the file in order to check my BitsPerSample but I couldn’t
Xn= imread([source,'', num2str(v)],'tif')
I got this error :
info = imfinfo(Xn);
Error using imfinfo (line 80)
Expected FILENAME to be one of these types:
char
Instead its type was uint8
this make me confused because it shouldn't be uint8 !, So I convert it to double
Xn=im2double(imread([source,'', num2str(v)],'tif'))
But without any avail
  2 件のコメント
Stephen23
Stephen23 2016 年 6 月 8 日
編集済み: Stephen23 2016 年 6 月 8 日
The fourth matrix is the alpha channel (i.e. opacity/transparency), which means the image data is not just RGB but actually RGBA.
Soum
Soum 2016 年 6 月 8 日
編集済み: Soum 2016 年 6 月 8 日
Thank you I didn't know before what is an RGBA image. I'll try based on this information

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

回答 (1 件)

Walter Roberson
Walter Roberson 2016 年 6 月 11 日
imfinfo needs to be applied to the image file name, not to what was read in from the file.

カテゴリ

Help Center および File ExchangeFile Operations についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by