Author Topic: Get the Image object created by ImageIntegration  (Read 1437 times)

Offline carl

  • Newcomer
  • Posts: 20
    • View Profile
Get the Image object created by ImageIntegration
« on: 2018 October 16 16:59:52 »
Hi folks,

I'm using JavaScript to automate a batch process I'm running on SDSS data. I can get the ImageIntegration to run correctly and access the activeWindow. But I can't figure out how to do the following:

  • Access the Image object created by ImageIntegration
  • Save the file in FITS without a thumbnail
  • Execute ScreenTransferFunction (boosted)

I've checked what docs I can find and also other codes in the GitHub repo but nothing seems to fit the bill here.

Code: [Select]
var II = new ImageIntegration;
// blah
var ok = II.executeGlobal();

var window = ImageWindow.activeWindow;
window.saveAs( strDir + target[i] + "-gri.xisf", false, false, false, false); // change this to FITS without a thumbnail
// Do other stuff with it

Thanks,
C.

Offline carl

  • Newcomer
  • Posts: 20
    • View Profile
Re: Get the Image object created by ImageIntegration
« Reply #1 on: 2018 October 16 17:23:21 »
Thinking a little further on this, is it possible to execute a ProcessContainer from JavaScript? That way I might be able to wire up some of the processes in there and execute it from the script. I would need to know how to access the resultant image at the end however to save it, etc.

Thanks

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 6719
    • View Profile
    • http://pixinsight.com/
Re: Get the Image object created by ImageIntegration
« Reply #2 on: 2018 October 17 06:49:41 »
Hi Carl,

Quote
Access the Image object created by ImageIntegration

Use the following property of ImageIntegration:

   String ImageIntegration.integrationImageId

For example:

var II = new ImageIntegration;
// blah
var ok = II.executeGlobal();
if ( ok )
{
   var window = ImageWindow.windowById( II.integrationImageId );
   ...
}


Quote
Save the file in FITS without a thumbnail

The FITS format support module does not have format hints to disable generation of thumbnail images, so you cannot prevent their inclusion programmatically. You have to disable thumbnails on the FITS Format Preferences dialog. To open this dialog, open the Format Explorer window and double click the FITS item on the left panel.

Quote
is it possible to execute a ProcessContainer from JavaScript?

Of course, just as any object derived from ProcessInstance, that is, by calling executeGlobal() or executeOn(), as required.

However, in most cases a ProcessContainer does not make too much sense from a script. You can apply a list of process instances sequentially, and you have more flexibility and control this way.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline carl

  • Newcomer
  • Posts: 20
    • View Profile
Re: Get the Image object created by ImageIntegration
« Reply #3 on: 2018 October 17 17:39:48 »
Thanks Juan. That worked a treat.

How do I then use that window object to execute other processes on it? I need to do a ScreenTransferFunction, convolution, etc.

Thx heaps,
C.


Offline carl

  • Newcomer
  • Posts: 20
    • View Profile
Re: Get the Image object created by ImageIntegration
« Reply #4 on: 2018 October 21 19:45:49 »
Any ideas on this aspect?

How do I then use that window object to execute other processes on it? I need to do a ScreenTransferFunction, convolution, etc.

Thanks!