Skip to content

Commit

Permalink
Add method Spot.isLabelSet()
Browse files Browse the repository at this point in the history
When analyzing a Mastodon dataset the ability to know for which spots the user
specified a label can be very helpful.

This makes it easier, for example, to implement Mastodon plugins that
automatically derive a name for spots whose label has not been manually set.
  • Loading branch information
maarzt authored and tinevez committed Jul 3, 2024
1 parent 8aa46bb commit 8dfaecd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/java/org/mastodon/mamut/model/Spot.java
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public double getBoundingSphereRadiusSquared()
@Override
public String getLabel()
{
if ( pool.label.isSet( this ) )
if ( isLabelSet() )
return pool.label.get( this );
else
return Integer.toString( getInternalPoolIndex() );
Expand All @@ -179,6 +179,11 @@ public void setLabel( final String label )
pool.label.set( this, label );
}

public boolean isLabelSet()
{
return pool.label.isSet( this );
}

@Override
public String toString()
{
Expand Down

0 comments on commit 8dfaecd

Please sign in to comment.