Author Topic: PJSR Morphological Transformation Parameters  (Read 3899 times)

Offline dave_galera

  • PixInsight Addict
  • ***
  • Posts: 261
    • QDigital Astro
PJSR Morphological Transformation Parameters
« on: 2014 December 02 08:58:00 »
I am trying to set the structure element for the Morph Trans and its not listed in the object Explorer, I have tried all combinations I can think of, i.e. structureElement = CircularStructure etc.

Does any body know what the correct one is.

Regards,
    Dave

Dave

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: PJSR Morphological Transformation Parameters
« Reply #1 on: 2014 December 02 13:31:46 »
Hi Dave,

It is the MorphologicalTransformation.structureWayTable property. See for example:

var P = new MorphologicalTransformation;
P.operator = MorphologicalTransformation.prototype.Erosion;
P.interlacingDistance = 1;
P.lowThreshold = 0.000000;
P.highThreshold = 0.000000;
P.numberOfIterations = 1;
P.amount = 1.00;
P.selectionPoint = 0.50;
P.structureName = "";
P.structureSize = 3;
P.structureWayTable = [ // mask
   [[
      0x01,0x01,0x01,
      0x01,0x01,0x01,
      0x01,0x01,0x01
   ]]
];


Elements of structureWayTable can be one or zero. Another example with a 3-way median filter:

var P = new MorphologicalTransformation;
P.operator = MorphologicalTransformation.prototype.Median;
P.interlacingDistance = 1;
P.lowThreshold = 0.000000;
P.highThreshold = 0.000000;
P.numberOfIterations = 2;
P.amount = 1.00;
P.selectionPoint = 0.50;
P.structureName = "5x5 Three-Way Structure";
P.structureSize = 5;
P.structureWayTable = [ // mask
   [[
      0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x01,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00
   ]],
   [[
      0x00,0x00,0x01,0x00,0x00,
      0x00,0x00,0x01,0x00,0x00,
      0x01,0x01,0x00,0x01,0x01,
      0x00,0x00,0x01,0x00,0x00,
      0x00,0x00,0x01,0x00,0x00
   ]],
   [[
      0x01,0x00,0x00,0x00,0x01,
      0x00,0x01,0x00,0x01,0x00,
      0x00,0x00,0x00,0x00,0x00,
      0x00,0x01,0x00,0x01,0x00,
      0x01,0x00,0x00,0x00,0x01
   ]]
];
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline dave_galera

  • PixInsight Addict
  • ***
  • Posts: 261
    • QDigital Astro
Re: PJSR Morphological Transformation Parameters
« Reply #2 on: 2014 December 03 04:10:16 »
Thanks again Juan, will get the hang of it eventually...its just a steep learning curve.

Regards,
       Dave
Dave