Package org.cellprofiler.imageset

Examples of org.cellprofiler.imageset.ImageFile


      ep.setSubpredicates(a);
      for (boolean testcase: new boolean [] {true, false}) {
        for (String filename:(testcase? pos:neg)) {
          File rootFile = new File(System.getProperty("user.home"));
          File testFile = new File(rootFile, filename);
          ImageFile imageFile = new ImageFile(testFile.toURI());
          assertEquals(ep.eval(imageFile), testcase);
        }
      }
    } catch (BadFilterExpressionException e) {
      fail();
View Full Code Here


  @Test
  public void testEvalFile() {
    FileNamePredicate pred = new FileNamePredicate();
    try {
      pred.setSubpredicates(Expects.expects("foo.jpg"));
      ImageFile imgfile = new ImageFile(new URI("file:///imaging/analysis/foo.jpg"));
      pred.eval(imgfile);
    } catch (BadFilterExpressionException e) {
      fail("File predicate takes a subpredicate");
    } catch (URISyntaxException e) {
      fail();
View Full Code Here

  @Test
  public void testEvalHTTP() {
    FileNamePredicate pred = new FileNamePredicate();
    try {
      pred.setSubpredicates(Expects.expects("bar.jpg"));
      ImageFile imgfile = new ImageFile(new URI("http://www.cellprofiler.org/linked_files/bar.jpg"));
      pred.eval(imgfile);
    } catch (BadFilterExpressionException e) {
      fail("File predicate takes a subpredicate");
    } catch (URISyntaxException e) {
      fail();
View Full Code Here

  @Test
  public void testEvalOMERO() {
    FileNamePredicate pred = new FileNamePredicate();
    try {
      pred.setSubpredicates(Expects.expects("iid=12345"));
      ImageFile imgfile = new ImageFile(new URI("omero:iid=12345"));
      pred.eval(imgfile);
    } catch (BadFilterExpressionException e) {
      fail("File predicate takes a subpredicate");
    } catch (URISyntaxException e) {
      fail();
View Full Code Here

    File root = new File(System.getProperty("user.home"));
    File fileAtPath = new File(root, "foo.jpg");
    String expectedPath = root.getAbsolutePath();
    try {
      pred.setSubpredicates(Expects.expects(expectedPath));
      ImageFile imgfile = new ImageFile(fileAtPath.toURI());
      pred.eval(imgfile);
    } catch (BadFilterExpressionException e) {
      fail("Path predicate takes a subpredicate.");
    }
  }
View Full Code Here

  @Test
  public void testEvalHTTP() {
    PathPredicate pred = new PathPredicate();
    try {
      pred.setSubpredicates(Expects.expects("http://www.cellprofiler.org/linked_files"));
      ImageFile imgfile = new ImageFile(new URI("http://www.cellprofiler.org/linked_files/bar.jpg"));
      pred.eval(imgfile);
    } catch (BadFilterExpressionException e) {
      fail("Path predicate takes a subpredicate.");
    } catch (URISyntaxException e) {
      // TODO Auto-generated catch block
View Full Code Here

   * @param url construct an ImageFile based on this URL
   * @return true to keep, false to filter out
   * @throws BadFilterExpressionException if the expression cannot be parsed
   */
  static public boolean filter(String expression, URI url) throws BadFilterExpressionException {
    return filter(expression, new ImageFile(url), ImageFile.class);
  }
View Full Code Here

TOP

Related Classes of org.cellprofiler.imageset.ImageFile

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.