Function to read a 16bit color composite image to matlab
24 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Yonatan Degefu
le 4 Juil 2017
Commenté : Walter Roberson
le 30 Avr 2019
Hi, I was trying to open a 16 bit color composite image in matlab but everytime it gives me a dark surface when using imread. What is another function I can use to read it into matlab and perform further image analysis.
3 commentaires
Nirav Sharda
le 13 Juil 2017
The following documentation link has a section that talks about how to read tiff file image data and metadata.
Réponse acceptée
Walter Roberson
le 13 Juil 2017
imread() is probably valid to read the image. Using the Tiff class would be another way.
But the problem is likely not in reading the image, but rather in displaying the image. It is pretty uncommon that the full 16 bit range is used for images stored as 16 bit TIFF: it is more likely that instrument readings are being stored, such as CT images.
It is not uncommon that the used data range for 16 bit TIFF images is roughly -600 to +4000 (technically -4096 to +4095) such as for CT, or roughly 1000 to 6000 (MRI).
You can use imagesc(data), or use imshow(data, []) to have the minimum and maximum stored data mapped across the available colormap.
You will likely find, however, that the data range of interest is only a subset of what is stored. You can pass specific min and max values to imagesc() or imshow() to map the given range across the color map, with lower values mapped to the first color and higher values mapped to the second color.
Once you have identified the range of interest, then you can either zero out everything outside the range, or you can use mat2gray() and pass in the range to map the chosen range to the interval [0, 1].
0 commentaires
Plus de réponses (2)
Kelly Kearney
le 13 Juil 2017
Many years ago, I had to work with some 16-bit color avi files. Those files stored the RGB color data using 16 bits per pixel: 5 bits each for red, blue, and green, and one bit unused. Assuming your images use a similar encoding, you can probably adapt that code to your tiff images; it's available here: avidread16bitcol.m.
0 commentaires
Eslam Wafdy
le 29 Avr 2019
Try using imagesc(data matrix)
1 commentaire
Walter Roberson
le 30 Avr 2019
I talked about that in my answer. The data range of interest is often not the data range so you have to be careful about how you use imagesc()
Voir également
Catégories
En savoir plus sur Convert Image Type dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!