/** * Constructs a FileStitcher with the given reader. * @param r The reader to use for reading stitched files. * @param patternIds Whether string ids given should be treated as file * patterns rather than single file paths. */ public FileStitcher(IFormatReader r, boolean patternIds) { super(r); if (r.getClass().getPackage().getName().equals("loci.formats.in")) { ClassList<IFormatReader> classes = new ClassList<IFormatReader>(IFormatReader.class); classes.addClass(r.getClass()); setReaderClassList(classes); } else { reader = DimensionSwapper.makeDimensionSwapper(r); } setUsingPatternIds(patternIds); }
/** * Constructs a FileStitcher with the given reader. * @param r The reader to use for reading stitched files. * @param patternIds Whether string ids given should be treated as file * patterns rather than single file paths. */ public FileStitcher(IFormatReader r, boolean patternIds) { super(r); if (r.getClass().getPackage().getName().equals("loci.formats.in")) { ClassList<IFormatReader> classes = new ClassList<IFormatReader>(IFormatReader.class); classes.addClass(r.getClass()); setReaderClassList(classes); } else { reader = DimensionSwapper.makeDimensionSwapper(r); } setUsingPatternIds(patternIds); }
@Override protected void initFile(String id) throws FormatException, IOException { // read the pattern from the file // the file should just contain a single line with the relative or // absolute file pattern currentId = new Location(id).getAbsolutePath(); String pattern = DataTools.readFile(id).trim(); String dir = new Location(id).getAbsoluteFile().getParent(); if (new Location(pattern).getParent() == null) { pattern = dir + File.separator + pattern; } helper.setUsingPatternIds(true); helper.setCanChangePattern(false); helper.setId(pattern); core = helper.getCoreMetadataList(); }
@Override protected void initFile(String id) throws FormatException, IOException { // read the pattern from the file // the file should just contain a single line with the relative or // absolute file pattern currentId = new Location(id).getAbsolutePath(); String pattern = DataTools.readFile(id).trim(); String dir = new Location(id).getAbsoluteFile().getParent(); if (new Location(pattern).getParent() == null) { pattern = dir + File.separator + pattern; } helper.setUsingPatternIds(true); helper.setCanChangePattern(false); helper.setId(pattern); core = helper.getCoreMetadataList(); }
String pat = null; if (!f.exists()) { ((FileStitcher) reader).setUsingPatternIds(true); pat = id;
fileStitcher.setUsingPatternIds(true); fileStitcher.setCanChangePattern(false);
fileStitcher.setUsingPatternIds(true); fileStitcher.setCanChangePattern(false);