• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java IFormatReader类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中loci.formats.IFormatReader的典型用法代码示例。如果您正苦于以下问题:Java IFormatReader类的具体用法?Java IFormatReader怎么用?Java IFormatReader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IFormatReader类属于loci.formats包,在下文中一共展示了IFormatReader类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getTileIndices

import loci.formats.IFormatReader; //导入依赖的package包/类
public Point[] getTileIndices(IFormatReader reader, int tileWidth, int tileHeight) {
    Rectangle region = new Rectangle(0, 0, reader.getSizeX()+1, reader.getSizeY() + 1);
    int minTileX = XToTileX(region.x,0,tileWidth);
    int maxTileX = XToTileX(region.x + region.width - 1,0,tileWidth);
    int minTileY = this.YToTileY(region.y,0,tileHeight);
    int maxTileY = this.YToTileY(region.y + region.height - 1,0,tileHeight);
    Point[] tileIndices = new Point[(maxTileY - minTileY + 1) * (maxTileX - minTileX + 1)];
    int tileIndexOffset = 0;

    for(int ty = minTileY; ty <= maxTileY; ++ty) {
        for(int tx = minTileX; tx <= maxTileX; ++tx) {
            tileIndices[tileIndexOffset++] = new Point(tx, ty);
        }
    }

    return tileIndices;
}
 
开发者ID:mstritt,项目名称:orbit-image-analysis,代码行数:18,代码来源:Calibration.java


示例2: getRealResolutionCount

import loci.formats.IFormatReader; //导入依赖的package包/类
@Deprecated
private int getRealResolutionCount(IFormatReader imageReader) throws IOException, FormatException {
    ImageReader ir = new ImageReader();
    ir.setFlattenedResolutions(false);
    ir.setId(imageReader.getCurrentFile());
    ir.setSeries(imageReader.getSeries());
    int numRes = 1;
    for (int lev=imageReader.getResolutionCount()-1; lev>=0; lev--) {
        numRes = lev;
        ir.setResolution(lev);
        int thumbW = ir.getSizeX();
        int thumbH = ir.getSizeY();
        double diff = Math.abs((thumbW/(double)thumbH) - (imageReader.getSizeX()/(double)imageReader.getSizeY()));
        System.out.println("diff: "+diff);
        if (diff<0.001) break;
    }
    ir.close();
    return numRes;
}
 
开发者ID:mstritt,项目名称:orbit-image-analysis,代码行数:20,代码来源:OrbitImageBioformats.java


示例3: newImageReader

import loci.formats.IFormatReader; //导入依赖的package包/类
public static final IFormatReader newImageReader(final String id) {
	final IFormatReader reader = new ImageReader();
	
	try {
		reader.setId(id);
	} catch (final Exception exception) {
		throw unchecked(exception);
	}
	
	if ("portable gray map".equals(reader.getFormat().toLowerCase(Locale.ENGLISH))) {
		// XXX This fixes a defect in Bio-Formats PPM loading, but is it always OK?
		reader.getCoreMetadata()[0].interleaved = true;
	}
	
	reader.setSeries(0);
	
	return reader;
}
 
开发者ID:apgrgr,项目名称:SyntheticWSI,代码行数:19,代码来源:LociBackedImage.java


示例4: predefinedChannelsFor

import loci.formats.IFormatReader; //导入依赖的package包/类
public static final Channels predefinedChannelsFor(final IFormatReader lociImage) {
	if (lociImage.isIndexed()) {
		return PredefinedChannels.C3_U8;
	}
	
	switch (lociImage.getRGBChannelCount()) {
	case 1:
		switch (FormatTools.getBytesPerPixel(lociImage.getPixelType()) * lociImage.getRGBChannelCount()) {
		case 1:
			return 1 == lociImage.getBitsPerPixel() ?
					PredefinedChannels.C1_U1 : PredefinedChannels.C1_U8;
		case 2:
			return PredefinedChannels.C1_U16;
		default:
			return PredefinedChannels.C1_S32;
		}
	case 2:
		return PredefinedChannels.C2_U16;
	case 3:
		return PredefinedChannels.C3_U8;
	case 4:
		return PredefinedChannels.C4_U8;
	default:
		throw new IllegalArgumentException();
	}
}
 
开发者ID:apgrgr,项目名称:SyntheticWSI,代码行数:27,代码来源:LociBackedImage.java


示例5: openPlane

import loci.formats.IFormatReader; //导入依赖的package包/类
@Override
public ByteArrayPlane openPlane(final int imageIndex,
	final long planeIndex, final ByteArrayPlane plane, final long[] offsets,
	final long[] lengths, final SCIFIOConfig config) throws FormatException,
	IOException
{
	final IFormatReader reader = getMetadata().getReader();
	reader.setSeries(imageIndex);
	try {
		Metadata meta = getMetadata();
		final int xIndex = meta.get(imageIndex).getAxisIndex(Axes.X), yIndex =
			meta.get(imageIndex).getAxisIndex(Axes.Y);
		final int x = (int) offsets[xIndex], y = (int) offsets[yIndex], w =
			(int) lengths[xIndex], h = (int) lengths[yIndex];
		reader.openBytes((int)planeIndex, plane.getBytes(), x, y, w, h);

		plane.setColorTable(getMetadata().getColorTable(imageIndex, planeIndex));
	}
	catch (final loci.formats.FormatException e) {
		throw new FormatException(e);
	}

	return plane;
}
 
开发者ID:scifio,项目名称:scifio-bf-compat,代码行数:25,代码来源:BioFormatsFormat.java


示例6: cacheReaderClasses

import loci.formats.IFormatReader; //导入依赖的package包/类
/**
 * Compiles the list of Bio-Formats reader classes, excluding the
 * {@link #DO_NOT_CONVERT} blacklist.
 *
 * @return true if the reader class list was re-generated.
 */
private boolean cacheReaderClasses() {
	final Class<? extends IFormatReader>[] defaultClasses =
		ImageReader.getDefaultReaderClasses().getClasses();
	final int currentHash = Arrays.hashCode(defaultClasses);

	// If our classList is uninitialized, or the Bio-Formats classList has
	// changed, compute the current reader classes.
	if (readerClasses == null || cachedReaderHash != currentHash) {
		final ClassList<IFormatReader> targetClasses =
			new ClassList<IFormatReader>(IFormatReader.class);

		// add reader classes to the list, excluding the blacklist
		for (final Class<? extends IFormatReader> c : defaultClasses) {
			if (convert(c)) targetClasses.addClass(c);
		}
		readerClasses = targetClasses;
		cachedReaderHash = currentHash;

		return true;
	}
	return false;
}
 
开发者ID:scifio,项目名称:scifio-bf-compat,代码行数:29,代码来源:BioFormatsFormat.java


示例7: close

import loci.formats.IFormatReader; //导入依赖的package包/类
@Override
public void close() throws IOException {
    synchronized (allReaders) {
        for (IFormatReader r: allReaders) {
            try {
                r.close();
            } catch (Exception e) {
            }
        }
    }
}
 
开发者ID:mstritt,项目名称:orbit-image-analysis,代码行数:12,代码来源:OrbitImageBioformats.java


示例8: configureReader

import loci.formats.IFormatReader; //导入依赖的package包/类
@Override
protected void configureReader(IFormatReader reader, int resIndex)
{
	int resolutionIndexInReader = super.getResolutionCount() - 1 - resIndex;
	
	reader.setSeries(super.getSeriesIndex() + resolutionIndexInReader);
}
 
开发者ID:Strachu,项目名称:VirtualSlideViewer,代码行数:8,代码来源:OmeTiffVirtualSlideImage.java


示例9: close

import loci.formats.IFormatReader; //导入依赖的package包/类
@Override
public void close()
{
	for(IFormatReader reader : super.borrowAllAvailableObjects())
	{
		try
		{
			reader.close();
		}
		catch(IOException e)
		{
			e.printStackTrace();
		}
	}
}
 
开发者ID:Strachu,项目名称:VirtualSlideViewer,代码行数:16,代码来源:ReaderPool.java


示例10: canLoad

import loci.formats.IFormatReader; //导入依赖的package包/类
@Override
public boolean canLoad(Path filePath)
{
	try(IFormatReader reader = new OMETiffReader())
	{
		return reader.isThisType(filePath.toString());
	}
	catch(IOException e)
	{
		return false;
	}
}
 
开发者ID:Strachu,项目名称:VirtualSlideViewer,代码行数:13,代码来源:OmeTiffLoader.java


示例11: loadImages

import loci.formats.IFormatReader; //导入依赖的package包/类
@Override
protected void loadImages(BioformatsVirtualSlide slide, ReaderPool readerPool) throws UncheckedInterruptedException
{
	IFormatReader reader = readerPool.borrow();
	try
	{	
		List<Integer> seriesResolutionCount = getSeriesResolutionCount(slide.getBioformatsMetadata());
		
		int readerSeriesIndex = 0;
		for(int seriesIndex = 0; seriesIndex < seriesResolutionCount.size(); seriesIndex++)
		{
			reader.setSeries(readerSeriesIndex);
			
			String imageName = slide.getBioformatsMetadata().getImageName(readerSeriesIndex);
			int    resCount  = seriesResolutionCount.get(seriesIndex);
			
			OmeTiffVirtualSlideImage image = new OmeTiffVirtualSlideImage(imageName, readerSeriesIndex, resCount, readerPool);
			
			computePaddingForEveryResolutionOfImage(image);
			
			slide.addImage(seriesIndex, image);
			
			readerSeriesIndex += seriesResolutionCount.get(seriesIndex);
		}
	}
	finally
	{
		readerPool.putBack(reader);
	}
}
 
开发者ID:Strachu,项目名称:VirtualSlideViewer,代码行数:31,代码来源:OmeTiffLoader.java


示例12: getReader

import loci.formats.IFormatReader; //导入依赖的package包/类
public final IFormatReader getReader() {
	if (this.reader == null) {
		this.setupReader();
	}
	
	return this.reader;
}
 
开发者ID:apgrgr,项目名称:SyntheticWSI,代码行数:8,代码来源:LociBackedImage.java


示例13: createReader

import loci.formats.IFormatReader; //导入依赖的package包/类
private IFormatReader createReader(final String filePath)
	throws FormatException, IOException
{
	if (readerPath != null && readerPath.equals(filePath)) {
		// just use the existing reader
		return reader;
	}

	if (reader != null) {
		reader.close();
	}
	System.err.println("Creating new reader for " + filePath);
	// initialize a fresh reader
	final ChannelFiller cf = new ChannelFiller(new ImageReader());
	cf.setFilled(true);
	reader = cf;
	readerPath = filePath;

	reader.setMetadataFiltered(true);
	reader.setOriginalMetadataPopulated(true);
	final MetadataStore store = MetadataTools.createOMEXMLMetadata();
	if (store == null) System.err.println("OME-Java library not found.");
	else reader.setMetadataStore(store);

	// avoid grouping all the .lsm when a .mdb is there
	reader.setGroupFiles(false);

	if (filePath != null) {
		reader.setId(filePath);
		reader.setSeries(0);
	}

	return reader;
}
 
开发者ID:scifio,项目名称:scifio-itk-bridge,代码行数:35,代码来源:SCIFIOITKBridge.java


示例14: convert

import loci.formats.IFormatReader; //导入依赖的package包/类
/** Returns false if this reader class already exists in SCIFIO. */
private boolean convert(final Class<? extends IFormatReader> c) {
	for (final String s : DO_NOT_CONVERT) {
		if (s.equals(c.getName())) return false;
	}
	return true;
}
 
开发者ID:scifio,项目名称:scifio-bf-compat,代码行数:8,代码来源:BioFormatsFormat.java


示例15: getIndex

import loci.formats.IFormatReader; //导入依赖的package包/类
private int getIndex(IFormatReader r, int channel) {
    int[] nos = r.getZCTCoords(0);
    int z = nos[0], t = nos[2];
    return r.getIndex(z,channel,t);
}
 
开发者ID:mstritt,项目名称:orbit-image-analysis,代码行数:6,代码来源:OrbitImageBioformats.java


示例16: doMergeChannels

import loci.formats.IFormatReader; //导入依赖的package包/类
private boolean doMergeChannels(IFormatReader r) {
  // return !r.isRGB();
   int c = r.getSizeC();
   return c > 1 && !r.isRGB();
}
 
开发者ID:mstritt,项目名称:orbit-image-analysis,代码行数:6,代码来源:OrbitImageBioformats.java


示例17: doMergeChannels

import loci.formats.IFormatReader; //导入依赖的package包/类
private boolean doMergeChannels(IFormatReader r) {
    int c = r.getSizeC();
    return c > 1 && !r.isRGB();
}
 
开发者ID:mstritt,项目名称:image-provider-omero,代码行数:5,代码来源:OrbitImageBioformatsOmero.java


示例18: ReaderPool

import loci.formats.IFormatReader; //导入依赖的package包/类
public ReaderPool(Supplier<IFormatReader> newReaderFactory)
{
	super(newReaderFactory);
}
 
开发者ID:Strachu,项目名称:VirtualSlideViewer,代码行数:5,代码来源:ReaderPool.java


示例19: createSpimData

import loci.formats.IFormatReader; //导入依赖的package包/类
public static final SpimDataMinimal createSpimData( IFormatReader reader )
{
	Hashtable< String, Object > gmeta = reader.getGlobalMetadata();
	System.out.println( gmeta ); // header stuff here TODO
	
	// get relevant metadata
	double pw = 1.0;
	double ph = 1.0;
	double pd = 1.0;

	if( gmeta.keySet().contains( "XResolution" ))
		pw = ((Double)gmeta.get("XResolution")).doubleValue();

	if( gmeta.keySet().contains( "YResolution" ))
		ph = ((Double)gmeta.get("YResolution")).doubleValue();

	if( gmeta.keySet().contains( "Spacing" ))
		pd = ((Double)gmeta.get("Spacing")).doubleValue();

	int numSetups = 1;
	int numTimepoints = 1;
	int[] ids = new int[]{ 349812342 };
	final File basePath = new File( "." );

	String punit = "px";
	if( gmeta.keySet().contains( "Unit" ))
		punit = (String) gmeta.get( "Unit" );
	
	final FinalVoxelDimensions voxelSize = new FinalVoxelDimensions( punit, pw, ph, pd );
	final long w = ((Long)gmeta.get("ImageWidth")).longValue();
	final long h = ((Long)gmeta.get("ImageLength")).longValue();
	final long d = reader.getSizeZ(); //Long.parseLong( (String)gmeta.get("images") );

	long[] dims = new long[]{ w, h, d };
	final FinalDimensions size = new FinalDimensions( new long[] { w, h, d } );

	// create setups from channels
	final HashMap< Integer, BasicViewSetup > setups = new HashMap< Integer, BasicViewSetup >( numSetups );
	for ( int s = 0; s < numSetups; ++s )
	{
		final BasicViewSetup setup = new BasicViewSetup( ids[ s ], String.format( "channel %d", ids[ s ] + 1 ), size, voxelSize );
		setup.setAttribute( new Channel( ids[ s ] + 1 ) );
		setups.put( ids[ s ], setup );
	}

	// create timepoints
	final ArrayList< TimePoint > timepoints = new ArrayList< TimePoint >( numTimepoints );
	for ( int t = 0; t < numTimepoints; ++t )
		timepoints.add( new TimePoint( t ) );

	// create ViewRegistrations from the images calibration
	final AffineTransform3D sourceTransform = new AffineTransform3D();
	sourceTransform.set( 1.0/pw, 0, 0, 0, 0, 1.0/ph, 0, 0, 0, 0, pd, 0 );
	final ArrayList< ViewRegistration > registrations = new ArrayList< ViewRegistration >();
	for ( int t = 0; t < numTimepoints; ++t )
		for ( int s = 0; s < numSetups; ++s )
			registrations.add( new ViewRegistration( t, ids[ s ], sourceTransform ) );

	final SequenceDescriptionMinimal seq = new SequenceDescriptionMinimal( new TimePoints( timepoints ), setups, 
			new DummyImageLoader< FloatType >( new FloatType(), dims ), null );

	SpimDataMinimal spimData = new SpimDataMinimal( basePath, seq, new ViewRegistrations( registrations ) );
	if ( WrapBasicImgLoader.wrapImgLoaderIfNecessary( spimData ) )
		System.err.println( "WARNING:\nOpening <SpimData> dataset that is not suited for interactive browsing.\nConsider resaving as HDF5 for better performance." );

	return spimData;
}
 
开发者ID:saalfeldlab,项目名称:bigwarp,代码行数:68,代码来源:BigWarpBatchTransform.java


示例20: getPlanePosition

import loci.formats.IFormatReader; //导入依赖的package包/类
public static final double[] getPlanePosition( final IFormatReader r, final MetadataRetrieve retrieve, int series, int t )
{
	return getPlanePosition(r, retrieve, series, t, false, false, false);
}
 
开发者ID:fiji,项目名称:Stitching,代码行数:5,代码来源:CommonFunctions.java



注:本文中的loci.formats.IFormatReader类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java BeanContainer类代码示例发布时间:2022-05-22
下一篇:
Java GetEditLogManifestRequestProto类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap