Author Topic: Pixel Math and Masked Images  (Read 8206 times)

Offline Jack Harvey

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 975
    • PegasusAstronomy.com & Starshadows.com
Pixel Math and Masked Images
« on: 2010 February 08 16:39:35 »
What happens when you combine two images in Pixel Math and one of the images has some data masked?  Is the masked data excluded from the combine, or is the mask ignored?
Jack Harvey, PTeam Member
Team Leader, SSRO/PROMPT Imaging Team, CTIO

Offline NKV

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 677
Re: Pixel Math and Masked Images
« Reply #1 on: 2010 February 08 20:19:42 »
PixelMath ignoring masks on sources. But result applied via mask if destination's image have a mask.

Offline Niall Saunders

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1456
  • We have cookies? Where ?
Re: Pixel Math and Masked Images
« Reply #2 on: 2010 February 09 00:00:11 »
I think that is the standard approach made by Juan in all cases - masks are only applicable to a 'destination' image.

Perhaps Juan will get a chance to confirm this.

Cheers,
Cheers,
Niall Saunders
Clinterty Observatories
Aberdeen, UK

Altair Astro GSO 10" f/8 Ritchey Chrétien CF OTA on EQ8 mount with homebrew 3D Balance and Pier
Moonfish ED80 APO & Celestron Omni XLT 120
QHY10 CCD & QHY5L-II Colour
9mm TS-OAG and Meade DSI-IIC

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: Pixel Math and Masked Images
« Reply #3 on: 2010 February 09 00:38:59 »
Nikolay has described it accurately. As Niall has pointed out, in general masks are transparent to processes in PixInsight. This means that a process does not care about its target image's mask. The core application filters a process' result through a mask, if there is one active and enabled, after process execution. This is coherent with PixInsight's object-oriented, modular architecture and design: processes and images are independent objects. From the user's perspective, by separating process execution from masking we gain in modularity and hence in reusability (the same process instance can be applied through a different mask) and versatility (it is much easier to compare the result of a process with and without a given mask if process execution and masking are separate, unrelated procedures).

In the case of PixelMath, you can use the target image's mask with the $M (or $mask) metasymbol. For example, the following expression:

$T*$M

will multiply the target image by its current mask, or will yield a runtime error if there's no mask selected for the target image. Note that if the mask is currently enabled, the result of the above expression will also be masked. If the mask is disabled, the result will be the plain multiplication (possibly rescaled if the rescale result PixelMath option is enabled).
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Jack Harvey

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 975
    • PegasusAstronomy.com & Starshadows.com
Re: Pixel Math and Masked Images
« Reply #4 on: 2010 February 09 06:21:48 »
Got it, thanks guys!
Jack Harvey, PTeam Member
Team Leader, SSRO/PROMPT Imaging Team, CTIO

Offline Dimitris Platis

  • PixInsight Addict
  • ***
  • Posts: 181
Re: Pixel Math and Masked Images
« Reply #5 on: 2013 May 22 10:55:10 »
Suppose u want to multiply the target ($T) with the inverted mask and not the normal mask.
How do u formulate that in Pixel math?

Offline Carlos Milovic

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2172
  • Join the dark side... we have cookies
    • http://www.astrophoto.cl
Re: Pixel Math and Masked Images
« Reply #6 on: 2013 May 22 12:50:16 »
$T*(~$M)
Regards,

Carlos Milovic F.
--------------------------------
PixInsight Project Developer
http://www.pixinsight.com