当前位置: 首页>>代码示例>>Java>>正文


Java Opener.openTiff方法代码示例

本文整理汇总了Java中ij.io.Opener.openTiff方法的典型用法代码示例。如果您正苦于以下问题:Java Opener.openTiff方法的具体用法?Java Opener.openTiff怎么用?Java Opener.openTiff使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ij.io.Opener的用法示例。


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

示例1: main

import ij.io.Opener; //导入方法依赖的package包/类
/** Main methods for test runs from comamnd line. */
   public static void main( String [] args ) throws Exception {

if (args.length != 1) {
    System.out.println("Provide a TIFF file");
    System.exit(-1);
}

// open a tiff stack
InputStream img = new FileInputStream(args[0]);
Opener op = new Opener();
ImagePlus ip = op.openTiff( img, args[0]  );
if (ip == null) {
    System.out.println("Failed to open: "+args[0]);
    System.exit(-1);
}
ip.show();

// run an ESI analysis on it
ESI_Analysis es = new ESI_Analysis();
//TraceStack ptr = new TraceStack( ip.getStack());
es.run("");
   }
 
开发者ID:biophotonics-bielefeld,项目名称:ESI,代码行数:24,代码来源:ESI_Analysis.java

示例2: loadFile

import ij.io.Opener; //导入方法依赖的package包/类
/**
 * Load the selected tif stack
 * @param file tif stack file
 */
private void loadFile(File file) {
    Opener o = new Opener();
    ImagePlus win = o.openTiff(file.getParent().concat(File.separator),file.getName());
    ImageStack stack = win.getImageStack();
    ImageProcessor ip = stack.getProcessor(1);
    FloatProcessor fp = ip.convertToFloatProcessor();
    this.pixels = fp.getFloatArray();
}
 
开发者ID:LEB-EPFL,项目名称:SASS,代码行数:13,代码来源:GenerateBackgroundFromFile.java

示例3: loadFile

import ij.io.Opener; //导入方法依赖的package包/类
/**
 * Load selected tif stack
 * @param file tif stack file
 */
private void loadFile(File file) {
    Opener o = new Opener();
    ImagePlus win = o.openTiff(file.getParent().concat(File.separator),file.getName());
    ImageStack stack = win.getImageStack();
    ImageProcessor ip = stack.getProcessor(1);
    FloatProcessor fp = ip.convertToFloatProcessor();
    pixels = fp.getFloatArray();
}
 
开发者ID:LEB-EPFL,项目名称:SASS,代码行数:13,代码来源:ConstantBackground.java

示例4: loadGeneralTiff

import ij.io.Opener; //导入方法依赖的package包/类
/**
 * Loads a tiff stack from a file on disk into RAM
 * @param file tiff file to be loaded
 * @return loaded image stack
 */
public final ImageStack loadGeneralTiff(File file) {
    // Open the tiff via ImageJ
    Logger.getLogger(TiffParser.class.getName()).log(Level.INFO, "Trying to open general tiff.");
    Opener o = new Opener();
    ImagePlus win = o.openTiff(file.getParent().concat("\\"),file.getName());
    ImageStack stack = win.getImageStack();
    
    // load dimensions and check bit depth
    int width = stack.getWidth();
    int height = stack.getHeight();
    int bytesPerPixel;
    if(stack.getPixels(win.getSlice()) instanceof short[]) {
        Logger.getLogger(TiffParser.class.getName()).log(Level.INFO, "Array is instance of short[]");
        bytesPerPixel = 2;
    } else {
        throw new ArrayStoreException("Wrong image bit depth.");
    }
    
    // initialize ImageStack in RAM
    ram_stack = new ImageStack(width, height);
    
    // load slices into new stack
    for (int i=1; i<=stack.getSize(); i++) {
        ram_stack.addSlice(String.valueOf(i), stack.getPixels(i));
        // Log the process
        if (i%100==0) {
            System.out.format("Loaded %d images from general tiff stack.\n",i);
        }
    }
    return ram_stack;
}
 
开发者ID:LEB-EPFL,项目名称:SASS,代码行数:37,代码来源:TiffParser.java

示例5: loadImage

import ij.io.Opener; //导入方法依赖的package包/类
/**
 * Load image.
 *
 * @return the image plus
 */
public ImagePlus loadImage()
{
	if (!hasImage())
		return null;

	Opener opener = new Opener();
	opener.setSilentMode(true);

	// The tifPath may be a system resource or it may be a file 
	File file = new File(tifPath);
	if (file.exists())
	{
		// Load directly from a file path
		return opener.openImage(tifPath);
	}

	// IJ has support for loading TIFs from an InputStream
	Class<ConfigurationTemplate> resourceClass = ConfigurationTemplate.class;
	InputStream inputStream = resourceClass.getResourceAsStream(tifPath);
	if (inputStream != null)
	{
		return opener.openTiff(inputStream, Utils.removeExtension(file.getName()));
	}

	return null;
}
 
开发者ID:aherbert,项目名称:GDSC-SMLM,代码行数:32,代码来源:ConfigurationTemplate.java

示例6: run

import ij.io.Opener; //导入方法依赖的package包/类
@Override
public void run(final String arg) {
	// Open a tiff-file that is inside the jar-file (taken from
	// http://imagej.nih.gov/ij/plugins/download/JAR_Resources_Demo.java)
	final InputStream is = getClass().getResourceAsStream(path + stack_tif);
	if (is != null) {
		final Opener opener = new Opener();
		final ImagePlus imp = opener.openTiff(is, stack_tif);
		if (imp != null) {
			imp.show();
		}
	}
	// TODO Create the tutorial.
}
 
开发者ID:EFTEMj,项目名称:EFTEMj,代码行数:15,代码来源:Tutorial_ESI.java


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