本文整理汇总了Java中ij.plugin.FolderOpener类的典型用法代码示例。如果您正苦于以下问题:Java FolderOpener类的具体用法?Java FolderOpener怎么用?Java FolderOpener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FolderOpener类属于ij.plugin包,在下文中一共展示了FolderOpener类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import ij.plugin.FolderOpener; //导入依赖的package包/类
public static void main( final String[] args )
{
new ImageJ();
// final ImagePlus imp = new ImagePlus( "/data/hanslovskyp/davi_toy_set/substacks/shuffle/03/data/data.tif" );
final ImagePlus imp = new FolderOpener().openFolder( "/data/hanslovskyp/forPhilipp/substacks/03/data/" );
// final ImagePlus imp = new FolderOpener().openFolder( "/data/hanslovskyp/davi_toy_set/data/seq" );
// final ImagePlus imp = new ImagePlus( "/data/hanslovskyp/strip-example-small.tif" );
imp.show();
new ZPositionCorrection().run( "" );
}
示例2: getBatchImages
import ij.plugin.FolderOpener; //导入依赖的package包/类
public static String[] getBatchImages(String directory)
{
if (directory == null)
return null;
// Get a list of files
File[] fileList = (new File(directory)).listFiles();
if (fileList == null)
return null;
// Exclude directories
String[] list = new String[fileList.length];
int c = 0;
for (int i = 0; i < list.length; i++)
if (fileList[i].isFile())
list[c++] = fileList[i].getName();
list = Arrays.copyOf(list, c);
// Now exclude non-image files as per the ImageJ FolderOpener
FolderOpener fo = new FolderOpener();
list = fo.trimFileList(list);
if (list == null)
return null;
list = fo.sortFileList(list);
// Now exclude mask images
c = 0;
for (String name : list)
{
if (name.contains("mask."))
continue;
list[c++] = name;
}
return Arrays.copyOf(list, c);
}
示例3: getFileFromOption
import ij.plugin.FolderOpener; //导入依赖的package包/类
public static ImagePlus getFileFromOption( final String path )
{
return path.equals( "" ) ? IJ.getImage() : ( new File( path ).isDirectory() ? FolderOpener.open( path ) : new ImagePlus( path ) );
}