Skip to content

Commit

Permalink
Merge branch 'release'
Browse files Browse the repository at this point in the history
  • Loading branch information
tdiprima committed May 15, 2018
2 parents 35e54e9 + 7330833 commit 7e14f78
Show file tree
Hide file tree
Showing 165 changed files with 59,707 additions and 8,754 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,9 @@
.DS_Store
.DS_Store/*

# Test node modules
node_modules
node_modules/*
test/node_modules
test/node_modules/*
test/package-lock.json
21 changes: 21 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
sudo: required
services:
- nodejs
language: php
node_js:
- "8"
before_install:
- mkdir ../js
- cp test/__config.js ../js/config.js
- touch ../authenticate.php
- which php
install:
- npm install
- npm install -g mocha
before_script:
- cd test
- node test_server.js &
- cd ..
script:
- mocha js/Helpers/test --recursive
- mocha test/functional_tests.js
83 changes: 23 additions & 60 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,82 +1,45 @@

caMicroscope - A Web Based Annotation and Visualization Platform for Digitized Whole Slide Images
# caMicroscope
## A Web Based Annotation and Visualization Platform for Digitized Whole Slide Images

Ameen Kazerouni <[email protected]>

Ashish Sharma <[email protected]>

[Ganesh Iyer](http://ganeshiyer.net) <[email protected]>

Sanjay Agravat <[email protected]>

Shaohuan Li <[email protected]>

============

About
-------
GSOC Bio-medical Image Viewer Project is a HTML5 image viewer optimized for large bio-medical image data viewing.
#### Develop branch build status:
[![Build Status](https://travis-ci.org/camicroscope/caMicroscope.svg?branch=develop)](https://travis-ci.org/camicroscope/caMicroscope)

The Image Viewer server is based on the IIPImage server(http://iipimage.sourceforge.net/) which is an Fast CGI modeule written in C++ and IIPMooviewer-2.0(https://github.com/ruven/iipmooviewer) which is a HTML5 Ajax-based javascript image streaming client developed by Ruven.

This project forcuses on SVG annotation development, HTML5 canvas implementation and database design for viewing large Bio-Medical image data.
## About

Prerequisite
--------
The IIPImage server(http://iipimage.sourceforge.net/) will have to be installed in the server.
caMicroscope is a HTML5 image viewer optimized for large bio-medical image data viewing, with a strong emphasis on cancer pathology.

Apache or lighttpd web server will need to be installed as well.
The Image Viewer server is based on [IIPImage server](http://iipimage.sourceforge.net/) which is a Fast CGI module and [OpenSeaDragon](https://openseadragon.github.io/) which is a deep zoom image viewer.

PHP5 will be needed to handle the annotation saving function.

Features
--------
## Usage

*HTML5 Canvas Markup Drawing. Rectangle tool,ellipse tool, pencil tool, polyline tool, measurement tool and magnifying tool have been developed.
caMicroscope should be deployed as part of a stack; for further information see the [caMicroscope distribution repository](https://github.com/camicroscope/Distro).

*SVG Markup Displaying. The image markups are displayed as SVG(Scalable Vector Graphics) images which preserve good resolutions for different sizes of views
## Core Features

*Annotation/Markup data saving. The markups/annotations will be saved to the database using PHP scripts via Ajax calls.
* Variable resolution browser rendering of slide images of multiple formats

Specifications
--------------
* Segmentation analysis on user-selected regions

js/annotools.js is the main outcome of this project. It is an independent annotation module which allows users to draw markups/annotations on the image viewer.The annotation annotools object will need to be associated with a div tag id and a container id to run the tools smoothly.
An example would be like http://170.140.138.125/view.html. The annotools only work for HTML5 enabled browsers.
* Annotation drawing and sharing

css/annotools.css and the svg imges in the images folder are associated with the annotools.js.

js/iipmooviewer-2.0.js is the orignial IIPMooViewer with some customization. One big change is to add a displayAnnotation funciton in the requestImages function inside the IIPMooViewer class. Some small changes would be like the adjustment of the navigation window size.

js/mootools-more.js and mootools-core.js would be the latest mootools framework.

js/main.js is the image meta data handler. js/moreImages.js is the bottom slider which will display the image meta data more conveniently.

api/annot.php is for saving and getting annotation meta.
api/annot.txt is the file storing the annotation data. This file has to be set as readable/writable to the public.

api/image.php is the php script to get the image information from the database
api/annotation.php is the PHP script to get the annotation info from the database
api/state.php is to save the state of the viewer. The developers would be using zoomTo(zoom) and moveTo(left,top) to navigate to the saved state.

view.html is for annotation saving without connecting to the database.You may test it here:http://170.140.138.125/view.html

index.html and viewer.html is for the image viewer which is connected to the database. You may test it here.http://170.140.138.125
## Contributors
Ameen Kazerouni <[email protected]>

schema.sql is the database schema
Alina Jasniewski

Database Module
---------------
Ashish Sharma <[email protected]>

One approach for saving annotations is to use databases. As the annotations will be associated with a particular image, the annotations will have to contain one foreign key referencing the image id.
Feiqiao "Bridge" Wang

[Ganesh Iyer](http://ganeshiyer.net) <[email protected]>

Image MetaData Viewing Module
-----------------------------
[Ryan Birmingham](http://rbirm.us) <[email protected]>

The metadata is displayed as unsorted list on the bottom of the image viewer. This utilizes the tween function in Mootools. One example can be shown in viewer.html
Sanjay Agravat <[email protected]>

Image Uploading Module
-----------------------------
This is handled by uploader.html and uploader.php. The images will by default be saved to the /usr/share/iip folder.
Shaohuan Li <[email protected]>

Tammy DiPrima
40 changes: 35 additions & 5 deletions api/Configuration/config.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,28 @@
<?php

$baseUrl = "http://quip-data:9099";
$kueUrl = "http://quip-jobs:3000";
if (file_exists('../../../config.php')) {
$config = require '../../../config.php';
}
else {
$config = ['dataHost' => 'quip-data:9099',
'kueHost' => 'quip-jobs:3000'];
}


$baseUrl = "http://" . $config['dataHost'];
$kueUrl = "http://" . $config['kueHost'];

$serviceUrl = "$baseUrl/services/Camicroscope_DataLoader";
$annotationsUrl = "$baseUrl/services/Camicroscope_Annotations";

if (isset($_SESSION['db_name']) && !empty($_SESSION['db_name'])) {

if ($_SESSION["db_name"] == "quip_comp"){
$serviceUrl = "$baseUrl/services/Camicroscope_DataLoader_comp";
$annotationsUrl = "$baseUrl/services/Camicroscope_Annotations_comp";
}
}

$u24_userUrl = "$baseUrl/services/u24_user";
$imageUrl = "$serviceUrl/DataLoader";
$lymphocyteUrl = "$baseUrl/services/Camicroscope_Lymphocyte";
Expand All @@ -28,6 +46,7 @@
/*
* temp
*/
'getOverlayTiles' => "$baseUrl/services/TileOverlay/Tiles/query/getTileLocation?",
'algorithmsForImage' => "$annotationsUrl/MarkupsForImages/query/MarkupsAvilableForImage?",
'getMultipleAnnotations' => "$annotationsUrl/MarkupLoader/query/getMultipleMarkups?",
'getROI' => "$annotationsUrl/MarkupLoader/query/getROI", //Featurescape URL.
Expand All @@ -53,6 +72,8 @@
'postDataForLymphocytes' => "$lymphocyteUrl/DataForLymphocytes/submit/json?",
'getLymphocyteData' => "$lymphocyteUrl/DataForLymphocytes/query/getLymphocytes?",
'getLymphocyteDataByCaseId' => "$lymphocyteUrl/DataForLymphocytes/query/getLymphocytesByCaseId?",
'postDataForHeatmap' => "$lymphocyteUrl/HeatmapData/submit/json?",
'getHeatmapData' => "$lymphocyteUrl/HeatmapData/query/getQualHeatmapByCaseidExecid?",

/* Lymphocyte Superusers */
'postSuperuserForLymphocytes' => "$lymphocyteUrl/LymphocyteUsers/submit/json?",
Expand All @@ -77,26 +98,35 @@

/* Template */
'retrieveTemplate' => "$templateUrl/AnnotationTemplate/query/retrieveTemplate",
'retrieveTemplateClone' => "$templateUrl/AnnotationTemplate/query/retrieveTemplateClone",
'retrieveTemplateByName' => "$templateUrl/AnnotationTemplate/query/retrieveTemplateByName",

/* u24_user */
'findUserByName' => "$u24_userUrl/user_data/query/findUserByName?",
'findUserByEmail' => "$u24_userUrl/user_data/query/findUserByEmail?",
'findUser' => "$u24_userUrl/user_data/query/findUser?",
'findAdmin' => "$u24_userUrl/user_data/query/findAdmin?",
'findAllBindaasUsers'=>"$u24_userUrl/user_data/query/findAllBindaasUsers?",
'findSuperUserCount'=>"$u24_userUrl/user_data/query/findSuperUserCount?",

'deleteUserByName' => "$u24_userUrl/user_data/delete/deleteUserByName?",
'deleteUserByEmail'=> "$u24_userUrl/user_data/delete/deleteUserByEmail?",
'postUser' => "$u24_userUrl/user_data/submit/json",
'setUserType' => "$u24_userUrl/user_data/delete/setUserType?",


/* Image */
'getDimensions' => "$imageUrl/query/getDimensionsByIID?api_key=",
'getFileLocation' => "$imageUrl/query/getFileLocationByIID?api_key=",
//'getTileLocation' => "$imageUrl/query/getTileLocationByIID?api_key=",
'getMPP' => "$imageUrl/query/getMPPByIID?api_key=",
'getImageInfoByCaseID'=> "$imageUrl/query/getImageInfoByCaseID?api_key=",
'fastcgi_server' => "../fcgi-bin/iipsrv.fcgi",
'fastcgi_server' => "/fcgi-bin/iipsrv.fcgi",
'imageStatusUpdate'=> "$imageUrl/delete/imageStatusUpdate?",
'getImageStatus'=> "$imageUrl/query/getImageStatusByCaseID?api_key=",
'getImageAssignTo'=> "$imageUrl/query/getImageAssignToByCaseID?api_key=",
'imageAssignTo'=> "$imageUrl/delete/imageAssignTo?",

/* Dynamic Services */
/* Dynamic Services */
'postWorkOrder' => "$dynamicServices/WorkOrders/submit/json",
'kueUrl' => $kueUrl
);
Expand Down
153 changes: 86 additions & 67 deletions api/Data/CamicUtils.php
Original file line number Diff line number Diff line change
@@ -1,40 +1,64 @@
<?php

class CamicUtils
{
public $CONFIG;
public $api_key;
function __construct($Session)
{
include_once("RestRequest.php");
$this->CONFIG = require '../Configuration/config.php';
$this->api_key = $Session['api_key'];
}
public $CONFIG;
public $api_key;

function __construct($Session)
{
include_once("RestRequest.php");
$this->CONFIG = require '../Configuration/config.php';
$this->api_key = trim($Session['api_key']);
}

function getImageDimensions($tissueId)
{
$dimensionsUrl = $this->CONFIG['getDimensions'] . $this->api_key . "&TCGAId=" . $tissueId;
$getDimensionRequest = new RestRequest($dimensionsUrl, 'GET');
$getDimensionRequest->execute();
$dimensionList = json_decode($getDimensionRequest->responseBody);
$finalDimensions;

function getImageDimensions($tissueId)
foreach ($dimensionList as $singleDimension) {
$finalDimensions = $singleDimension;
break;
}
return $finalDimensions;
}

function retrieveImageLocation($tissueId)
{
$fileUrl = $this->CONFIG['getFileLocation'] . $this->api_key . "&TCGAId=" . $tissueId;
$fileUrl = str_replace(" ", "%20", $fileUrl);
$getFileLocationRequest = new RestRequest($fileUrl, 'GET');
$getFileLocationRequest->execute();
$location = json_decode($getFileLocationRequest->responseBody);
return $location;
}

function retrieveImageStatus($tissueId)
{
$dimensionsUrl = $this->CONFIG['getDimensions'] . $this->api_key . "&TCGAId=" . $tissueId;
$getDimensionRequest = new RestRequest($dimensionsUrl, 'GET');
$getDimensionRequest->execute();
$dimensionList = json_decode($getDimensionRequest->responseBody);
$finalDimensions;
foreach($dimensionList as $singleDimension)
{
$finalDimensions = $singleDimension;
break;
}
return $finalDimensions;
$statusUrl = $this->CONFIG['getImageStatus'] . $this->api_key . "&TCGAId=" . $tissueId;
$statusUrl = str_replace(" ","%20",$statusUrl);
$getImageStatusRequest = new RestRequest($statusUrl,'GET');
$getImageStatusRequest->execute();
$status = json_decode($getImageStatusRequest->responseBody);
return $status;
}
function retrieveImageLocation($tissueId)

function retrieveImageAssignTo($tissueId)
{
$fileUrl = $this->CONFIG['getFileLocation'] . $this->api_key . "&TCGAId=" . $tissueId;
$fileUrl = str_replace(" ","%20",$fileUrl);
$getFileLocationRequest = new RestRequest($fileUrl,'GET');
$getFileLocationRequest->execute();
$location = json_decode($getFileLocationRequest->responseBody);
return $location;
$statusUrl = $this->CONFIG['getImageAssignTo'] . $this->api_key . "&TCGAId=" . $tissueId;
//print_r($statusUrl);
$statusUrl = str_replace(" ","%20",$statusUrl);
$getImageAssignToRequest = new RestRequest($statusUrl,'GET');
$getImageAssignToRequest->execute();
$AssignTo = json_decode($getImageAssignToRequest->responseBody);
//print_r($AssignTo);
return $AssignTo;
}


function retrieveMpp($tissueId)
{
$mppUrl = $this->CONFIG['getMPP'] . $this->api_key . "&TCGAId=" . $tissueId;
Expand All @@ -49,46 +73,41 @@ function retrieveMpp($tissueId)
break;
}

return $finalMPP;
}
return $finalMPP;
}

function setUpSymLinks($fileLocation)
{
foreach($fileLocation[0] as $key => $value)
{
$path = "/tmp/symlinks/" . session_id();
if(!is_dir($path))
{
mkdir($path);
}
$file = strrchr($value, '/');
$fileNameWithoutExtension = substr($file,0,-5);
if(is_dir($path . $fileNameWithoutExtension))
{
$link = $path . $fileNameWithoutExtension . $file . ".dzi";
}

else
{
mkdir($path . $fileNameWithoutExtension);
$file = $path . $fileNameWithoutExtension . $file;
symlink($value, $file);
symlink($file, $file . ".dzi");
$link = $file . ".dzi";
}
}

return $link;
}
function setUpSymLinks($fileLocation)
{
foreach ($fileLocation[0] as $key => $value) {
$path = "/tmp/symlinks/" . session_id();
if (!is_dir($path)) {
mkdir($path);
}

function setUpSVSImage($fileLocation)
{
foreach($fileLocation[0] as $key => $value)
{
$link = str_replace("tiff","svs",$value);
$link = $link . ".dzi";
}
$file = strrchr($value, '/');
$fileNameWithoutExtension = substr($file, 0, -5);

return $link;
}
if (is_dir($path . $fileNameWithoutExtension)) {
$link = $path . $fileNameWithoutExtension . $file . ".dzi";
} else {
mkdir($path . $fileNameWithoutExtension);
$file = $path . $fileNameWithoutExtension . $file;
symlink($value, $file);
symlink($file, $file . ".dzi");
$link = $file . ".dzi";
}
}

return $link;
}

function setUpSVSImage($fileLocation)
{
foreach ($fileLocation[0] as $key => $value) {
$link = str_replace("tiff", "svs", $value);
$link = $link . ".dzi";
}

return $link;
}
}
Loading

0 comments on commit 7e14f78

Please sign in to comment.