+
    'k—  ã                   óÀ   € R t ^ RIt^ RIt^RIHt ]P                  ! ]! R4       U u. uF  q P                  4       NK  	  up ]P                  R7      t
RR/R ltR# u up i )zKReversible cross-plane mask overlap links; no identity or track assertions.N)Úmask_digesté   )ÚdtypeÚiou_thresholdg      à?c               ó¢  € \        V\        4      '       gJ   \        V\        \        34      '       d.   \        P
                  ! V4      '       d   ^ Tu;8  d   ^8:  g   M \        R4      h. p. p\        4       pRp\        V 4       EF¨  w  rg\        V\        4      '       g   \        R4      hVP                  R4      VP                  R4      VP                  R4      r©p\        V\        4      '       d)   V'       d!   W„9   g   \        V	4      \        Jg   V	^ 8  d   \        R4      h\        V
\        P                  4      '       d1   V
P                  ^8w  g    V
P                   \        P"                  8w  d   \        R4      hVf   V
P$                  pV
P$                  V8w  d   \        R	4      hVP'                  V4       VP)                  RVRV	R
VR\        V
P+                  4       4      R\-        V
4      /4       VP)                  \        P.                  ! V
P1                  4       4      4       EK«  	  . p\        V4       EFS  w  rÍ\3        V^,           \5        V4      4       EF,  pW.,          p\7        VR,          VR,          ,
          4      ^8w  d   K3  VR,          VR,          ppV'       d+   V'       d#   \9        VV4      \;        VV4      ,          V8  d   Ky  \        \<        \        P>                  ! W<,          W>,          4      ,          P+                  4       4      pVVV,           V,
          ,          pVV8¼  g   KÞ  VR,          VR,          8  d   Wß3MWý3w  ppVP)                  RVR,          RVR,          RVR,          RVRR/4       EK/  	  EKV  	  VPA                  R R7       RRRVe   \C        V4      MRR\        V4      RVRVRR/# )aŽ  Return all adjacent-plane overlap links while preserving candidate identity.

``candidates`` is an ordered iterable of dictionaries containing a unique
nonempty string ``id``, nonnegative integer ``z`` and a 2-D boolean ``mask``.
All masks must share a coordinate frame and shape; no registration is
estimated or applied here. Each output node retains its source index, exact
mask digest, and plane. Each edge means only that the two masks overlap by
at least the threshold. No candidates are merged, discarded, or classified.
Empty masks remain nodes and have no edges. Other metadata and full masks
should be retained in the caller's original archive.
z*iou_threshold must be finite and in (0, 1]Nzcandidate must be a dictionaryÚidÚzÚmaskz9candidate needs a unique id and nonnegative integer planez*candidate mask must be a 2-D boolean arrayz7candidate masks must share a coordinate frame and shapeÚsource_indexÚareaÚmask_sha256ÚaÚbÚlower_planeÚiouÚ	semanticsÚ&possible_overlap_not_specimen_identityc                 ó6   € V R ,          V R,          V R,          3# )r   r   r   © )Úedges   &ÚI/home/mchadwick/src/ansp/diatom-research/diatom_pilot/crossplane_links.pyÚ<lambda>Ú&build_possible_links.<locals>.<lambda>9   s   €   mÕ!4°d¸3µiÀÀcÅÑ Kó    )ÚkeyÚformatzdiatom-crossplane-links-v1Ú
mask_shaper   Ú
candidatesÚpossible_linksÚwarningz¡Links indicate geometric overlap only. Candidates, including identical or empty masks, remain separate; registration and biological identity are not established.)"Ú
isinstanceÚboolÚintÚfloatÚmathÚisfiniteÚ
ValueErrorÚsetÚ	enumerateÚdictÚgetÚstrÚtypeÚnpÚndarrayÚndimr   Úbool_ÚshapeÚaddÚappendÚsumr   ÚpackbitsÚravelÚrangeÚlenÚabsÚminÚmaxÚ	_BITCOUNTÚbitwise_andÚsortÚlist)r   r   ÚnodesÚpacksÚidsr1   ÚindexÚ	candidateÚidentÚplaner	   ÚedgesÚir   Újr   ÚaaÚbbÚinterÚscoreÚloÚhis   &$                    r   Úbuild_possible_linksrP   	   s(  € ô �-¤×&Ò&¬j¸ÌÌeÈ×.UÒ.UÔ]a×]jÒ]jÐkx×]yÒ]yð  BCð  FSö  BXð  WXö  BXÜÐEÓFÐFØ€EØ€EÜ
‹%€CØ€EÜ% j×1ÑˆÜ˜)¤T×*Ò*ÜÐ=Ó>Ð>Ø&Ÿ]™]¨4Ó0°)·-±-ÀÓ2DÀiÇmÁmÐTZÓF[�dˆÜ˜%¤×%Ò%¯U°e´lÄdÈ5ÃkÔY\ÓF\Ð`eÐhiÔ`iÜÐXÓYÐYÜ˜$¤§
¡
×+Ò+¨t¯y©y¸A¬~ÀÇÁÌrÏxÉxÔAWÜÐIÓJÐJØŠ=Ø—J‘JˆEØ�:‰:˜ÔÜÐVÓWÐWØ�‰�ŒØ�‰�d˜E 3¨¨~¸uÀfÌcÐRV×RZÑRZÓR\ËoÐ_lÔnyÐz~Ónð  Aô  	BØ�‰”R—[’[ §¡£Ó.×/ñ 2ð €EÜ˜%× ‰ˆÜ�q˜1•uœc %›j×)ˆAØ•ˆAÜ�1�S•6˜A˜c�F•?Ó# qÔ(ÙØ�v•Y  &¥	�ˆBßŸR¤3 r¨2£;´°R¸³Õ#<¸}Ô#LÙÜœ	¤"§.¢.°µ¸5½8Ó"DÕE×IÑIÓKÓLˆEØ˜R "�W u�_Õ-ˆEØ˜Ö%Ø#$ S¥6¨A¨c­F¤?˜!™¸¸‘��BØ—‘˜c 2 d¥8¨S°"°Tµ(¸MÈ2ÈcÍ7ÐTYÐ[`Ø)Ð+SðU÷ Vô *ñ !ð 
‡J�JÑK€JÔLØÐ2°LÐQVÒQbÄ$ÀuÄ+ÐhlØœU =Ó1°<ÀÐHXÐZ_Øð  {ð|ð |r   )Ú__doc__r$   Únumpyr-   Úproposal_graphr   Úasarrayr7   Ú	bit_countÚuint8r<   rP   )rH   s   0r   Ú<module>rW      sO   ðÙ QÛ Û Ý 'à�JŠJ©u°S¬zÓ:©z¨!Ÿ™ž©zÑ:À"Ç(Á(ÔK€	ð3|°cö 3|ùò ;s   §A