Skip to content

Commit

Permalink
Rename class DetectOverlappingSpots -> CreateConflictTagSet
Browse files Browse the repository at this point in the history
  • Loading branch information
maarzt committed Jun 25, 2024
1 parent c7b042e commit ac1c312
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
import org.mastodon.mamut.tomancak.merging.MergeDatasets;
import org.mastodon.mamut.tomancak.merging.MergingDialog;
import org.mastodon.mamut.tomancak.resolve.AverageSpots;
import org.mastodon.mamut.tomancak.resolve.DetectOverlappingSpotsView;
import org.mastodon.mamut.tomancak.resolve.CreateConflictTagSetCommand;
import org.mastodon.mamut.tomancak.resolve.LocateTagsFrame;
import org.mastodon.mamut.tomancak.sort_tree.FlipDescendants;
import org.mastodon.mamut.tomancak.sort_tree.SortTree;
Expand Down Expand Up @@ -512,7 +512,7 @@ private void mirrorSpots()

private void createConflictTagSet()
{
DetectOverlappingSpotsView.run( pluginAppModel );
CreateConflictTagSetCommand.run( pluginAppModel );
}

private void combineSelectedSpots()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import gnu.trove.set.TIntSet;
import gnu.trove.set.hash.TIntHashSet;

public class DetectOverlappingSpots
public class CreateConflictTagSet
{
public static void run( final Model model, final String tagSetName, final double threshold )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import org.scijava.plugin.Plugin;

@Plugin( type = Command.class, name = "Create Conflict Tag Set" )
public class DetectOverlappingSpotsView extends DefaultCancelable implements Command
public class CreateConflictTagSetCommand extends DefaultCancelable implements Command
{
/**
* Only spheres that strongly overlap are considered to be in conflict.
Expand Down Expand Up @@ -42,15 +42,15 @@ public class DetectOverlappingSpotsView extends DefaultCancelable implements Com
public static void run( final ProjectModel projectModel )
{
final CommandService cmd = projectModel.getContext().service( CommandService.class );
cmd.run( DetectOverlappingSpotsView.class, true, "projectModel", projectModel );
cmd.run( CreateConflictTagSetCommand.class, true, "projectModel", projectModel );
}

@Override
public void run()
{
final double threshold = getThreshold();
final String tagSetName = String.format( "Conflicting Spots (threshold=%1.2f)", threshold );
DetectOverlappingSpots.run( projectModel.getModel(), tagSetName, threshold );
CreateConflictTagSet.run( projectModel.getModel(), tagSetName, threshold );
}

private double getThreshold()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import org.mastodon.mamut.model.Spot;
import org.mastodon.util.TagHelper;

public class DetectOverlappingSpotsTest
public class CreateConflictTagSetTest
{
@Test
public void test()
Expand All @@ -17,7 +17,7 @@ public void test()
addShortTack( model, 1, 2, 3, 1.1, 2.1, 3.1 );
addShortTack( model, 5, 3, 4, 5.1, 3.1, 4.1 );
addShortTack( model, 5, 3.2, 4, 5.1, 3.2, 4.1 );
DetectOverlappingSpots.run( model, "Conflicting Spots", 0.4 );
CreateConflictTagSet.run( model, "Conflicting Spots", 0.4 );
assertEquals( 2, new TagHelper( model, "Conflicting Spots", "Conflict 0 (a)" ).getTaggedSpots().size() );
assertEquals( 2, new TagHelper( model, "Conflicting Spots", "Conflict 0 (b)" ).getTaggedSpots().size() );
}
Expand All @@ -33,16 +33,16 @@ private void addShortTack( final Model model, final double x1, final double y1,
@Test
public void testGetLetters()
{
assertEquals( "a", DetectOverlappingSpots.getLetters( 0 ) );
assertEquals( "b", DetectOverlappingSpots.getLetters( 1 ) );
assertEquals( "z", DetectOverlappingSpots.getLetters( 25 ) );
assertEquals( "aa", DetectOverlappingSpots.getLetters( 26 ) );
assertEquals( "az", DetectOverlappingSpots.getLetters( 51 ) );
assertEquals( "ba", DetectOverlappingSpots.getLetters( 52 ) );
assertEquals( "bz", DetectOverlappingSpots.getLetters( 77 ) );
assertEquals( "ca", DetectOverlappingSpots.getLetters( 78 ) );
assertEquals( "zz", DetectOverlappingSpots.getLetters( 701 ) );
assertEquals( "aaa", DetectOverlappingSpots.getLetters( 702 ) );
assertEquals( "aaz", DetectOverlappingSpots.getLetters( 727 ) );
assertEquals( "a", CreateConflictTagSet.getLetters( 0 ) );
assertEquals( "b", CreateConflictTagSet.getLetters( 1 ) );
assertEquals( "z", CreateConflictTagSet.getLetters( 25 ) );
assertEquals( "aa", CreateConflictTagSet.getLetters( 26 ) );
assertEquals( "az", CreateConflictTagSet.getLetters( 51 ) );
assertEquals( "ba", CreateConflictTagSet.getLetters( 52 ) );
assertEquals( "bz", CreateConflictTagSet.getLetters( 77 ) );
assertEquals( "ca", CreateConflictTagSet.getLetters( 78 ) );
assertEquals( "zz", CreateConflictTagSet.getLetters( 701 ) );
assertEquals( "aaa", CreateConflictTagSet.getLetters( 702 ) );
assertEquals( "aaz", CreateConflictTagSet.getLetters( 727 ) );
}
}

0 comments on commit ac1c312

Please sign in to comment.