Clear Filters
Clear Filters

Converting .txt files to .tif files?

2 views (last 30 days)
RB
RB on 10 Oct 2017
Commented: KSSV on 11 Oct 2017
Hello! I currently have 200 .txt files. However, I need to be able to open them in ImageJ as virtual stacks as images. To save time, I was wondering if there was a code that could turn .txt files into .tif files. Also to be more specific, I was able to save some .txt files as .tif files, however when opened in ImageJ an error message appeared saying ImageJ could not open .tif files with compression. Therefore, I am assuming I need these files to be saved as uncompressed .tif files?
Or another option... My code that saves the .txt files saves 18 arrays as .txt files in 18 different folder locations. It would also be possible to just save them as .tif files from the start. However, I tried this and imwrite command does not seem to like the combination with the code that saves the array to a specific folder. I am not sure which solution would be easier and any help would be greatly appreciated! Thank you!
  2 Comments
OCDER
OCDER on 10 Oct 2017
I would go straight for saving as tif, as opposed to saving as txt, converting it to tif, and then saving again as tif (too many codes to manage, which makes room for bugs and headaches).
"However, I tried this and imwrite command does not seem to like the combination with the code that saves the array to a specific folder."
Let's start here. What code do you have? Why is this causing an issue? And why do you need to save this to 18 folders?
KSSV
KSSV on 11 Oct 2017
It depends what data you have in text files...tell us more about your text files data.

Sign in to comment.

Answers (0)

Categories

Find more on Convert Image Type in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!