MATLAB Answers

0

Cannot get .tif image to display. Following are image info

Asked by khalil ur Rehman on 15 Jan 2019
Latest activity Commented on by Walter Roberson
on 15 Jan 2019
Accepted Answer by KSSV
Filename: 'D:\PhD Research Work China\MATLAB\Imag11.tif'
FileModDate: '05-Dec-2018 17:56:30'
FileSize: 9678057
Format: 'tif'
FormatVersion: []
Width: 3328
Height: 4096
BitDepth: 16
ColorType: 'grayscale'
FormatSignature: [73 73 42 0]
ByteOrder: 'little-endian'
NewSubFileType: 0
BitsPerSample: 16
Compression: 'unknown'
PhotometricInterpretation: 'BlackIsZero'
StripOffsets: 8
SamplesPerPixel: 1
RowsPerStrip: 4096
StripByteCounts: 9677772
XResolution: []
YResolution: []
ResolutionUnit: 'Inch'
Colormap: []
PlanarConfiguration: 'Chunky'
TileWidth: []
TileLength: []
TileOffsets: []
TileByteCounts: []
Orientation: 1
FillOrder: 1
GrayResponseUnit: 0.0100
MaxSampleValue: 65535
MinSampleValue: 0
Thresholding: 1
Offset: 9677780
ImageDescription: '1.2.840.113681.3232235880.1521015602.4028.186'
Software: '0'
Artist: 'MBCIMAGE'
DotRange: [0 4095]
UnknownTags: [4×1 struct]

  4 Comments

Show 1 older comment
I2 = imread('Imag11.tif');
imshow (I2);
warning('off', 'Images:initSize:adjustingMag');
imfinfo('Imag12.tif');
% File size is very larage(5mb) i can change it to jpeg kindly change it into tif and than proceed
Unable to read...it says the file is corrupt....

Sign in to comment.

Tags

Products


Release

R2017a

1 Answer

Answer by KSSV
on 15 Jan 2019
Edited by KSSV
on 15 Jan 2019
 Accepted Answer

YOu should use fread to read the data. Read about fread. Also have a look on Tiff
s = imfinfo('Imag11.tif') ;
T = Tiff('Imag11.tif','r') ;
I = read(T);

  3 Comments

Warning: TIFF library warning - 'TIFFReadDirectory: Unknown field with tag 50000 (0xc350) encountered.'
> In Tiff (line 651)
In IMP_test (line 28)
Warning: TIFF library warning - 'TIFFReadDirectory: Unknown field with tag 50001 (0xc351) encountered.'
> In Tiff (line 651)
In IMP_test (line 28)
Warning: TIFF library warning - 'TIFFReadDirectory: Unknown field with tag 50002 (0xc352) encountered.'
> In Tiff (line 651)
In IMP_test (line 28)
Warning: TIFF library warning - 'TIFFReadDirectory: Unknown field with tag 50003 (0xc353) encountered.'
> In Tiff (line 651)
In IMP_test (line 28)
Warning: TIFF library error - 'D:\PhD Research Work China\MATLAB\Imag12.tif: Compression scheme 32765 strip decoding is
not implemented.' - file may be corrupt.
> In Tiff/readAllStrips (line 2088)
In Tiff/read (line 1507)
In IMP_test (line 29)
% These errors are displaying
The files are too small to hold all of the data, at least if it is in uncompressed form. 4096 rows by 3328 columns by 2 bytes per sample should be 27262976 bytes for the data, but the first file is only about 1/3 of that at 9678057 bytes.
If the file is not corrupt then it is using an unknown compression #32765, which I do not seem to locate any reference for. A proprietary compression scheme perhaps.
By the way, I used fread to read in the raw data, and I manipulated it under several potential configurations. I could see that there is some structure in the data, but nothing I could come up with looked anything like an "image".

Sign in to comment.