Missing the color tables of iolite 3/Igor Pro in iolite 4? Read on to find out how you can transfer those color tables from Igor Pro to iolite 4!
Getting the color table data
Start Igor Pro, open the Command Window (Control+J for Windows, Command+J for Mac) and enter the following commands, followed by enter:
|
|
This will open up a table of the red, green and blue values for the specified color table, in this case ‘ColdWarm’. Note that the values are between 0 and 65535, which will be important later.
We can save this data out to a text file by going to Igor Pro’s Data->Save waves->Save delimited text menu item. In the prompt, be sure to uncheck the option to write the wave name as shown below:
Adding it to iolite 4
Now we have the color table data in a format that we can easily read from python in iolite 4. Custom iolite 4 color tables are stored in the settings as a dict of lists, e.g.
|
|
Where the parameters for QColor are the red, green, and blue values, but between 0 and 255 rather than 0 and 65535.
Knowing this information, the simple script below can be used to:
- Get the existing (custom) color tables from iolite
- Ask the user to pick a file
- Read the file using pandas
- Create a new list of QColors from the file contents while rescaling the values
- Ask the user to name the new color table
- Write the color tables back to iolite’s settings
|
|
In action
After restarting iolite, you will now find your new color map as an option when choosing color scales in imaging. Shown below is our go-to otolith example in Igor Pro’s cold warm.
If you have any questions, comments or suggestions about this Note, you can discuss it here.