Skip to content

Commit

Permalink
Merge branch 'master' of github.com:PreibischLab/multiview-reconstruc…
Browse files Browse the repository at this point in the history
…tion
  • Loading branch information
StephanPreibisch committed May 3, 2024
2 parents 6880cd6 + 28cc4b0 commit 35955df
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,7 @@ else if ( imgType == ImgDataType.PRECOMPUTED )
* @param border - the target blending border, e.g. 0
* @param transformationModel - the transformation model used to map from the (downsampled) input to the output
*/
// NOTE (TP) blending and border are modified
public static void adjustBlending( final BasicViewDescription< ? > vd, final float[] blending, final float[] border, final AffineTransform3D transformationModel )
{
adjustBlending( vd.getViewSetup().getSize(), Group.pvid( vd ), blending, border, transformationModel );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@
import net.imglib2.RealRandomAccess;
import net.imglib2.converter.Converters;
import net.imglib2.converter.RealFloatConverter;
import net.imglib2.converter.RealTypeConverters;
import net.imglib2.interpolation.InterpolatorFactory;
import net.imglib2.type.numeric.RealType;
import net.imglib2.type.numeric.real.FloatType;
import net.imglib2.util.Util;
import net.imglib2.view.Views;

public abstract class AbstractTransformedImgRandomAccess< T extends RealType< T > > extends AbstractTransformedIntervalRandomAccess
Expand Down Expand Up @@ -58,17 +60,13 @@ public AbstractTransformedImgRandomAccess(
// extend input image and convert to floats
final RandomAccessible< FloatType > input;

if ( FloatType.class.isInstance( Views.iterable( img ).cursor().next() ) )
if ( Util.getTypeFromInterval( img ) instanceof FloatType )
{
input = (RandomAccessible< FloatType >)img;
input = ( RandomAccessible< FloatType > ) img;
}
else
{
input =
Converters.convert(
img,
new RealFloatConverter< T >(),
new FloatType() );
input = RealTypeConverters.convert( img, new FloatType() );
}

// make the interpolator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public abstract class AbstractTransformedIntervalRandomAccessible implements Ran

final protected int n;

protected InterpolatorFactory< FloatType, RandomAccessible< FloatType > > interpolatorFactory = new NLinearInterpolatorFactory< FloatType >();
protected InterpolatorFactory< FloatType, RandomAccessible< FloatType > > interpolatorFactory = new NLinearInterpolatorFactory<>();

public AbstractTransformedIntervalRandomAccessible(
final Interval interval, // from ImgLoader
Expand All @@ -60,12 +60,12 @@ public AbstractTransformedIntervalRandomAccessible(

public void setLinearInterpolation()
{
this.interpolatorFactory = new NLinearInterpolatorFactory< FloatType >();
this.interpolatorFactory = new NLinearInterpolatorFactory<>();
}

public void setNearestNeighborInterpolation()
{
this.interpolatorFactory = new NearestNeighborInterpolatorFactory< FloatType >();
this.interpolatorFactory = new NearestNeighborInterpolatorFactory<>();
}

@Override
Expand Down

0 comments on commit 35955df

Please sign in to comment.