Skip to content

Commit

Permalink
Allow to specify axis along which annotation profile projection is done
Browse files Browse the repository at this point in the history
  • Loading branch information
urubens committed Jul 8, 2020
1 parent c94cf2b commit 80024b4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cytomine-uliege-js-client",
"version": "1.1.2",
"version": "1.1.3",
"description": "Client to communicate with Cytomine API in javascript. For more information about Cytomine, go to http://www.cytomine.org.",
"browser": "dist/cytomine-client.min.js",
"unpkg": "dist/cytomine-client.min.js",
Expand Down
10 changes: 6 additions & 4 deletions src/models/annotation.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,13 @@ export default class Annotation extends Model {

/**
* Get the projections of the annotation profile, if available.
*
*
* @param {null|string} axis The axis along which the projection is performed. If null, use highest order axis
* @param {boolean} cache True if the result must be cached in the annotation object.
*
*
* @returns {Object} The annotation profile projection
*/
async fetchProfileProjections(cache=false) {
async fetchProfileProjections(axis= null, cache= false) {
if(this.isNew()) {
throw new Error('Cannot get profile for an annotation with no ID.');
}
Expand All @@ -121,7 +122,8 @@ export default class Annotation extends Model {
return this._profileProjections;
}
else {
let {data} = await Cytomine.instance.api.get(`${this.callbackIdentifier}/${this.id}/profile/projections.json`);
let {data} = await Cytomine.instance.api.get(`${this.callbackIdentifier}/${this.id}/profile/projections.json`,
{params: {axis}});
if (cache) {
this._profileProjections = data;
}
Expand Down

0 comments on commit 80024b4

Please sign in to comment.