Importing coloured .text image

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Importing coloured .text image

JacK1989
Hi guys, I've looked for an answer on the web but I got nothing.

That's my problem:

I want to display with ImageJ a coloured .text image; the image is stored in MyImage.text file with RGBRGBRGBRGB values separated by spaces (for values on the same line) or newline.

I tried with File->Import->Text Image but I get a horizonatlly stretched image in gray-scale (I understand it: ImageJ thinks the RGB numbers are gray-scale values and the image triplicate in width).
I tried with File->Import->Raw setting 24-bit RGB (Image-type) 0 bytes (offset-to-first-image) and the correct values of width and height but I get a non-sense image; if I look at the upperleft corner pixel RGB values I don't see what I expected (the first three numbers of MyImage.text file). I think the problem stay in the "conversion" from .txt to raw.

Can you help me someway? Maybe with a precise and exact example?
Thank you very much in advance!


Giacomo
Reply | Threaded
Open this post in threaded view
|

Re: Importing coloured .text image

JacK1989
Can't believe no one knows.....
Reply | Threaded
Open this post in threaded view
|

Re: Importing coloured .text image

Rocco D'Antuono
Hi Jack, one solution could be:
-try to import yout .txt file with R or Octave software and take the first value each 3 for each line (so you obtain only red pixel value);
- do the same thing for green channel (obviously starting from second value);
- do the same thing for green channel (obviously starting from third value);
In this way you could obtain red, green and blue channel .txt files, that you could reimport in ImageJ and merge, obtaining you RGB image.
Best regards,
Rocco
 
Senior Microscopist
Crick Advanced Light Microscopy facility (CALM)
The Francis Crick Institute
1 Midland Road, NW1 1AT, London (UK)
https://roccodant.github.io/