GithubHelp home page GithubHelp logo

ashishpadw / cytomine-java-client Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cytomine/cytomine-java-client

0.0 0.0 0.0 762 KB

Cytomine Java client

License: Apache License 2.0

Shell 0.86% Java 97.86% Groovy 1.02% Dockerfile 0.27%

cytomine-java-client's Introduction

Cytomine Java client

When using our software, we kindly ask you to cite our website url and related publications in all your work (publications, studies, oral presentations,...). In particular, we recommend to cite (Marée et al., Bioinformatics 2016) paper, and to use our logo when appropriate. See our license files for additional details.

Presentation

Cytomine-java-client is an opensource Cytomine client. It is a JAR file that you can import in your JVM application (Java, Groovy, …). You will be able to manage data in a Cytomine instance according to your credentials: manage users, add annotations, upload images,... For more information about Cytomine, go to http://www.cytomine.be

Requirements:

  • Java 1.7+
  • Maven 2+ (only if you need to build a new Jar)

Binaries: https://github.com/cytomine/cytomine-java-client/releases

Source code: https://github.com/cytomine/cytomine-java-client

See installation instructions here : https://doc.cytomine.org/dev-guide/clients/java/installation

How to build the Java-client

On the project root directory, run this command:

mvn package

This will build the client and produce two jars in the target directory.

How to import the Java-client

Version higher than 2.2.13 are available in the Maven central repository.

Maven

<dependency>
    <groupId>be.cytomine.client</groupId>
    <artifactId>cytomine-java-client</artifactId>
    <version>2.2.13</version>
</dependency>

Gradle

implementation group: 'be.cytomine.client', name: 'cytomine-java-client', version: '2.2.13'

Groovy with Grape

import be.cytomine.client.models.Ontology

@Grab('be.cytomine.client:cytomine-java-client:2.2.13')

Ontology ontology = new Ontology();
...

How to use the Java-client

You need 3 paramters:

  • CYTOMINE_URL: The full URL of the Cytomine core (“http://...cytomine.be”).
  • PUBLIC_KEY: Your cytomine public key.
  • PRIVATE_KEY: Your cytomine private key.

You first need to init the connection object:

Cytomine cytomine = new Cytomine(CYTOMINE_URL, PUBLIC_KEY, PRIVATE_KEY);

Here is a sample code that should print “Hello ” with your Cytomine username and print the list of projects available.

import be.cytomine.client.*
import be.cytomine.client.models.*
import be.cytomine.client.collections.*

Cytomine cytomine = new Cytomine(CYTOMINE_URL, PUBLIC_KEY, PRIVATE_KEY);
System.out.println("Hello " + cytomine.getCurrentUser().get("username"));
System.out.println("******* You have access to these projects: *******");
ProjectCollection projects = cytomine.getProjects();
for(int i=0;i<projects.size();i++) {
    Project project = projects.get(i);
    System.out.println(project.get("name"));
}

cytomine-java-client's People

Contributors

geektortoise avatar urubens avatar loic911 avatar g-michiels avatar gvissers13 avatar rmaree avatar clafouti avatar dependabot[bot] avatar danyfel80 avatar pkainz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.