Hello, I currently have a bunch of arrays that I have created and edited with earlier code. They are 512x512 double arrays that contain either a 1 or a 0 in each location. Currently, I can call on an array and save the array as a .txt file or .csv file. For example: dlmwrite('AnswerArray.txt', array) and csvwrite('AnswerArray.txt', array)
I use these arrays in ImageJ and can open them as images by importing them as text images. However, I am wondering if there is a way to save an array with 1s and 0s as a .tif file. Any help would be greatly appreciated! Thank you!

 Akzeptierte Antwort

Walter Roberson
Walter Roberson am 6 Okt. 2017

2 Stimmen

imwrite( logical(YourMatrix), 'NameOfFile.tiff')
TIFF supports 1 bit data (not all image formats do.)

1 Kommentar

RB
RB am 6 Okt. 2017
Thank you! I had to add 'Compression', 'none' to the end of the code to be able to open the tiff file in imageJ for future reference but this code worked!!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Convert Image Type finden Sie in Hilfe-Center und File Exchange

Tags

Gefragt:

RB
am 6 Okt. 2017

Kommentiert:

RB
am 6 Okt. 2017

Community Treasure Hunt

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

Start Hunting!

Translated by