Skip to content

get_region_indexget_region_indexGetRegionIndexGetRegionIndexget_region_indexget_region_index🔗

Short description🔗

get_region_indexget_region_indexGetRegionIndexGetRegionIndexget_region_indexget_region_index — Index of all regions containing a given pixel.

Signature🔗

get_region_index( region Regions, point.y Row, point.x Column, out integer Index )get_region_index( Regions : : Row, Column : Index )void GetRegionIndex( const HObject& Regions, const HTuple& Row, const HTuple& Column, HTuple* Index )static void HOperatorSet.GetRegionIndex( HObject regions, HTuple row, HTuple column, out HTuple index )def get_region_index( regions: HObject, row: int, column: int ) -> Sequence[int]

def get_region_index_s( regions: HObject, row: int, column: int ) -> intHerror get_region_index( const Hobject Regions, const Hlong Row, const Hlong Column, Hlong* Index )

Herror T_get_region_index( const Hobject Regions, const Htuple Row, const Htuple Column, Htuple* Index )

HTuple HRegion::GetRegionIndex( Hlong Row, Hlong Column ) const

HTuple HRegion.GetRegionIndex( int row, int column )

Description🔗

The operator get_region_indexGetRegionIndex returns the index of all regions in Regionsregionsregions (range of values: 1 to n) containing the test pixel (Rowrowrow,Columncolumncolumn), i.e.:

\[\begin{eqnarray*} |\textrm{Regions}[n] \cap \{(\textrm{Row},\textrm{Column})\}| \not= \emptyset \end{eqnarray*}\]

The returned indices can be used, e.g., in select_objSelectObj to select the regions containing the test pixel.

Attention🔗

If the regions overlap more than one region might contain the pixel. In this case all these regions are returned. If no region contains the indicated pixel the empty tuple (= no region) is returned.

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

Parameters🔗

Regionsregionsregions (input_object) region-array → objectobjectHObjectHRegionHObjectHobject

Regions to be examined.

Rowrowrow (input_control) point.y → (integer)(integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Line index of the test pixel.

Default: 100100
Value range: Row (lin)

Columncolumncolumn (input_control) point.x → (integer)(integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Column index of the test pixel.

Default: 100100
Value range: Column (lin)

Indexindexindex (output_control) integer(-array) → (integer)(integer)HTuple (Hlong)HTuple (int / long)Sequence[int]Htuple (Hlong)

Index of the regions containing the test pixel.

Complexity🔗

If \(F\) is the area of the region and \(N\) is the number of regions the mean runtime complexity is \(O(ln(\sqrt{F}) * N)\).

Result🔗

The operator get_region_indexGetRegionIndex returns the value 2 (H_MSG_TRUE) if the parameters are correct. The behavior in case of empty input (no input regions available) is set via the operator set_system('no_object_result',<Result>). If necessary an exception is raised.

Combinations with other operators🔗

Combinations

Possible predecessors

thresholdThreshold, regiongrowingRegiongrowing, connectionConnection

Alternatives

select_region_pointSelectRegionPoint

See also

get_mbuttonGetMbutton, get_mpositionGetMposition, test_region_pointTestRegionPoint

Module🔗

Foundation