net.imglib2.type.numeric.integer.UnsignedShortType Java Examples

The following examples show how to use net.imglib2.type.numeric.integer.UnsignedShortType. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: N5TypesTest.java    From paintera with GNU General Public License v2.0 6 votes vote down vote up
@Test
public void testType() {
	final Set<DataType> toBeTested = Stream.of(DataType.values()).collect(Collectors.toSet());
	final Set<DataType> wasTested = new HashSet<>();
	testAndLogNativeTypeForType(DataType.FLOAT32, FloatType.class, wasTested);
	testAndLogNativeTypeForType(DataType.FLOAT64, DoubleType.class, wasTested);
	testAndLogNativeTypeForType(DataType.INT8, ByteType.class, wasTested);
	testAndLogNativeTypeForType(DataType.INT16, ShortType.class, wasTested);
	testAndLogNativeTypeForType(DataType.INT32, IntType.class, wasTested);
	testAndLogNativeTypeForType(DataType.INT64, LongType.class, wasTested);
	testAndLogNativeTypeForType(DataType.UINT8, UnsignedByteType.class, wasTested);
	testAndLogNativeTypeForType(DataType.UINT16, UnsignedShortType.class, wasTested);
	testAndLogNativeTypeForType(DataType.UINT32, UnsignedIntType.class, wasTested);
	testAndLogNativeTypeForType(DataType.UINT64, UnsignedLongType.class, wasTested);
	Assert.assertEquals(toBeTested, wasTested);
}
 
Example #2
Source File: LegacyDHMImgLoader.java    From SPIM_Registration with GNU General Public License v2.0 6 votes vote down vote up
@Override
public RandomAccessibleInterval< UnsignedShortType > getImage( final ViewId view )
{
	final BasicViewDescription< ? > vd = sd.getViewDescriptions().get( view );
	final Dimensions d = vd.getViewSetup().getSize();
	final VoxelDimensions dv = vd.getViewSetup().getVoxelSize();

	final ArrayImg< UnsignedShortType, ? > img = ArrayImgs.unsignedShorts( d.dimension( 0 ), d.dimension( 1 ), d.dimension( 2 ) );

	final String ampOrPhaseDir;

	if ( vd.getViewSetup().getAttribute( Channel.class ).getId() == ampChannelId )
		ampOrPhaseDir = amplitudeDir;
	else if ( vd.getViewSetup().getAttribute( Channel.class ).getId() ==  phaseChannelId )
		ampOrPhaseDir = phaseDir;
	else
		throw new RuntimeException( "viewSetupId=" + view.getViewSetupId() + " is not Amplitude nor phase." );

	populateImage( img, directory, stackDir, ampOrPhaseDir, zPlanes, timepoints.get( view.getTimePointId() ), extension );

	updateMetaDataCache( view, (int)d.dimension( 0 ), (int)d.dimension( 1 ), (int)d.dimension( 2 ), dv.dimension( 0 ), dv.dimension( 1 ), dv.dimension( 2 ) );

	return img;
}
 
Example #3
Source File: LegacySlideBook6ImgLoader.java    From SPIM_Registration with GNU General Public License v2.0 6 votes vote down vote up
@Override
public RandomAccessibleInterval< UnsignedShortType > getImage( final ViewId view )
{
	try
	{
		int[] dim = new int[ 3 ];
		float[] voxelSize = new float[ 3 ];
		final Img< UnsignedShortType > img = openSLD(new UnsignedShortType(), view);

		if ( img == null )
			throw new RuntimeException( "Could not load '" + sldFile + "' viewId=" + view.getViewSetupId() + ", tpId=" + view.getTimePointId() );

		return img;
	}
	catch ( Exception e )
	{
		throw new RuntimeException( "Could not load '" + sldFile + "' viewId=" + view.getViewSetupId() + ", tpId=" + view.getTimePointId() + ": " + e );
	}
}
 
Example #4
Source File: LegacyLightSheetZ1ImgLoader.java    From SPIM_Registration with GNU General Public License v2.0 6 votes vote down vote up
@Override
public RandomAccessibleInterval< UnsignedShortType > getImage( final ViewId view )
{
	try
	{
		final Img< UnsignedShortType > img = openCZI( new UnsignedShortType(), view );

		if ( img == null )
			throw new RuntimeException( "Could not load '" + cziFile + "' viewId=" + view.getViewSetupId() + ", tpId=" + view.getTimePointId() );

		return img;
	}
	catch ( Exception e )
	{
		throw new RuntimeException( "Could not load '" + cziFile + "' viewId=" + view.getViewSetupId() + ", tpId=" + view.getTimePointId() + ": " + e );
	}
}
 
Example #5
Source File: LegacyMicroManagerImgLoader.java    From SPIM_Registration with GNU General Public License v2.0 6 votes vote down vote up
@Override
public RandomAccessibleInterval< UnsignedShortType > getImage( final ViewId view )
{
	try
	{
		final MultipageTiffReader r = new MultipageTiffReader( mmFile );

		final ArrayImg< UnsignedShortType, ? > img = ArrayImgs.unsignedShorts( r.width(), r.height(), r.depth() );
		final BasicViewDescription< ? > vd = sequenceDescription.getViewDescriptions().get( view );

		populateImage( img, vd, r );

		updateMetaDataCache( view, r.width(), r.height(), r.depth(), r.calX(), r.calY(), r.calZ() );

		r.close();

		return img;
	}
	catch ( Exception e )
	{
		IOFunctions.printlnSafe( "Failed to load viewsetup=" + view.getViewSetupId() + " timepoint=" + view.getTimePointId() + ": " + e );
		e.printStackTrace();
		return null;
	}
}
 
Example #6
Source File: AbstractThresholdTest.java    From imagej-ops with BSD 2-Clause "Simplified" License 6 votes vote down vote up
@Before
public void initialize() {
	final long[] dimensions = new long[] { xSize, ySize };

	final Random r = new Random(0xdeadbeef);

	// create image and output
	in = ArrayImgs.unsignedShorts(dimensions);

	final RandomAccess<UnsignedShortType> ra = in.randomAccess();

	// populate pixel values with a ramp function + a constant
	for (int x = 0; x < xSize; x++) {
		for (int y = 0; y < ySize; y++) {
			ra.setPosition(new int[] { x, y });
			ra.get().setReal(r.nextInt(65535));
		}
	}
}
 
Example #7
Source File: GenerateSpimData.java    From BigStitcher with GNU General Public License v2.0 6 votes vote down vote up
public static Img< UnsignedShortType > copyChannelUSST( final ImagePlus imp, final int channel )
{
	final int w, h, d;

	Img< UnsignedShortType > img = ArrayImgs.unsignedShorts( w = imp.getWidth(), h = imp.getHeight(), d = imp.getNSlices() );
	
	final Cursor< UnsignedShortType > c = img.cursor();

	for ( int z = 0; z < d; ++z )
	{
		final int[] pixels = (int[])imp.getStack().getProcessor( z + 1 ).getPixels();
		
		for ( int i = 0; i < w*h; ++i )
		{
			if ( channel == 0 )
				c.next().set( ( pixels[ i ] & 0xff0000) >> 16 );
			else if ( channel == 1 )
				c.next().set( ( pixels[ i ] & 0xff00 ) >> 8 );
			else
				c.next().set( pixels[ i ] & 0xff );
		}
	}
	
	return img;
}
 
Example #8
Source File: GenerateSpimData.java    From BigStitcher with GNU General Public License v2.0 6 votes vote down vote up
public static void main( String[] args )
{
	SpimData spimData = grid3x2();
	SequenceDescription sd = spimData.getSequenceDescription();
	ImgLoader i = sd.getImgLoader();

	TimePoint firstTp = sd.getTimePoints().getTimePointsOrdered().get( 0 );
	int tpId = firstTp.getId();

	for ( final ViewSetup vs: spimData.getSequenceDescription().getViewSetups().values() )
	{
		SetupImgLoader< ? > sil = i.getSetupImgLoader( vs.getId() );
		ViewDescription vd = sd.getViewDescription( tpId, vs.getId() );
		
		Tile t = vd.getViewSetup().getTile();

		if ( t.hasLocation() )
			System.out.println( "Loading: " + t.getName() + " " + Util.printCoordinates( t.getLocation() ) + " " + vd.getViewSetup().getChannel().getName() );
		else
			System.out.println( "Loading: " + t.getName() + " (unknown location) " + vd.getViewSetup().getChannel().getName() );
		
		ImageJFunctions.show( (RandomAccessibleInterval< UnsignedShortType >)sil.getImage( tpId, ImgLoaderHints.LOAD_COMPLETELY ) ).resetDisplayRange();
	}
}
 
Example #9
Source File: LinearIntensityMap.java    From TrakEM2 with GNU General Public License v3.0 5 votes vote down vote up
public static void main( final String[] args )
{
	new ImageJ();

	final double[] coefficients = new double[]{
			0, 2, 4, 8,
			1, 1, 1, 1,
			1, 10, 5, 1,
			1, 1, 1, 1,

			0, 10, 20, 30,
			40, 50, 60, 70,
			80, 90, 100, 110,
			120, 130, 140, 150
	};

	final LinearIntensityMap< DoubleType > transform = new LinearIntensityMap< DoubleType >( ArrayImgs.doubles( coefficients, 4, 4, 2 ) );

	//final ImagePlus imp = new ImagePlus( "http://upload.wikimedia.org/wikipedia/en/2/24/Lenna.png" );
	final ImagePlus imp1 = new ImagePlus( "http://fly.mpi-cbg.de/~saalfeld/Pictures/norway.jpg");

	final ArrayImg< FloatType, FloatArray > image1 = ArrayImgs.floats( ( float[] )imp1.getProcessor().convertToFloatProcessor().getPixels(), imp1.getWidth(), imp1.getHeight() );
	final ArrayImg< UnsignedByteType, ByteArray > image2 = ArrayImgs.unsignedBytes( ( byte[] )imp1.getProcessor().convertToByteProcessor().getPixels(), imp1.getWidth(), imp1.getHeight() );
	final ArrayImg< UnsignedShortType, ShortArray > image3 = ArrayImgs.unsignedShorts( ( short[] )imp1.getProcessor().convertToShortProcessor().getPixels(), imp1.getWidth(), imp1.getHeight() );
	final ArrayImg< ARGBType, IntArray > image4 = ArrayImgs.argbs( ( int[] )imp1.getProcessor().getPixels(), imp1.getWidth(), imp1.getHeight() );

	ImageJFunctions.show( ArrayImgs.doubles( coefficients, 4, 4, 2 ) );

	transform.run( image1 );
	transform.run( image2 );
	transform.run( image3 );
	transform.run( image4 );

	ImageJFunctions.show( image1 );
	ImageJFunctions.show( image2 );
	ImageJFunctions.show( image3 );
	ImageJFunctions.show( image4 );
}
 
Example #10
Source File: LegacyStackImgLoaderLOCI.java    From SPIM_Registration with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Get {@link UnsignedShortType} un-normalized image.
 *
 * @param view
 *            timepoint and setup for which to retrieve the image.
 * @return {@link UnsignedShortType} image.
 */
@Override
public RandomAccessibleInterval< UnsignedShortType > getImage( final ViewId view )
{
	final File file = getFile( view );

	if ( file == null )
		throw new RuntimeException( "Could not find file '" + file + "'." );

	try
	{
		final CalibratedImg< UnsignedShortType > img = openLOCI( file, new UnsignedShortType(), view );

		if ( img == null )
			throw new RuntimeException( "Could not load '" + file + "'" );

		// update the MetaDataCache of the AbstractImgLoader
		// this does not update the XML ViewSetup but has to be called explicitly before saving
		updateMetaDataCache( view, (int)img.getImg().dimension( 0 ), (int)img.getImg().dimension( 1 ), (int)img.getImg().dimension( 2 ),
				img.getCalX(), img.getCalY(), img.getCalZ() );

		return img.getImg();
	}
	catch ( Exception e )
	{
		e.printStackTrace();
		throw new RuntimeException( "Could not load '" + file + "': " + e );
	}
}
 
Example #11
Source File: Max_Project.java    From SPIM_Registration with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void run( final String arg )
{
	// ask for everything
	final LoadParseQueryXML result = new LoadParseQueryXML();
	
	if ( !result.queryXML( "image fusion", true, true, true, true ) )
		return;

	maxProject(
		result.getData(),
		SpimData2.getAllViewIdsSorted( result.getData(), result.getViewSetupsToProcess(), result.getTimePointsToProcess() ),
		new UnsignedShortType() );
}
 
Example #12
Source File: Display_View.java    From SPIM_Registration with GNU General Public License v2.0 5 votes vote down vote up
public static void display( final AbstractSpimData< ? > spimData, final ViewId viewId, final int pixelType, final String name, final boolean virtual )
{
	final ImgLoader imgLoader = (ImgLoader)spimData.getSequenceDescription().getImgLoader();
	final ImgFactory< ? extends NativeType< ? > > factory;
	final AbstractImgFactoryImgLoader il;

	// load as ImagePlus directly if possible
	if ( AbstractImgFactoryImgLoader.class.isInstance( imgLoader ) )
	{
		il = (AbstractImgFactoryImgLoader)imgLoader;
		factory = il.getImgFactory();
		il.setImgFactory( new ImagePlusImgFactory< FloatType >());
	}
	else
	{
		il = null;
		factory = null;
	}

	// display it
	DisplayImage export = new DisplayImage( virtual );
	
	if ( pixelType == 0 )
		export.exportImage( ((ImgLoader)spimData.getSequenceDescription().getImgLoader()).getSetupImgLoader( viewId.getViewSetupId() ).getFloatImage( viewId.getTimePointId(), false ), name );
	else
	{
		@SuppressWarnings( "unchecked" )
		RandomAccessibleInterval< UnsignedShortType > img =
			( RandomAccessibleInterval< UnsignedShortType > ) ((ImgLoader)spimData.getSequenceDescription().getImgLoader()).getSetupImgLoader( viewId.getViewSetupId() ).getImage( viewId.getTimePointId() );
		export.exportImage( img, name );
	}

	if ( factory != null && il != null )
		il.setImgFactory( factory );
}
 
Example #13
Source File: InvertTest.java    From imagej-ops with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Test
public void testUnsignedShortTypeInvert() {
	final Img<UnsignedShortType> inUnsignedShortType =
		generateUnsignedShortArrayTestImg(true, 5, 5);
	final Img<UnsignedShortType> outUnsignedShortType = inUnsignedShortType
		.factory().create(inUnsignedShortType, new UnsignedShortType());
	assertDefaultInvert(inUnsignedShortType, outUnsignedShortType);
	assertDefaultInvertMinMaxProvided(inUnsignedShortType, outUnsignedShortType,
		new UnsignedShortType((short) 437), new UnsignedShortType((short) 8008));
}
 
Example #14
Source File: AbstractOpTest.java    From imagej-ops with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public ArrayImg<UnsignedShortType, ShortArray>
	generateUnsignedShortArrayTestImg(final boolean fill, final long... dims)
{
	final short[] array = new short[(int) Intervals.numElements(
		new FinalInterval(dims))];

	if (fill) {
		seed = 17;
		for (int i = 0; i < array.length; i++) {
			array[i] = (short) (pseudoRandom() / Integer.MAX_VALUE);
		}
	}

	return ArrayImgs.unsignedShorts(array, dims);
}
 
Example #15
Source File: GenerateSpimData.java    From BigStitcher with GNU General Public License v2.0 5 votes vote down vote up
@Override
public RandomAccessibleInterval< UnsignedShortType > getImage(
		int timepointId, ImgLoaderHint... hints )
{
	ImagePlus imp;
	String file;
	
	if ( setupId % 4 == 0 )
		file = "73.tif.zip";
	else if ( setupId % 4 == 1 )
		file = "74.tif.zip";
	else if ( setupId % 4 == 2 )
		file = "75.tif.zip";
	else 
		file = "76.tif.zip";

	if ( openImgs.containsKey( file ) )
	{
		imp = openImgs.get( file );
	}
	else
	{
		imp = new ImagePlus( file );
		openImgs.put( file, imp );
	}

	Img< UnsignedShortType > img = copyChannelUSST( imp, setupId / 4 );

	return img;
}
 
Example #16
Source File: AbstractThresholdTest.java    From imagej-ops with BSD 2-Clause "Simplified" License 5 votes vote down vote up
protected void assertThreshold(final int expected, final Object actual) {
	final Object value =
		actual instanceof List ? ListUtils.first((List<?>) actual) : actual;
	assertTrue(value instanceof UnsignedShortType);
	final UnsignedShortType threshold = (UnsignedShortType) value;
	assertEquals(expected, threshold.get());
}
 
Example #17
Source File: N5Types.java    From paintera with GNU General Public License v2.0 5 votes vote down vote up
/**
 *
 * @param dataType N5 {@link DataType}
 * @param <T> {@link NativeType}
 * @return appropriate {@link NativeType} for {@code dataType}
 */
@SuppressWarnings("unchecked")
public static <T extends NativeType<T>> T type(final DataType dataType) {
	switch (dataType) {
		case INT8:
			return (T) new ByteType();
		case UINT8:
			return (T) new UnsignedByteType();
		case INT16:
			return (T) new ShortType();
		case UINT16:
			return (T) new UnsignedShortType();
		case INT32:
			return (T) new IntType();
		case UINT32:
			return (T) new UnsignedIntType();
		case INT64:
			return (T) new LongType();
		case UINT64:
			return (T) new UnsignedLongType();
		case FLOAT32:
			return (T) new FloatType();
		case FLOAT64:
			return (T) new DoubleType();
		default:
			return null;
	}
}
 
Example #18
Source File: ApplyManualThresholdTest.java    From imagej-ops with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Test
public void testApplyThreshold() throws IncompatibleTypeException {
	final Img<BitType> out = bitmap();
	final UnsignedShortType threshold = new UnsignedShortType(30000);
	ops.run(ApplyManualThreshold.class, out, in, threshold);
	assertCount(out, 54);
}
 
Example #19
Source File: DefaultCreateIntegerType.java    From imagej-ops with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public IntegerType calculate() {
	if (maxValue <= 0L) return new IntType();
	if (maxValue <= 1L) return new BitType();
	if (maxValue <= 0x7fL) return new ByteType();
	if (maxValue <= 0xffL) return new UnsignedByteType();
	if (maxValue <= 0x7fffL) return new ShortType();
	if (maxValue <= 0xffffL) return new UnsignedShortType();
	if (maxValue <= 0x7fffffffL) return new IntType();
	if (maxValue <= 0xffffffffL) return new UnsignedIntType();
	return new LongType();
}
 
Example #20
Source File: ConvertNamespace.java    From imagej-ops with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@OpMethod(op = net.imagej.ops.convert.ConvertTypes.IntegerToUint16.class)
public <T extends IntegerType<T>> UnsignedShortType uint16(
	final UnsignedShortType out, final T in)
{
	final UnsignedShortType result = (UnsignedShortType) ops().run(
		Ops.Convert.Uint16.class, out, in);
	return result;
}
 
Example #21
Source File: ConvertNamespace.java    From imagej-ops with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@OpMethod(op = net.imagej.ops.convert.ConvertTypes.ComplexToUint16.class)
public <C extends ComplexType<C>> UnsignedShortType uint16(
	final UnsignedShortType out, final C in)
{
	final UnsignedShortType result = (UnsignedShortType) ops().run(
		Ops.Convert.Uint16.class, out, in);
	return result;
}
 
Example #22
Source File: ProcessFusion.java    From SPIM_Registration with GNU General Public License v2.0 5 votes vote down vote up
@SuppressWarnings({ "unchecked", "rawtypes" })
public static < T extends RealType< T > > RandomAccessibleInterval< T > getImage( final T type, ImgLoader imgLoader, final ViewId view, final boolean normalize )
{
	if ( (RealType)type instanceof FloatType )
		return (RandomAccessibleInterval)imgLoader.getSetupImgLoader( view.getViewSetupId() ).getFloatImage( view.getTimePointId(), normalize, LOAD_COMPLETELY );
	else if ( (RealType)type instanceof UnsignedShortType )
		return (RandomAccessibleInterval)imgLoader.getSetupImgLoader( view.getViewSetupId() ).getImage( view.getTimePointId(), LOAD_COMPLETELY );
	else
		return null;
}
 
Example #23
Source File: ConvertNamespace.java    From imagej-ops with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@OpMethod(op = net.imagej.ops.convert.ConvertImages.Uint16.class)
public <C extends ComplexType<C>> Img<UnsignedShortType> uint16(
	final Img<UnsignedShortType> out, final IterableInterval<C> in)
{
	@SuppressWarnings("unchecked")
	final Img<UnsignedShortType> result = (Img<UnsignedShortType>) ops().run(
		Ops.Convert.Uint16.class, out, in);
	return result;
}
 
Example #24
Source File: ConvertNamespace.java    From imagej-ops with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@OpMethod(op = net.imagej.ops.convert.ConvertImages.Uint16.class)
public <C extends ComplexType<C>> Img<UnsignedShortType> uint16(
	final IterableInterval<C> in)
{
	@SuppressWarnings("unchecked")
	final Img<UnsignedShortType> result = (Img<UnsignedShortType>) ops().run(
		Ops.Convert.Uint16.class, in);
	return result;
}
 
Example #25
Source File: ExportSpimData2HDF5.java    From SPIM_Registration with GNU General Public License v2.0 5 votes vote down vote up
public static < T extends RealType< T > > RandomAccessibleInterval< UnsignedShortType > convert( final RandomAccessibleInterval< T > img, final Parameters params )
{
	final double[] minmax = updateAndGetMinMax( img, params );

	final RealUnsignedShortConverter< T > converter = new RealUnsignedShortConverter< T >( minmax[ 0 ], minmax[ 1 ] );

	return new ConvertedRandomAccessibleInterval<T, UnsignedShortType>( img, converter, new UnsignedShortType() );
}
 
Example #26
Source File: DefaultImgUtilityService.java    From scifio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
/**
 * Converts ImgLib2 Type object to SCIFIO pixel type.
 */
@Override
public int makeType(final Object type) throws ImgIOException {
	int pixelType = FormatTools.UINT8;
	if (type instanceof UnsignedByteType) {
		pixelType = FormatTools.UINT8;
	}
	else if (type instanceof ByteType) {
		pixelType = FormatTools.INT8;
	}
	else if (type instanceof UnsignedShortType) {
		pixelType = FormatTools.UINT16;
	}
	else if (type instanceof ShortType) {
		pixelType = FormatTools.INT16;
	}
	else if (type instanceof UnsignedIntType) {
		pixelType = FormatTools.UINT32;
	}
	else if (type instanceof IntType) {
		pixelType = FormatTools.INT32;
	}
	else if (type instanceof FloatType) {
		pixelType = FormatTools.FLOAT;
	}
	else if (type instanceof DoubleType) {
		pixelType = FormatTools.DOUBLE;
	}
	else {
		throw new ImgIOException("Pixel type not supported. " +
			"Please convert your image to a supported type.");
	}

	return pixelType;
}
 
Example #27
Source File: WeightedAverageFusion.java    From SPIM_Registration with GNU General Public License v2.0 4 votes vote down vote up
@Override
public boolean fuseData( final BoundingBoxGUI bb, final ImgExport exporter )
{
	// set up naming scheme
	final FixedNameImgTitler titler = new FixedNameImgTitler( "" );
	if ( exporter instanceof ImgExportTitle )
		( (ImgExportTitle)exporter).setImgTitler( titler );

	final ProcessFusion process;
	
	if ( getFusionType() == WeightedAvgFusionType.FUSEDATA && numParalellViews == 0 )
		process = new ProcessParalell( spimData, viewIdsToProcess, bb, useBlending, useContentBased );
	else if ( getFusionType() == WeightedAvgFusionType.FUSEDATA )
		process = new ProcessSequential( spimData, viewIdsToProcess, bb, useBlending, useContentBased, numParalellViews );
	else
		process = new ProcessIndependent( spimData, viewIdsToProcess, bb, exporter, newViewsetups );


	for ( final TimePoint t : timepointsToProcess )
		for ( final Channel c : channelsToProcess )
		{
			final List< Angle > anglesToProcess = SpimData2.getAllAnglesForChannelTimepointSorted( spimData, viewIdsToProcess, c, t );
			final List< Illumination > illumsToProcess = SpimData2.getAllIlluminationsForChannelTimepointSorted( spimData, viewIdsToProcess, c, t );

			titler.setTitle( "TP" + t.getName() + "_Ch" + c.getName() + FusionHelper.getIllumName( illumsToProcess ) + FusionHelper.getAngleName( anglesToProcess ) );
			if ( bb.getPixelType() == 0 )
			{
				exporter.exportImage(
						process.fuseStack( new FloatType(), getInterpolatorFactory( new FloatType() ), t , c ),
						bb,
						t,
						newViewsetups.get( SpimData2.getViewSetup( spimData.getSequenceDescription().getViewSetupsOrdered(), c, anglesToProcess.get( 0 ), illumsToProcess.get( 0 ) ) ));
			}
			else
			{
				exporter.exportImage(
						process.fuseStack( new UnsignedShortType(), getInterpolatorFactory( new UnsignedShortType() ), t , c ),
						bb,
						t,
						newViewsetups.get( SpimData2.getViewSetup( spimData.getSequenceDescription().getViewSetupsOrdered(), c, anglesToProcess.get( 0 ), illumsToProcess.get( 0 ) ) ));
			}
		}

	return true;
}
 
Example #28
Source File: CreateIntegerTypeTest.java    From imagej-ops with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Test
public void testUint16() {
	assertType(UnsignedShortType.class, 0xfffeL);
	assertType(UnsignedShortType.class, 0xffffL);
	assertNotType(UnsignedShortType.class, 0x10000L);
}
 
Example #29
Source File: GenerateSpimData.java    From BigStitcher with GNU General Public License v2.0 4 votes vote down vote up
@Override
public UnsignedShortType getImageType() { return new UnsignedShortType(); }
 
Example #30
Source File: AbstractImgLoader.java    From SPIM_Registration with GNU General Public License v2.0 4 votes vote down vote up
@Override
public UnsignedShortType getImageType()
{
	return new UnsignedShortType();
}