Skip to content

Commit

Permalink
Merge branch 'release'
Browse files Browse the repository at this point in the history
Hotfix 278
  • Loading branch information
tdiprima committed May 17, 2018
2 parents 96a1b9d + ee72164 commit 56bbc65
Showing 1 changed file with 39 additions and 20 deletions.
59 changes: 39 additions & 20 deletions js/annotationtools/osdAnnotationTools.js
Original file line number Diff line number Diff line change
Expand Up @@ -1388,36 +1388,55 @@ annotools.prototype.updateAnnot = function (annot) {
*/
annotools.prototype.saveAnnot = function (annotation) {
// console.log("Saving annotation");
// console.log("annotation", annotation)
// console.log("annotation", JSON.stringify(annotation));

region_type = annotation.properties.annotations.region;
//execution_id=annotation.provenance.analysis.execution_id;
var user = annotool.user;
if (region_type == "Tumor") {
var execution_id = user + "_Tumor_Region";
annotation.provenance.analysis.execution_id = execution_id;
}
if (region_type == "Non_Tumor") {
annotation.provenance.analysis.execution_id = user + "_Non_Tumor_Region";
}

var d = new Date();
var current_time = d.toLocaleString();
annotation.created_by = user;
annotation.created_on = current_time;
annotation.updated_by = '';
annotation.updated_on = '';
jQuery.ajax({
'type': 'POST',
url: 'api/Data/getAnnotSpatial.php',
data: annotation,
success: function (res, err) {
// console.log("response: ")
console.log(res);
console.log(err);
console.log('successfully posted')

region_type = annotation.properties.annotations.region;
if (typeof region_type !== 'undefined')
{
// Human Markup
if (region_type === "Tumor") {
annotation.provenance.analysis.execution_id = user + "_Tumor_Region";
}
});

if (region_type === "Non_Tumor") {
annotation.provenance.analysis.execution_id = user + "_Non_Tumor_Region";
}

jQuery.ajax({
'type': 'POST',
url: 'api/Data/getAnnotSpatial_sc.php',
data: annotation,
success: function (res, err) {
console.log(res);
console.log(err);
console.log('successfully posted')
}
});

}
else
{
// ROI, segmentation & feature extraction
jQuery.ajax({
'type': 'POST',
url: 'api/Data/getAnnotSpatial.php',
data: annotation,
success: function (res, err) {
console.log(res);
console.log(err);
console.log('successfully posted')
}
});
}

};

Expand Down

0 comments on commit 56bbc65

Please sign in to comment.