X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 11 Sep 2015 03:05 PM by  anon
Problem with read_tiff
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
11 Sep 2015 03:05 PM
    I am trying to use simple operation read_tiff(myfile, r, g, b). After the read variables r,g and b remain undefined so I can not use them. So even TVLCT, red, green, blue gives the message : "TVLCT: Variable is undefined: R. % Execution halted at: $MAIN$". What might be the problem?

    Deleted User



    New Member


    Posts:81
    New Member


    --
    11 Sep 2015 07:15 PM
    Hello, For your READ_TIFF command, "read_tiff(myfile, r, g, b)", this assumes that "myfile" contains a color palette (color table). If that is not the case the R, G and B will not be defined. You can determine if your TIFF file has a color palette with a commands like: !null = query_tiff(myfile, info) print, info.has_palette ? 'Has a color palette.' : 'No color palette.' Here's an example using the "examples.tif" file which is included with an IDL installation: IDL> file = filepath('examples.tif',subdir=['examples','data']) IDL> print, file C:\Program Files\Exelis\IDL85\examples\data\examples.tif IDL> print, query_tiff(file, info) 1 IDL> print, info.has_palette ? 'Has a color palette.' : 'No color palette.' Has a color palette. IDL> img = read_tiff(file, r, g, b) % Loaded DLM: TIFF. IDL> help, r, g, b R BYTE = Array[256] G BYTE = Array[256] B BYTE = Array[256] IDL> device, decomposed=0 IDL> tvlct, r, g, b IDL> help, img IMG BYTE = Array[375, 150] IDL> window, xsize=375, ysize=150 IDL> tv, img, /order Or with function graphics, just issue the commands: file = filepath('examples.tif',subdir=['examples','data']) img = image(file) I hope this will be helpful. Regards,
    You are not authorized to post a reply.