Skip to content

Commit

Permalink
Don't use methods removed in TMUtils to find an axis.
Browse files Browse the repository at this point in the history
  • Loading branch information
tinevez committed Jan 17, 2021
1 parent 95fd4de commit a3659d8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
Expand Up @@ -28,13 +28,6 @@

import javax.swing.ImageIcon;

import net.imagej.ImgPlus;
import net.imglib2.Interval;
import net.imglib2.RandomAccessible;
import net.imglib2.type.NativeType;
import net.imglib2.type.numeric.RealType;
import net.imglib2.view.Views;

import org.jdom2.Element;
import org.scijava.plugin.Plugin;

Expand All @@ -43,6 +36,13 @@
import fiji.plugin.trackmate.gui.ConfigurationPanel;
import fiji.plugin.trackmate.gui.panels.detector.LogDetectorConfigurationPanel;
import fiji.plugin.trackmate.util.TMUtils;
import net.imagej.ImgPlus;
import net.imagej.axis.Axes;
import net.imglib2.Interval;
import net.imglib2.RandomAccessible;
import net.imglib2.type.NativeType;
import net.imglib2.type.numeric.RealType;
import net.imglib2.view.Views;

@Plugin( type = SpotDetectorFactory.class )
public class LogDetectorFactory< T extends RealType< T > & NativeType< T >> implements SpotDetectorFactory< T >
Expand Down Expand Up @@ -89,7 +89,7 @@ protected RandomAccessible< T > prepareFrameImg( final int frame )
{
final double[] calibration = TMUtils.getSpatialCalibration( img );
RandomAccessible< T > imFrame;
final int cDim = TMUtils.findCAxisIndex( img );
final int cDim = img.dimensionIndex( Axes.CHANNEL );
if ( cDim < 0 )
{
imFrame = img;
Expand All @@ -101,13 +101,12 @@ protected RandomAccessible< T > prepareFrameImg( final int frame )
imFrame = Views.hyperSlice( img, cDim, channel );
}

int timeDim = TMUtils.findTAxisIndex( img );
int timeDim = img.dimensionIndex( Axes.TIME );
if ( timeDim >= 0 )
{
if ( cDim >= 0 && timeDim > cDim )
{
timeDim--;
}

imFrame = Views.hyperSlice( imFrame, timeDim, frame );
}

Expand Down
Expand Up @@ -7,6 +7,7 @@
import fiji.plugin.trackmate.util.TMUtils;
import ij.ImagePlus;
import net.imagej.ImgPlus;
import net.imagej.axis.Axes;
import net.imglib2.FinalInterval;
import net.imglib2.RandomAccessible;
import net.imglib2.realtransform.AffineTransform3D;
Expand Down Expand Up @@ -49,8 +50,8 @@ protected SearchRegion< T > getNeighborhood( final Spot spot, final int frame )
* Source, rai and transform
*/

final int tindex = TMUtils.findTAxisIndex( img );
final int cindex = TMUtils.findCAxisIndex( img );
final int tindex = img.dimensionIndex( Axes.TIME );
final int cindex = img.dimensionIndex( Axes.CHANNEL );
if ( frame >= img.dimension( tindex ) )
{
logger.log( "Spot: " + spot + ": No more time-points.\n" );
Expand Down Expand Up @@ -105,7 +106,7 @@ protected SearchRegion< T > getNeighborhood( final Spot spot, final int frame )

long[] min;
long[] max;
if ( img.dimension( TMUtils.findZAxisIndex( img ) ) > 1 )
if ( img.dimension( img.dimensionIndex( Axes.Z ) ) > 1 )
{
// 3D
min = new long[] { x0, y0, z0 };
Expand Down

0 comments on commit a3659d8

Please sign in to comment.