Move towards NPM for Cornerstone dependencies

This commit is contained in:
Erik Ziegler committed 2017-06-15 09:18:54 +02:00
1 parent 6c98c6a589
commit ddef3c4710
59 files changed
+2435 -29162

No files matched your search

File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+2 -2
View File
@@ -1,4 +1,4 @@
import { Cornerstone } from '../namespace';
import { OHIF } from '../namespace';
import { MetadataProvider } from './lib/classes/MetadataProvider';
Cornerstone.metadataProvider = new MetadataProvider();
OHIF.cornerstone.metadataProvider = new MetadataProvider();
@@ -1,33 +0,0 @@
(function(factory) {
if (typeof define === 'function' && define.amd) {
define(['jquery', 'hammerjs'], factory);
} else if (typeof exports === 'object') {
factory(require('jquery'), require('hammerjs'));
} else {
factory(jQuery, Hammer);
}
}(function($, Hammer) {
function hammerify(el, options) {
var $el = $(el);
if(!$el.data("hammer")) {
$el.data("hammer", new Hammer($el[0], options));
}
}
$.fn.hammer = function(options) {
return this.each(function() {
hammerify(this, options);
});
};
// extend the emit method to also trigger jQuery events
Hammer.Manager.prototype.emit = (function(originalEmit) {
return function(type, data) {
originalEmit.call(this, type, data);
$(this.element).trigger({
type: type,
gesture: data
});
};
})(Hammer.Manager.prototype.emit);
}));
@@ -1,3 +1,4 @@
import * as cornerstoneMath from 'cornerstone-math';
import { parsingUtils } from '../parsingUtils';
const FUNCTION = 'function';
@@ -245,22 +246,17 @@ export class MetadataProvider {
}
return {
frameOfReferenceUID:
instance.frameOfReferenceUID,
rows:
instance.rows,
columns:
instance.columns,
frameOfReferenceUID: instance.frameOfReferenceUID,
rows: instance.rows,
columns: instance.columns,
rowCosines:
new cornerstoneMath.Vector3(parseFloat(imageOrientation[0]), parseFloat(imageOrientation[1]), parseFloat(imageOrientation[2])),
columnCosines:
new cornerstoneMath.Vector3(parseFloat(imageOrientation[3]), parseFloat(imageOrientation[4]), parseFloat(imageOrientation[5])),
imagePositionPatient:
new cornerstoneMath.Vector3(parseFloat(imagePosition[0]), parseFloat(imagePosition[1]), parseFloat(imagePosition[2])),
rowPixelSpacing:
rowPixelSpacing,
columnPixelSpacing:
columnPixelSpacing,
rowPixelSpacing,
columnPixelSpacing,
};
}
@@ -318,7 +314,7 @@ export class MetadataProvider {
}
/**
* Get a bound reference to the privider function.
* Get a bound reference to the provider function.
*/
getProvider() {
let provider = this._provider;
@@ -1,6 +1,4 @@
/**
* Globals: dicomParser
*/
import * as dicomParser from 'dicom-parser';
/**
* A small set of utilities to help parsing DICOM element values.
+18 -2
View File
@@ -2,7 +2,7 @@
* Import namespace...
*/
import { OHIF, Cornerstone } from './namespace.js';
import { OHIF } from './namespace.js';
/**
* Import scripts that will populate the Cornerstone namespace as a side effect only import. This is effectively the public API...
@@ -10,4 +10,20 @@ import { OHIF, Cornerstone } from './namespace.js';
import './client/'; // which is actually: import './client/index.js';
export { OHIF, Cornerstone };
import * as cornerstone from 'cornerstone-core';
import * as cornerstoneTools from 'cornerstone-tools';
import * as cornerstoneMath from 'cornerstone-math';
import * as cornerstoneWADOImageLoader from 'cornerstone-wado-image-loader';
import * as dicomParser from 'dicom-parser';
debugger;
export {
cornerstone,
cornerstoneTools,
cornerstoneMath,
cornerstoneWADOImageLoader,
dicomParser
};
export { OHIF };
+1 -1
View File
@@ -22,4 +22,4 @@ OHIF.cornerstone = Cornerstone;
* Export relevant objects
*/
export { OHIF, Cornerstone };
export { OHIF };
+13 -27
View File
@@ -4,45 +4,31 @@ Package.describe({
version: '0.0.1'
});
Npm.depends({
'hammerjs': '2.0.8',
'jquery-hammerjs': '2.0.0',
'cornerstone-core': '0.11.0',
'cornerstone-tools': '0.8.9',
'cornerstone-math': '0.1.6',
'dicom-parser': '1.7.5',
'cornerstone-wado-image-loader': '0.14.6'
});
Package.onUse(function(api) {
api.versionsFrom('1.4');
api.versionsFrom('1.5');
api.use('ecmascript');
api.use('jquery');
api.use('ohif:core');
api.addFiles('client/cornerstone.js', 'client', {
bare: true
});
api.addFiles('client/cornerstoneMath.js', 'client', {
bare: true
});
api.addFiles('client/cornerstoneTools.js', 'client', {
bare: true
});
api.addFiles('client/cornerstoneWADOImageLoader.js', 'client', {
bare: true
});
api.addFiles('client/dicomParser.js', 'client', {
bare: true
});
api.addFiles('client/hammer.js', 'client', {
bare: true
});
api.addFiles('client/jquery.hammer.js', 'client', {
bare: true
});
api.addAssets('public/js/cornerstoneWADOImageLoaderCodecs.es5.js', 'client');
api.addAssets('public/js/cornerstoneWADOImageLoaderWebWorker.es5.js', 'client');
api.mainModule('main.js', 'client');
api.export('cornerstone', 'client');
api.export('cornerstoneMath', 'client');
api.export('cornerstoneTools', 'client');
api.export('cornerstoneWADOImageLoader', 'client');
api.export('dicomParser', 'client');
api.mainModule('main.js', 'client');
});