The selected file 1167159U_02.tif can not be attached to this post, because it is only possible to attach files with the following extensions: jpg jpeg gif png txt doc xls pdf ppt pps odt ods odp pxp uxp pxt uxt ipf ihf ifn xop ibw zip dmg csv.
Since we can't really see the image you're dealing with, it's hard to tell if this is the issue, but I have found that with some TIFF images, Igor doesn't load the color table correctly. In that case, this macro fixes the problem.
<br /> macro getTIFFcolors()// if TIFF displays as b&w image and doesn't have a color map, run this. Bug in Igor?<br /> Silent1; PauseUpdate<br /> <br /> ImageLoad/RAT/RTIO/T=tiff // load color tag info from TIFF that was just loaded.<br /> Duplicate/O root:Tag0:tifTag320,cmap // puts it in root<br /> Redimension/n=(256,3) cmap<br /> ModifyImage W_Raster cindex= cmap<br />
end<br />
Since we can't really see the image you're dealing with, it's hard to tell if this is the issue, but I have found that with some TIFF images, Igor doesn't load the color table correctly. In that case, this macro fixes the problem.
If you have an example please send it to support@wavemetrics.com. Igor does not do much with colortable information in TIFF. The use of 8-bit with colortable is somewhat Byzantine.
Your TIF file has Photometric tag set to 1, which means "minIsWhite", and your values are nearly the max (black), so your expectation of a dark image is correct.
I also encountered this problem. I have TIFFs with values of 0 or 255. 0 should be black. Igor interprets 0 as white and 255 black in explicit mode. Applying Grays color table to the image gives the correct result. Explicit mode seems to be the default when I do NewImage/k=0 myTiff. The line ModifyImage myTiff explicit=0,ctab= {*,*,Grays,0} corrects the image.
I guess the solution is to just add this line to my procedure, but it's odd that this is the default for this type of image. Other grayscale TIFFs of identical size and bit depth display as expected.
I have attached a zipped example of two tiffs, one inverts the other doesn't.
I think it would help if one understands why Igor displays the images this way.
Igor displays grayscale images (of more than two levels) with 0 corresponding to black and 255 to white. All bets are off if you apply an external colorscale.
When reading TIFF images, Igor creates waves representing different parts of the data in the file. In the example considered here we have data values that are correctly read and stored into waves. The file also contains an extra bit of information (Photometric Interpretation tag) indicating that a different mapping should be used when the data are displayed. In applications that only use TIFF images for display, it may be appropriate to use this extra tag to scale the data as appropriate for the display of the image. Igor however is data based and so you can't assume that data in the TIFF file should be scaled, flipped or otherwise converted because the user may or may not use the data for display. Igor reads the data. End of story.
I think it is interesting to explore why the original file was saved in this manner. I suspect it may have something to do with the way the image was acquired.
--Jim Prouty
Software Engineer, WaveMetrics, Inc.
March 24, 2017 at 12:31 pm - Permalink
The selected file 1167159U_02.tif can not be attached to this post, because it is only possible to attach files with the following extensions: jpg jpeg gif png txt doc xls pdf ppt pps odt ods odp pxp uxp pxt uxt ipf ihf ifn xop ibw zip dmg csv.
Andy
March 24, 2017 at 12:49 pm - Permalink
macro getTIFFcolors() // if TIFF displays as b&w image and doesn't have a color map, run this. Bug in Igor?<br />
Silent 1; PauseUpdate<br />
<br />
ImageLoad/RAT/RTIO/T=tiff // load color tag info from TIFF that was just loaded.<br />
Duplicate/O root:Tag0:tifTag320,cmap // puts it in root<br />
Redimension/n=(256,3) cmap<br />
ModifyImage W_Raster cindex= cmap<br />
end<br />
Ken
March 24, 2017 at 01:31 pm - Permalink
March 24, 2017 at 02:16 pm - Permalink
Andy
March 24, 2017 at 02:21 pm - Permalink
If you have an example please send it to support@wavemetrics.com. Igor does not do much with colortable information in TIFF. The use of 8-bit with colortable is somewhat Byzantine.
A.G.
WaveMetrics, Inc.
March 24, 2017 at 02:30 pm - Permalink
Your TIF file has Photometric tag set to 1, which means "minIsWhite", and your values are nearly the max (black), so your expectation of a dark image is correct.
--Jim Prouty
Software Engineer, WaveMetrics, Inc.
March 24, 2017 at 05:14 pm - Permalink
--Jim Prouty
Software Engineer, WaveMetrics, Inc.
March 24, 2017 at 05:40 pm - Permalink
NewImage/k=0 myTiff
. The lineModifyImage myTiff explicit=0,ctab= {*,*,Grays,0}
corrects the image.I guess the solution is to just add this line to my procedure, but it's odd that this is the default for this type of image. Other grayscale TIFFs of identical size and bit depth display as expected.
I have attached a zipped example of two tiffs, one inverts the other doesn't.
April 7, 2017 at 02:33 am - Permalink
Igor displays grayscale images (of more than two levels) with 0 corresponding to black and 255 to white. All bets are off if you apply an external colorscale.
When reading TIFF images, Igor creates waves representing different parts of the data in the file. In the example considered here we have data values that are correctly read and stored into waves. The file also contains an extra bit of information (Photometric Interpretation tag) indicating that a different mapping should be used when the data are displayed. In applications that only use TIFF images for display, it may be appropriate to use this extra tag to scale the data as appropriate for the display of the image. Igor however is data based and so you can't assume that data in the TIFF file should be scaled, flipped or otherwise converted because the user may or may not use the data for display. Igor reads the data. End of story.
I think it is interesting to explore why the original file was saved in this manner. I suspect it may have something to do with the way the image was acquired.
A.G.
WaveMetrics, Inc.
April 11, 2017 at 07:38 am - Permalink