Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change import of AtomiInteger in SpotTrackIDFeatureComputer #281

Merged
merged 3 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
import org.scijava.plugin.Parameter;
import org.scijava.plugin.Plugin;

import io.humble.ferry.AtomicInteger;
import java.util.concurrent.atomic.AtomicInteger;

@Plugin( type = MamutFeatureComputer.class )
public class SpotTrackIDFeatureComputer implements MamutFeatureComputer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
*/
package org.mastodon.mamut.feature.branch;

import net.imglib2.util.Util;
import org.mastodon.mamut.feature.MamutFeatureComputer;
import org.mastodon.mamut.model.Model;
import org.mastodon.mamut.model.ModelGraph;
Expand Down Expand Up @@ -94,21 +95,10 @@ private void runForBranchSpot( BranchSpot branchSpot, Spot ref1, Spot ref2 )
// get target spot
final Spot target = branchGraph.getLastLinkedVertex( branchSpot, ref2 );

output.dispMap.set( branchSpot, distance( source, target ) );
output.dispMap.set( branchSpot, Util.distance( source, target ) );
output.durMap.set( branchSpot, duration( source, target ) );
}

private double distance( Spot source, Spot target )
{
double d2 = 0.;
for ( int d = 0; d < 3; d++ )
{
final double dx = source.getDoublePosition( d ) - target.getDoublePosition( d );
d2 += dx * dx;
}
return Math.sqrt( d2 );
}

private double duration( Spot source, Spot target )
{
final double t1 = target.getTimepoint();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
import org.mastodon.mamut.MainWindow;
import org.mastodon.mamut.MamutMenuBuilder;
import org.mastodon.mamut.ProjectModel;
import org.mastodon.mamut.TimepointAndNumberOfSpotsPanel;
import org.mastodon.mamut.model.BoundingSphereRadiusStatistics;
import org.mastodon.mamut.model.BranchGraphModelOverlayProperties;
import org.mastodon.mamut.model.Link;
Expand Down Expand Up @@ -210,6 +211,11 @@ public MamutBranchViewBdv( final ProjectModel appModel )
navigationHandler );
OverlayActions.install( viewActions, viewer, tracksOverlay );

// Add the timepoint and number of spots panel.
final TimepointAndNumberOfSpotsPanel timepointAndNumberOfSpotsPanel =
new TimepointAndNumberOfSpotsPanel( this.timepointModel, model );
frame.getSettingsPanel().add( timepointAndNumberOfSpotsPanel );

/*
* We must make a search action using the underlying model graph,
* because we cannot iterate over the OverlayGraphWrapper properly
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/org/mastodon/mamut/views/bdv/MamutViewBdv.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import org.mastodon.mamut.MainWindow;
import org.mastodon.mamut.MamutMenuBuilder;
import org.mastodon.mamut.ProjectModel;
import org.mastodon.mamut.TimepointAndNumberOfSpotsPanel;
import org.mastodon.mamut.UndoActions;
import org.mastodon.mamut.model.Link;
import org.mastodon.mamut.model.Model;
Expand Down Expand Up @@ -232,6 +233,11 @@ public MamutViewBdv( final ProjectModel appModel )
colorBarOverlay, appModel.getKeymap() );
onClose( onCloseMIPDialog );

// Add the timepoint and number of spots panel.
final TimepointAndNumberOfSpotsPanel timepointAndNumberOfSpotsPanel =
new TimepointAndNumberOfSpotsPanel( this.timepointModel, model );
frame.getSettingsPanel().add( timepointAndNumberOfSpotsPanel );

/*
* We must make a search action using the underlying model graph,
* because we cannot iterate over the OverlayGraphWrapper properly
Expand Down
Loading