View Full Version here: : Pseudocolour mapping
kosborn
29-03-2021, 10:12 PM
I thought I'd add another post to continue the pseudocolour mapping discussion started by Peter in this post (http://www.iceinspace.com.au/forum/showthread.php?t=189995). I found a colour mapping scheme developed for astronomy by Dr Dave Green from the Battcock Centre for Experimental Astrophysics at the University of Cambridge. It seemed like a good idea for a PixInsight plugin which I've written and placed on Github (https://github.com/kjosborn/CubeHelix) along with a short explanantion of the algorithm.
Use of the plugin is pretty straight forward. It can only be applied to a monochrome image (using it on a colour image makes no sense). After selecting the source image, the parameters can be changed (explanation of the params at the Github site) and clicking the 'Apply' button updates the colour scale and the pseudo colour image. This can repeated as many times as you like. When happy with the results, the OK button completes the process.
I've attached an image of the UI together with an example performed on the Horsehead.
I encourage people to download it and play with it and would love to hear comments from anyone using PixInsight (especially if there are any bugs!).
Thanks, Kevin
p.s. This not a tool for generating IOTD and APOD submissions!! :P
Great effort Kevin
I can't (or don't know how) to download the CubeHelix.js file from the Github site.
I can see it.
glend
30-03-2021, 11:26 AM
Dante's Inferno comes to mind. I am all for artist expression, but the purist will likely be revolted. Keep at it.
kosborn
30-03-2021, 11:38 AM
There is a green button on the Github page labeled 'Code'. This will download a zip archive of all the files including the script, readme and example images. If you just want the script you can click on the script file, highlight the contents and then copy and paste into a text editor such as the script editor in PixInsight. You can run the script from the PixInsight editor or save the script and use the 'Run script' menu option.
kosborn
30-03-2021, 11:42 AM
I'm not a fan of artistic expression in astro images and really don't like over saturated garish images. That's not what the script is for. It isn't about aesthetics (or revulsion) but instead is about visualisation (which is why I said it's not for IOTD or APOD). By changing the parameters it is easier to see the structure of faint areas of nebulosity or faint structure within galaxies for example. Have a look at http://www.mrao.cam.ac.uk/~dag/CUBEHELIX/. It might give an understanding of what I'm trying to do.
multiweb
30-03-2021, 11:53 AM
That's interesting. Thanks for the links. How can I download it? Within pixinsight distro?
PS: found it on github.
Added it but getting an error: "*** Error [001]: E:/Program Files/PixInsight/src/scripts/CubeHelix.js, line 43: ReferenceError: StdButton_ok is not defined"
kosborn
30-03-2021, 12:39 PM
Sorry about that. Should be fixed now. If you don't want to download and install again you can just edit line 43 from StdButton_ok to StdButton_Ok (i.e. upper case O).
multiweb
30-03-2021, 01:01 PM
Cool did that. :thumbsup:
I get another couple of errors when loading the script via the script menu.
1_ without any file opened: "*** Error [000]: E:/Program Files/PixInsight/src/scripts/CubeHelix.js, line 43: Error: MessageBox.MessageBox(): invalid argument type: String expected."
2_ with a file opened: "*** Error [001]: E:/Program Files/PixInsight/src/scripts/CubeHelix.js, line 192: ReferenceError: NumericControl is not defined"
kosborn
30-03-2021, 01:13 PM
Looks like I forgot to commit my latest edits last night but regardless, Line 43 in the github source reads:
var msg = new MessageBox("Source image view must be selected", StdIcon_Error, StdButton_Ok);
Did you accidentally add an extra 'MessageBox'?
Line 192 should work as is as NumericControl is part of the PixInsight Javascript engine. What platform/version of Pixinsight are you using?
multiweb
30-03-2021, 01:23 PM
no.
Here's what I've got
PI Standard Edition
Core version 1.8.8-7 Ripley (x64) (2020-12-17)
On Windows 7 ultimate 64bit
kosborn
30-03-2021, 01:46 PM
Sorry Marc,
I really should have double checked I'd committed all edits before posting! Latest version is on github now and I have tested it on current and previous version of PixInsight on Windows 10 and MacOS 10.15.7. Could you please download again from github, replacing the previous version and let me know how you go?
Thanks, Kevin
multiweb
30-03-2021, 02:03 PM
Sorry mate you still have a lowercase _ok in line 45. I edited it by still getting errors.
Maybe it's a Qt issue. I have version 5.15.2
kosborn
30-03-2021, 02:19 PM
No, embarrassingly it's a Kevin issue. In my defence it's the first time I've used github.
Line 45 should be :
var msg = new MessageBox("Source image view must be selected", "CubeHelix Error", StdIcon_Error, StdButton_Ok);
It's now correct on github. As it stands, the script expects an active image window to be open at the time it starts. It will use this active window as the source unless a different image is selected via the drop down. I will fix it tonight so that doesn't happen but in the meantime it should work....
multiweb
30-03-2021, 02:57 PM
Cool. The icon loads when no image is open now. :)
I still get the error in line 194 though about the NumericControl. Probably a UI thing which is why I thought Qt could be at fault. Win10 might be using something slightly different from the legacy Win7 stuff.
The CubeHelix RGB Image container opens on the screen before the script halts.
PS: forgot to add an include. It's working now. Will play with it. :thumbsup:
#include <pjsr/Sizer.jsh>
#include <pjsr/TextAlign.jsh>
#include <pjsr/UndoFlag.jsh>
#include <pjsr/FrameStyle.jsh>
#include <pjsr/StdIcon.jsh>
#include <pjsr/StdButton.jsh>
#include <pjsr/ColorSpace.jsh>
#include <pjsr/NumericControl.jsh>
kosborn
30-03-2021, 04:24 PM
Interesting, my Mac and PC versions work without that include file... Glad it's working now. I'd be interested to hear your comments and see some of your images.
multiweb
30-03-2021, 04:54 PM
I think Qt 15.5.3 might not need all the include files 15.5.2 uses. Also PI support for Win7 is not going to last much longer I reckon.
I had a play with a few files but haven't found the settings to get a good colour delineation over the dynamic range of the pics I tried. They're linear xisf files. It's a bit of trial an error because you can't preview and have to apply then close the script window to stretch the picture and see the result then do it again.
kosborn
30-03-2021, 05:03 PM
It doesn't work well with linear images. I will need to think about how to deal with that. The results seem to be quite good with stretched images though.
You should be able to adjust the parameters and then click 'apply' as many times as you like to see how changing parameters changes the image. 'Apply' will show changes in the preview image and changes in the colour scale without closing the dialog. You only need to click 'OK' when you are finished changing parameters and are happy with the result.
multiweb
30-03-2021, 05:09 PM
Makes sense. I'll apply the STF permanently then apply afterwards. :thumbsup:
PS: Yeah much easier this way :) Getting the same as yours. I'll play with the settings and other images.
vBulletin® v3.8.7, Copyright ©2000-2025, vBulletin Solutions, Inc.