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

Java ImageReader类代码示例

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

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



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

示例1: getRealResolutionCount

import loci.formats.ImageReader; //导入依赖的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


示例2: newImageReader

import loci.formats.ImageReader; //导入依赖的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


示例3: identify

import loci.formats.ImageReader; //导入依赖的package包/类
@Override
public ImageInput identify(ImageInput ii) throws IOException {
    ImageReader reader = new ImageReader();
    try {
        reader.setId(ii.getFile().getAbsolutePath());
    } catch (FormatException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    int width = reader.getSizeX();
    int height = reader.getSizeY();
    String fmt = reader.getFormat();

    String mt = "";
    if (fmt.equalsIgnoreCase("Tagged Image File Format")) {
        mt = "image/tiff";
    } else if (fmt.equalsIgnoreCase("JPEG")) {
        mt = "image/jpeg";
    }

    logger.debug("BioFormats identify: width=" + width + " height=" + height + " format=" + fmt + " mimetype=" + mt);
    ii.setSize(new ImageSize(width, height));
    ii.setMimetype(mt);
    return ii;
}
 
开发者ID:robcast,项目名称:digilib,代码行数:26,代码来源:BioFormatsDocuImage.java


示例4: typedParse

import loci.formats.ImageReader; //导入依赖的package包/类
@Override
protected void typedParse(final RandomAccessInputStream stream,
	final Metadata meta, final SCIFIOConfig config) throws IOException,
	FormatException
{
	try {
		final ImageReader reader = createImageReader(this);
		meta.setReader(reader);

		MetadataStore store = new OMEXMLMetadataImpl();
		reader.setMetadataStore(store);
		reader.setOriginalMetadataPopulated(config.parserIsSaveOriginalMetadata());
		reader.setMetadataFiltered(config.parserIsFiltered());
		reader.setGroupFiles(config.groupableIsGroupFiles());
		reader.setId(stream.getFileName());

		meta.setTable(new DefaultMetaTable(reader.getGlobalMetadata()));
	}
	catch (final loci.formats.FormatException e) {
		throw new FormatException(e);
	}
}
 
开发者ID:scifio,项目名称:scifio-bf-compat,代码行数:23,代码来源:BioFormatsFormat.java


示例5: cacheReaderClasses

import loci.formats.ImageReader; //导入依赖的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


示例6: getImageSuffixes

import loci.formats.ImageReader; //导入依赖的package包/类
/**
 * @return the suffixes that this predicate considers to be
 *         suffixes of image files.
 */
static public Set<String> getImageSuffixes() {
	synchronized(disallowedSuffixes) {
		if (cachedImageSuffixes == null) {
			cachedImageSuffixes = new HashSet<String>(Arrays.asList(
					new ImageReader().getSuffixes()));
			cachedImageSuffixes.removeAll(disallowedSuffixes);
		}
	}
	return cachedImageSuffixes;
}
 
开发者ID:CellProfiler,项目名称:prokaryote,代码行数:15,代码来源:IsImagePredicate.java


示例7: testImageReaderInstantiation

import loci.formats.ImageReader; //导入依赖的package包/类
@Test
public void testImageReaderInstantiation()
        throws URISyntaxException, FormatException, IOException {
    URL resource = this.getClass().getClassLoader().getResource(
            "org/cellprofiler/imageset/omexml.xml");
    Path path = Paths.get(resource.toURI());

    ImageReader reader = new ImageReader();
    try {
        reader.setId(path.toString());
        assertEquals(4, reader.getSeriesCount());
    } finally {
        reader.close();
    }
}
 
开发者ID:CellProfiler,项目名称:prokaryote,代码行数:16,代码来源:TestBioFormats.java


示例8: createReader

import loci.formats.ImageReader; //导入依赖的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


示例9: getCachedImageReader

import loci.formats.ImageReader; //导入依赖的package包/类
/**
 * Gets a cached {@link ImageReader}, suitable for using for format checking
 * or suffix generation. Will only instantiate an {@code ImageReader} if
 * necessary.
 */
public ImageReader getCachedImageReader() {
	if (cacheReaderClasses() || cachedReader == null) {
		cachedReader = createImageReader();
	}
	return cachedReader;
}
 
开发者ID:scifio,项目名称:scifio-bf-compat,代码行数:12,代码来源:BioFormatsFormat.java


示例10: createImageReader

import loci.formats.ImageReader; //导入依赖的package包/类
/** Creates a new Bio-Formats {@link ImageReader}. */
public ImageReader createImageReader() {
	// Check for updated reader classes
	cacheReaderClasses();
	return new ImageReader(readerClasses);
}
 
开发者ID:scifio,项目名称:scifio-bf-compat,代码行数:7,代码来源:BioFormatsFormat.java


示例11: main

import loci.formats.ImageReader; //导入依赖的package包/类
public static void main( String[] args ) throws IOException, FormatException
{
	LandmarkTableModel ltm = new LandmarkTableModel( Integer.parseInt( args[ 0 ] ) );
	ltm.load( new File( args[ 1 ] ) );

	ThinPlateR2LogRSplineKernelTransform xfm = ltm.getTransform();

	String srcName = args[ 2 ];
	String template = args[ 3 ];
	String dstName = args[ 4 ];

	ImagePlus impP = IJ.openImage( srcName );

	// read image properties from the header
	ImageReader reader = new ImageReader();
	reader.setId( template );

	String[] names = new String[]{ impP.getTitle(), "target_interval" };

	/* Load the first source */
	final ImagePlusLoader loaderP = new ImagePlusLoader( impP );
	final AbstractSpimData< ? >[] spimDataP = loaderP.loadAll( 0 );
	int numMovingChannels = loaderP.numChannels();

	final AbstractSpimData< ? >[] spimDataQ = new AbstractSpimData[]{ createSpimData( reader ) };
	
	BigWarpExporter< ? > exporter = BigWarpBatchTransformFOV.applyBigWarpHelper( spimDataP, spimDataQ, impP, ltm, Interpolation.NLINEAR );
	
	ImagePlus ipout = exporter.exportMovingImagePlus( false );

	IJ.save( ipout, dstName );

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



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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