Go Back   IceInSpace > Images > Deep Space
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Rate Thread
  #1  
Old 29-03-2021, 10:12 PM
kosborn's Avatar
kosborn (Kevin)
Registered User

kosborn is offline
 
Join Date: Mar 2018
Location: Canberra
Posts: 516
Pseudocolour mapping

I thought I'd add another post to continue the pseudocolour mapping discussion started by Peter in this post. 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 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!!
Attached Thumbnails
Click for full-size image (UI.png)
49.4 KB47 views
Click for full-size image (Horsehead_Ha.jpg)
41.4 KB59 views
Click for full-size image (Horsehead_CubeHelix.jpg)
49.8 KB74 views

Last edited by kosborn; 29-03-2021 at 11:05 PM.
Reply With Quote
  #2  
Old 30-03-2021, 11:08 AM
PKay's Avatar
PKay (Peter)
Registered User

PKay is offline
 
Join Date: May 2017
Location: DEPOT BEACH
Posts: 1,643
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.
Reply With Quote
  #3  
Old 30-03-2021, 11:26 AM
glend (Glen)
Registered User

glend is offline
 
Join Date: Jun 2013
Location: Lake Macquarie
Posts: 7,121
Dante's Inferno comes to mind. I am all for artist expression, but the purist will likely be revolted. Keep at it.
Reply With Quote
  #4  
Old 30-03-2021, 11:38 AM
kosborn's Avatar
kosborn (Kevin)
Registered User

kosborn is offline
 
Join Date: Mar 2018
Location: Canberra
Posts: 516
Quote:
Originally Posted by PKay View Post
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.
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.
Reply With Quote
  #5  
Old 30-03-2021, 11:42 AM
kosborn's Avatar
kosborn (Kevin)
Registered User

kosborn is offline
 
Join Date: Mar 2018
Location: Canberra
Posts: 516
Quote:
Originally Posted by glend View Post
Dante's Inferno comes to mind. I am all for artist expression, but the purist will likely be revolted. Keep at it.
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.
Reply With Quote
  #6  
Old 30-03-2021, 11:53 AM
multiweb's Avatar
multiweb (Marc)
ze frogginator

multiweb is offline
 
Join Date: Oct 2007
Location: Sydney
Posts: 22,080
Quote:
Originally Posted by kosborn View Post
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.
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"

Last edited by multiweb; 30-03-2021 at 12:18 PM.
Reply With Quote
  #7  
Old 30-03-2021, 12:39 PM
kosborn's Avatar
kosborn (Kevin)
Registered User

kosborn is offline
 
Join Date: Mar 2018
Location: Canberra
Posts: 516
Quote:
Originally Posted by multiweb View Post
Added it but getting an error: "*** Error [001]: E:/Program Files/PixInsight/src/scripts/CubeHelix.js, line 43: ReferenceError: StdButton_ok is not defined"
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).
Reply With Quote
  #8  
Old 30-03-2021, 01:01 PM
multiweb's Avatar
multiweb (Marc)
ze frogginator

multiweb is offline
 
Join Date: Oct 2007
Location: Sydney
Posts: 22,080
Quote:
Originally Posted by kosborn View Post
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).
Cool did that.

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"
Reply With Quote
  #9  
Old 30-03-2021, 01:13 PM
kosborn's Avatar
kosborn (Kevin)
Registered User

kosborn is offline
 
Join Date: Mar 2018
Location: Canberra
Posts: 516
Quote:
Originally Posted by multiweb View Post
Cool did that.

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"
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?
Reply With Quote
  #10  
Old 30-03-2021, 01:23 PM
multiweb's Avatar
multiweb (Marc)
ze frogginator

multiweb is offline
 
Join Date: Oct 2007
Location: Sydney
Posts: 22,080
Quote:
Originally Posted by kosborn View Post
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'?
no.

Quote:
if (this.sourceView.isNull) {
var msg = new MessageBox("Source image view must be selected", StdIcon_Error, StdButton_Ok);
console.hide();
msg.execute();
throw new Error("Source image must be selected.");
}
Quote:
Originally Posted by kosborn View Post
Line 192 should work as is as NumericControl is part of the PixInsight Javascript engine. What platform/version of Pixinsight are you using?
Here's what I've got

Quote:
...

this.controlSizer = new VerticalSizer;
this.controlSizer.margin = 6;
this.controlSizer.spacing = 4;

this.startColour = new NumericControl(this);
this.startColour.label.text = "Start Colour:";
this.startColour.label.minWidth = sliderMinWidth;

...
PI Standard Edition
Core version 1.8.8-7 Ripley (x64) (2020-12-17)
On Windows 7 ultimate 64bit
Reply With Quote
  #11  
Old 30-03-2021, 01:46 PM
kosborn's Avatar
kosborn (Kevin)
Registered User

kosborn is offline
 
Join Date: Mar 2018
Location: Canberra
Posts: 516
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

Last edited by kosborn; 30-03-2021 at 01:57 PM.
Reply With Quote
  #12  
Old 30-03-2021, 02:03 PM
multiweb's Avatar
multiweb (Marc)
ze frogginator

multiweb is offline
 
Join Date: Oct 2007
Location: Sydney
Posts: 22,080
Quote:
Originally Posted by kosborn View Post
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
Sorry mate you still have a lowercase _ok in line 45. I edited it by still getting errors.

Quote:
run --execute-mode=auto "E:/Program Files/PixInsight/src/scripts/CubeHelix.js"

Processing script file: E:/Program Files/PixInsight/src/scripts/CubeHelix.js
*** Error [000]: E:/Program Files/PixInsight/src/scripts/CubeHelix.js, line 45: Error: MessageBox.MessageBox(): invalid argument type: String expected.

Reading image:
S:/WIRUNA/20200320/NGC3372/IR/masters/integration.xisf
Loading image: w=3336 h=2496 n=1 Gray Float32
9 image properties
235 FITS keyword(s) extracted.

run --execute-mode=auto "E:/Program Files/PixInsight/src/scripts/CubeHelix.js"

Processing script file: E:/Program Files/PixInsight/src/scripts/CubeHelix.js
*** Error [001]: E:/Program Files/PixInsight/src/scripts/CubeHelix.js, line 194: ReferenceError: NumericControl is not defined
Maybe it's a Qt issue. I have version 5.15.2
Reply With Quote
  #13  
Old 30-03-2021, 02:19 PM
kosborn's Avatar
kosborn (Kevin)
Registered User

kosborn is offline
 
Join Date: Mar 2018
Location: Canberra
Posts: 516
Quote:
Originally Posted by multiweb View Post
Maybe it's a Qt issue. I have version 5.15.2
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....
Reply With Quote
  #14  
Old 30-03-2021, 02:57 PM
multiweb's Avatar
multiweb (Marc)
ze frogginator

multiweb is offline
 
Join Date: Oct 2007
Location: Sydney
Posts: 22,080
Quote:
Originally Posted by kosborn View Post
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....
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.

#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>
Attached Thumbnails
Click for full-size image (box.gif)
38.3 KB27 views

Last edited by multiweb; 30-03-2021 at 03:45 PM.
Reply With Quote
  #15  
Old 30-03-2021, 04:24 PM
kosborn's Avatar
kosborn (Kevin)
Registered User

kosborn is offline
 
Join Date: Mar 2018
Location: Canberra
Posts: 516
Quote:
Originally Posted by multiweb View Post
PS: forgot to add an include. It's working now. Will play with it.
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.
Reply With Quote
  #16  
Old 30-03-2021, 04:54 PM
multiweb's Avatar
multiweb (Marc)
ze frogginator

multiweb is offline
 
Join Date: Oct 2007
Location: Sydney
Posts: 22,080
Quote:
Originally Posted by kosborn View Post
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.
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.
Reply With Quote
  #17  
Old 30-03-2021, 05:03 PM
kosborn's Avatar
kosborn (Kevin)
Registered User

kosborn is offline
 
Join Date: Mar 2018
Location: Canberra
Posts: 516
Quote:
Originally Posted by multiweb View Post
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.
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.
Reply With Quote
  #18  
Old 30-03-2021, 05:09 PM
multiweb's Avatar
multiweb (Marc)
ze frogginator

multiweb is offline
 
Join Date: Oct 2007
Location: Sydney
Posts: 22,080
Quote:
Originally Posted by kosborn View Post
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.
Makes sense. I'll apply the STF permanently then apply afterwards.

PS: Yeah much easier this way Getting the same as yours. I'll play with the settings and other images.
Attached Thumbnails
Click for full-size image (hh.jpg)
190.5 KB38 views
Reply With Quote
Reply

Bookmarks


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +10. The time is now 09:05 AM.

Powered by vBulletin Version 3.8.7 | Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Advertisement
Bintel
Advertisement
Astrophotography Prize
Advertisement