superdsm.atoms
- class superdsm.atoms.AtomAdjacencyGraph(atoms, clusters, fg_mask, seeds, status=None)
Bases:
objectGraph representation of the adjacencies of atomic image regions.
This corresponds to the adjacency graph \(\mathcal G\) as defined in Coarse-to-fine region analysis.
- Parameters:
atoms – Integer-valued image representing the universe of atomic image regions. Each atomic image region has a unique label, which is the integer value.
clusters – Integer-valued image representing the regions of possibly clustered obejcts. Each region has a unique label, which is the integer value.
fg_mask – Binary image corresponding to a rough representation of the image foreground. This means that an image point \(x \in \Omega\) is True if \(Y_\omega|_{\omega=\{x\}} > 0\) and False otherwise.
seeds – The seed points which were used to determine the atomic image regions, represented by a list of tuples of coordinates. The The SuperDSM pipeline only uses these for rendering the adjacency graph (see the
get_edge_lines()method).status – A
repype.status.Statusobject or None if no output should be produced.
Traceback (most recent call last): File "<input>", line 1, in <module> File "/home/docs/checkouts/readthedocs.org/user_builds/superdsm/checkouts/develop/superdsm/atoms.py", line 80, in __init__ repype.status.update(status, 'Processed atom %d / %d' % (l0, atoms.max()), intermediate=True) File "/home/docs/checkouts/readthedocs.org/user_builds/superdsm/envs/develop/lib/python3.11/site-packages/repype/status.py", line 651, in update status.intermediate(dict(**kwargs) if kwargs else plain_text) ^^^^^^^^^^^^^^^^^^^ AttributeError: 'str' object has no attribute 'intermediate' Traceback (most recent call last): File "<input>", line 1, in <module> NameError: name 'adj' is not defined Traceback (most recent call last): File "<input>", line 1, in <module> NameError: name 'adj' is not defined Traceback (most recent call last): File "<input>", line 1, in <module> NameError: name 'adj' is not defined Traceback (most recent call last): File "<input>", line 1, in <module> NameError: name 'adj' is not defined
- property atom_labels
The set of labels of all atomic image regions.
Traceback (most recent call last): File "<input>", line 1, in <module> File "/home/docs/checkouts/readthedocs.org/user_builds/superdsm/checkouts/develop/superdsm/atoms.py", line 80, in __init__ repype.status.update(status, 'Processed atom %d / %d' % (l0, atoms.max()), intermediate=True) File "/home/docs/checkouts/readthedocs.org/user_builds/superdsm/envs/develop/lib/python3.11/site-packages/repype/status.py", line 651, in update status.intermediate(dict(**kwargs) if kwargs else plain_text) ^^^^^^^^^^^^^^^^^^^ AttributeError: 'str' object has no attribute 'intermediate' Traceback (most recent call last): File "<input>", line 1, in <module> NameError: name 'adj' is not defined
- property cluster_labels
The set of labels of all regions of possibly clustered objects.
Traceback (most recent call last): File "<input>", line 1, in <module> File "/home/docs/checkouts/readthedocs.org/user_builds/superdsm/checkouts/develop/superdsm/atoms.py", line 80, in __init__ repype.status.update(status, 'Processed atom %d / %d' % (l0, atoms.max()), intermediate=True) File "/home/docs/checkouts/readthedocs.org/user_builds/superdsm/envs/develop/lib/python3.11/site-packages/repype/status.py", line 651, in update status.intermediate(dict(**kwargs) if kwargs else plain_text) ^^^^^^^^^^^^^^^^^^^ AttributeError: 'str' object has no attribute 'intermediate' Traceback (most recent call last): File "<input>", line 1, in <module> NameError: name 'adj' is not defined
- get_atom_degree(atom_label)
Returns the number of adjacent atomic image regions.
Traceback (most recent call last): File "<input>", line 1, in <module> File "/home/docs/checkouts/readthedocs.org/user_builds/superdsm/checkouts/develop/superdsm/atoms.py", line 80, in __init__ repype.status.update(status, 'Processed atom %d / %d' % (l0, atoms.max()), intermediate=True) File "/home/docs/checkouts/readthedocs.org/user_builds/superdsm/envs/develop/lib/python3.11/site-packages/repype/status.py", line 651, in update status.intermediate(dict(**kwargs) if kwargs else plain_text) ^^^^^^^^^^^^^^^^^^^ AttributeError: 'str' object has no attribute 'intermediate' Traceback (most recent call last): File "<input>", line 1, in <module> NameError: name 'adj' is not defined Traceback (most recent call last): File "<input>", line 1, in <module> NameError: name 'adj' is not defined Traceback (most recent call last): File "<input>", line 1, in <module> NameError: name 'adj' is not defined Traceback (most recent call last): File "<input>", line 1, in <module> NameError: name 'adj' is not defined
- get_atoms_in_cluster(cluster_label)
Returns the set of labels of all atomic image regions, which are part of a region of possibly clustered objects.
Traceback (most recent call last): File "<input>", line 1, in <module> File "/home/docs/checkouts/readthedocs.org/user_builds/superdsm/checkouts/develop/superdsm/atoms.py", line 80, in __init__ repype.status.update(status, 'Processed atom %d / %d' % (l0, atoms.max()), intermediate=True) File "/home/docs/checkouts/readthedocs.org/user_builds/superdsm/envs/develop/lib/python3.11/site-packages/repype/status.py", line 651, in update status.intermediate(dict(**kwargs) if kwargs else plain_text) ^^^^^^^^^^^^^^^^^^^ AttributeError: 'str' object has no attribute 'intermediate' Traceback (most recent call last): File "<input>", line 1, in <module> NameError: name 'adj' is not defined Traceback (most recent call last): File "<input>", line 1, in <module> NameError: name 'adj' is not defined
- get_cluster_label(atom_label)
Returns the label of the region of possibly clustered objects, which an atomic image region is a part of.
Traceback (most recent call last): File "<input>", line 1, in <module> File "/home/docs/checkouts/readthedocs.org/user_builds/superdsm/checkouts/develop/superdsm/atoms.py", line 80, in __init__ repype.status.update(status, 'Processed atom %d / %d' % (l0, atoms.max()), intermediate=True) File "/home/docs/checkouts/readthedocs.org/user_builds/superdsm/envs/develop/lib/python3.11/site-packages/repype/status.py", line 651, in update status.intermediate(dict(**kwargs) if kwargs else plain_text) ^^^^^^^^^^^^^^^^^^^ AttributeError: 'str' object has no attribute 'intermediate' Traceback (most recent call last): File "<input>", line 1, in <module> NameError: name 'adj' is not defined Traceback (most recent call last): File "<input>", line 1, in <module> NameError: name 'adj' is not defined Traceback (most recent call last): File "<input>", line 1, in <module> NameError: name 'adj' is not defined Traceback (most recent call last): File "<input>", line 1, in <module> NameError: name 'adj' is not defined
- get_edge_lines(accept='all', reduce=True)
Returns a list of lines corresponding to the edges of the graph.
- Parameters:
accept – Must be either
allor a callable. Ifallis used, all edges of the graph are included. Otherwise, an edge(i,j)is included only ifaccept(i)andaccept(j)evaluate to True, whereiandjare the labels of two adjacent atomic image regions.reduce – If True, then an edge
(i,j)is included only ifi > j. Otherwise, both edges(i,j)and(j,i)are included.
Each line is a tuple of two seed points, and each seed point is a tuple of coordinates.
Traceback (most recent call last): File "<input>", line 1, in <module> File "/home/docs/checkouts/readthedocs.org/user_builds/superdsm/checkouts/develop/superdsm/atoms.py", line 80, in __init__ repype.status.update(status, 'Processed atom %d / %d' % (l0, atoms.max()), intermediate=True) File "/home/docs/checkouts/readthedocs.org/user_builds/superdsm/envs/develop/lib/python3.11/site-packages/repype/status.py", line 651, in update status.intermediate(dict(**kwargs) if kwargs else plain_text) ^^^^^^^^^^^^^^^^^^^ AttributeError: 'str' object has no attribute 'intermediate' Traceback (most recent call last): File "<input>", line 1, in <module> NameError: name 'adj' is not defined Traceback (most recent call last): File "<input>", line 1, in <module> NameError: name 'adj' is not defined Traceback (most recent call last): File "<input>", line 1, in <module> NameError: name 'adj' is not defined
- get_seed(atom_label)
Returns the seed point which was used to determine an atomic image region.
- Returns:
Tuple of the coordinates of the seed point.
Traceback (most recent call last): File "<input>", line 1, in <module> File "/home/docs/checkouts/readthedocs.org/user_builds/superdsm/checkouts/develop/superdsm/atoms.py", line 80, in __init__ repype.status.update(status, 'Processed atom %d / %d' % (l0, atoms.max()), intermediate=True) File "/home/docs/checkouts/readthedocs.org/user_builds/superdsm/envs/develop/lib/python3.11/site-packages/repype/status.py", line 651, in update status.intermediate(dict(**kwargs) if kwargs else plain_text) ^^^^^^^^^^^^^^^^^^^ AttributeError: 'str' object has no attribute 'intermediate' Traceback (most recent call last): File "<input>", line 1, in <module> NameError: name 'adj' is not defined Traceback (most recent call last): File "<input>", line 1, in <module> NameError: name 'adj' is not defined Traceback (most recent call last): File "<input>", line 1, in <module> NameError: name 'adj' is not defined Traceback (most recent call last): File "<input>", line 1, in <module> NameError: name 'adj' is not defined
- property max_degree
The maximum degree of the graph.
Traceback (most recent call last): File "<input>", line 1, in <module> File "/home/docs/checkouts/readthedocs.org/user_builds/superdsm/checkouts/develop/superdsm/atoms.py", line 80, in __init__ repype.status.update(status, 'Processed atom %d / %d' % (l0, atoms.max()), intermediate=True) File "/home/docs/checkouts/readthedocs.org/user_builds/superdsm/envs/develop/lib/python3.11/site-packages/repype/status.py", line 651, in update status.intermediate(dict(**kwargs) if kwargs else plain_text) ^^^^^^^^^^^^^^^^^^^ AttributeError: 'str' object has no attribute 'intermediate' Traceback (most recent call last): File "<input>", line 1, in <module> NameError: name 'adj' is not defined