.img (double) to .png (double) using imwrite

1 visualizzazione (ultimi 30 giorni)
Sai Kiran Maryada
Sai Kiran Maryada il 6 Ago 2019
Commentato: Kavya Vuriti il 9 Ago 2019
I have a .img file of datatype double (666*512). I want to convert it into .png file with out any loss. I'm using imwrite and the png file obtained has a dimension of 666*512 datatype uint8 due to which I'm not able to view the image. I have read the imread documentation.
"imwrite(A,filename) writes image data A to the file specified by filename, inferring the file format from the extension. imwrite creates the new file in your current folder. The bit depth of the output image depends on the data type of A and the file format. For most formats:
If A is a grayscale or RGB color image of data type double or single, then imwrite assumes that the dynamic range is [0,1] and automatically scales the data by 255 before writing it to the file as 8-bit values. If the data in A is single, convert A to doublebefore writing to a GIF or TIFF file."
I would like to know is there a way for me to convert the raw image(.img of type double) to png image (type double) so that I can view the png file which is same as .img file (pixel by pixel).
Thank you so much for your time.

Risposte (0)

Categorie

Scopri di più su DICOM Format in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by