├── .gitattributes ├── .gitignore ├── DICOMwebJS ├── DICOMwebJS.csproj ├── Proxies │ ├── DelowRsProxy.ts │ ├── MimeTypes.ts │ ├── QidoRsProxy.ts │ ├── ServerConfiguration.ts │ ├── StowRsProxy.ts │ ├── WadoRsProxy.ts │ └── WadoUriProxy.ts ├── Scripts │ └── typings │ │ └── jquery │ │ └── jquery.d.ts ├── Types │ ├── DicomElement.ts │ ├── DicomModuleBase.ts │ ├── DicomSourceProvider.ts │ ├── DicomTag.ts │ ├── DicomTags.ts │ ├── DicomVR.ts │ ├── ImageModule.ts │ └── PersonName.ts ├── Utils │ └── StringExtensions.ts ├── packages.config ├── tsconfig.json ├── web.Debug.config ├── web.Release.config └── web.config ├── Demo.sln ├── Demo ├── .deployment ├── App_Start │ ├── BundleConfig.cs │ ├── BundleDemo.cs │ ├── FilterConfig.cs │ └── RouteConfig.cs ├── Content │ ├── bootstrap-theme.css │ ├── bootstrap-theme.css.map │ ├── bootstrap-theme.min.css │ ├── bootstrap-theme.min.css.map │ ├── bootstrap.css │ ├── bootstrap.css.map │ ├── bootstrap.min.css │ ├── bootstrap.min.css.map │ ├── cornerstone.min.css │ ├── demo.css │ └── img │ │ └── clippy.svg ├── Controllers │ └── DemoController.cs ├── Demo.csproj ├── Global.asax ├── Global.asax.cs ├── JSLib │ ├── Query │ │ ├── QueryController.js │ │ ├── QueryController.js.map │ │ ├── QueryController.ts │ │ ├── QueryModel.js │ │ ├── QueryModel.js.map │ │ ├── QueryModel.ts │ │ ├── QueryPageModel.js │ │ ├── QueryPageModel.js.map │ │ ├── QueryPageModel.ts │ │ ├── QueryPagerView.js │ │ ├── QueryPagerView.js.map │ │ ├── QueryPagerView.ts │ │ ├── QueryView.js │ │ ├── QueryView.js.map │ │ ├── QueryView.ts │ │ ├── RetrieveService.js │ │ ├── RetrieveService.js.map │ │ └── RetrieveService.ts │ ├── Store │ │ ├── StoreResultView.js │ │ ├── StoreResultView.js.map │ │ ├── StoreResultView.ts │ │ ├── StoreView.js │ │ ├── StoreView.js.map │ │ └── StoreView.ts │ ├── Types │ │ ├── CodeRenderer.js │ │ ├── CodeRenderer.js.map │ │ ├── CodeRenderer.ts │ │ ├── ILiteEvent.js │ │ ├── ILiteEvent.js.map │ │ ├── ILiteEvent.ts │ │ ├── ModelDialog.js │ │ ├── ModelDialog.js.map │ │ ├── ModelDialog.ts │ │ ├── QidoRsEventArgs.js │ │ ├── QidoRsEventArgs.js.map │ │ ├── QidoRsEventArgs.ts │ │ ├── RsFramesEventArgs.js │ │ ├── RsFramesEventArgs.js.map │ │ ├── RsFramesEventArgs.ts │ │ ├── RsInstanceEventArgs.ts │ │ ├── StudyEventArgs.js │ │ ├── StudyEventArgs.js.map │ │ ├── StudyEventArgs.ts │ │ ├── WadoUriEventArgs.js │ │ ├── WadoUriEventArgs.js.map │ │ ├── WadoUriEventArgs.ts │ │ ├── fileReaderAsync.js │ │ ├── fileReaderAsync.js.map │ │ ├── fileReaderAsync.ts │ │ ├── rsinstanceeventargs.js │ │ └── rsinstanceeventargs.js.map │ ├── appUtils.js │ ├── appUtils.js.map │ ├── appUtils.ts │ ├── copyImageUrlView.js │ ├── copyImageUrlView.js.map │ ├── copyImageUrlView.ts │ ├── demo.js │ ├── demo.js.map │ ├── demo.ts │ ├── uids.js │ ├── wadoViewer.js │ ├── wadoViewer.js.map │ └── wadoViewer.ts ├── Models │ ├── AppSettings.cs │ ├── MimeTypes.cs │ ├── ServersViewModel.cs │ └── ToolbarViewModel.cs ├── Project_Readme.html ├── Properties │ ├── AssemblyInfo.cs │ └── PublishProfiles │ │ ├── DICOMwebDemo.pubxml │ │ └── dicomwebdemo-dev - Web Deploy.pubxml ├── Scripts │ ├── DICOMwebJS.js │ ├── _references.js │ ├── bootstrap.js │ ├── bootstrap.min.js │ ├── cornerstone │ │ ├── cornerstoneWADOImageLoaderCodecs.js │ │ ├── cornerstoneWADOImageLoaderCodecs.min.js │ │ ├── cornerstoneWADOImageLoaderWebWorker.js │ │ └── cornerstoneWADOImageLoaderWebWorker.min.js │ ├── jquery-2.2.4.intellisense.js │ ├── jquery-2.2.4.js │ ├── jquery-2.2.4.min.js │ ├── jquery-2.2.4.min.map │ ├── jquery.json-viewer.js │ ├── jquery.validate-vsdoc.js │ ├── jquery.validate.js │ ├── jquery.validate.min.js │ ├── jquery.validate.unobtrusive.js │ ├── jquery.validate.unobtrusive.min.js │ ├── modernizr-2.6.2.js │ ├── respond.js │ ├── respond.min.js │ └── typings │ │ ├── DICOMwebJS │ │ └── DICOMwebJS.d.ts │ │ ├── ace │ │ └── index.d.ts │ │ ├── bootstrap │ │ └── bootstrap.d.ts │ │ ├── jquery │ │ └── jquery.d.ts │ │ └── libs │ │ ├── html.js │ │ ├── html.ts │ │ └── viewers.d.ts ├── Views │ ├── Demo │ │ ├── Index.cshtml │ │ ├── _AlertDlg.cshtml │ │ ├── _ImageViewer.cshtml │ │ ├── _InstanceItem.cshtml │ │ ├── _ItemDetailsToolbar.cshtml │ │ ├── _QueryFieldsView.cshtml │ │ ├── _SeriesItem.cshtml │ │ ├── _StoreAnonymizer.cshtml │ │ ├── _StoreResult.cshtml │ │ ├── _StoreView.cshtml │ │ ├── _StudyItem.cshtml │ │ ├── _StudyView.cshtml │ │ ├── _Toolbar.cshtml │ │ └── _cornerstoneViewer.cshtml │ ├── Shared │ │ ├── Error.cshtml │ │ ├── _CopyImageUrl.cshtml │ │ ├── _Layout.cshtml │ │ └── _Scripts.cshtml │ ├── Web.config │ └── _ViewStart.cshtml ├── Web.Debug.config ├── Web.Release.config ├── Web.config ├── deploy.cmd ├── dicomwebjs-demo.js ├── dicomwebjs-demo.js.map ├── favicon.ico ├── fonts │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.svg │ ├── glyphicons-halflings-regular.ttf │ ├── glyphicons-halflings-regular.woff │ └── glyphicons-halflings-regular.woff2 └── packages.config ├── README.md ├── Resources ├── Build │ ├── DICOMweb-js.bat │ ├── DICOMwebJS.Demo.sln │ ├── NuGet.exe │ └── demo │ │ ├── Content │ │ ├── bootstrap-theme.css │ │ ├── bootstrap-theme.css.map │ │ ├── bootstrap-theme.min.css │ │ ├── bootstrap-theme.min.css.map │ │ ├── bootstrap.css │ │ ├── bootstrap.css.map │ │ ├── bootstrap.min.css │ │ └── bootstrap.min.css.map │ │ ├── DICOMwebJS.Demo.csproj │ │ ├── DICOMwebJS.Demo.nuspec │ │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ └── PublishProfiles │ │ │ └── FolderProfile.pubxml │ │ ├── Scripts │ │ ├── bootstrap.js │ │ ├── bootstrap.min.js │ │ ├── jquery-3.1.1.intellisense.js │ │ ├── jquery-3.1.1.js │ │ ├── jquery-3.1.1.min.js │ │ ├── jquery-3.1.1.min.map │ │ ├── jquery-3.1.1.slim.js │ │ ├── jquery-3.1.1.slim.min.js │ │ ├── jquery-3.1.1.slim.min.map │ │ └── typings │ │ │ ├── ace │ │ │ └── index.d.ts │ │ │ ├── bootstrap │ │ │ └── index.d.ts │ │ │ └── jquery │ │ │ └── jquery.d.ts │ │ ├── Web.Debug.config │ │ ├── Web.Release.config │ │ ├── Web.config │ │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.svg │ │ ├── glyphicons-halflings-regular.ttf │ │ ├── glyphicons-halflings-regular.woff │ │ └── glyphicons-halflings-regular.woff2 │ │ └── packages.config └── Version │ ├── AssemblyInfo.Version.cs │ └── AssemblyInfo.Version.tt ├── dist ├── DICOMwebJS.d.ts ├── DICOMwebJS.js └── DICOMwebJS.js.map ├── gitOutput.txt └── license.txt /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /DICOMwebJS/Proxies/DelowRsProxy.ts: -------------------------------------------------------------------------------- 1 | class DelowRsProxy 2 | { 3 | public _baseUrl: string = ""; 4 | 5 | constructor(baseUrl: string = null) { 6 | this._baseUrl = baseUrl; 7 | } 8 | 9 | public get BaseUrl() { 10 | if (this._baseUrl === null) { 11 | return DICOMwebJS.ServerConfiguration.getDelowRsUrl(); 12 | } 13 | else 14 | { 15 | return this._baseUrl; 16 | } 17 | } 18 | 19 | public set BaseUrl(value: string) { 20 | this._baseUrl = value; 21 | } 22 | 23 | public deleteStudy(studyUID: string): JQueryPromise { 24 | var url = this.BaseUrl + "/studies/" + studyUID + "/"; //last part "/" is needed for proper routing 25 | let settings: JQueryAjaxSettings = { 26 | url: url, 27 | type: "DELETE" 28 | } 29 | 30 | if (DICOMwebJS.ServerConfiguration.IncludeAuthorizationHeader) { 31 | settings.headers = { "Authorization": DICOMwebJS.ServerConfiguration.SecurityToken }; 32 | } 33 | 34 | var deffered = $.Deferred(); 35 | 36 | $.ajax(settings).then( 37 | (data) => { 38 | return deffered.resolve(data); 39 | }, 40 | (jqxhr, textStatus, error) => { 41 | return deffered.reject(error); 42 | }); 43 | 44 | return deffered.promise(); 45 | } 46 | } -------------------------------------------------------------------------------- /DICOMwebJS/Proxies/MimeTypes.ts: -------------------------------------------------------------------------------- 1 | class MimeTypes 2 | { 3 | public static DICOM : string = "application/dicom"; 4 | public static xmlDicom : string = "application/dicom+xml"; 5 | public static Jpeg : string = "image/jpeg"; 6 | public static WebP : string = "image/webp"; 7 | public static Json : string = "application/dicom+json"; 8 | public static UncompressedData: string = "application/octet-stream"; 9 | public static PlainText: string = "text/plain"; 10 | public static MultipartRelated: string = "multipart/related"; 11 | 12 | public static getMultiPartAcceptHeader(mimeType: string): string 13 | { 14 | return "multipart/related; type=\"" + mimeType + "\""; 15 | } 16 | } -------------------------------------------------------------------------------- /DICOMwebJS/Proxies/ServerConfiguration.ts: -------------------------------------------------------------------------------- 1 | module DICOMwebJS { 2 | export module ServerConfiguration { 3 | export var BaseServerUrl: string; 4 | export var OhifViewerUrl: string; 5 | export var WadoUriPart: string = "wadouri"; 6 | export var WadoRsPart : string = "api"; 7 | export var StowPart: string = "api"; 8 | export var QidoPart: string = "api"; 9 | export var DelowRsPart: string = "api"; 10 | 11 | export var IncludeAuthorizationHeader: boolean = false; 12 | export var SecurityToken: string = ""; 13 | 14 | export function getWadoUriUrl(): string { 15 | return DICOMwebJS.ServerConfiguration.BaseServerUrl + DICOMwebJS.ServerConfiguration.WadoUriPart; 16 | } 17 | 18 | export function getWadoRsUrl(): string { 19 | return DICOMwebJS.ServerConfiguration.BaseServerUrl + DICOMwebJS.ServerConfiguration.WadoRsPart; 20 | } 21 | 22 | export function getStowUrl(): string { 23 | return DICOMwebJS.ServerConfiguration.BaseServerUrl + DICOMwebJS.ServerConfiguration.StowPart; 24 | } 25 | 26 | export function getQidoUrl(): string { 27 | return DICOMwebJS.ServerConfiguration.BaseServerUrl + DICOMwebJS.ServerConfiguration.QidoPart; 28 | } 29 | 30 | export function getDelowRsUrl(): string { 31 | return DICOMwebJS.ServerConfiguration.BaseServerUrl + DICOMwebJS.ServerConfiguration.DelowRsPart; 32 | } 33 | 34 | export function getOhifJsonEndpoint(studyInstanceUid: string): string 35 | { 36 | return DICOMwebJS.ServerConfiguration.BaseServerUrl + "/ohif/study/" + studyInstanceUid + "/series" 37 | } 38 | 39 | export function getOhifViewerUrl(studyInstanceUid: string): string 40 | { 41 | return DICOMwebJS.ServerConfiguration.OhifViewerUrl + "?url=" + 42 | DICOMwebJS.ServerConfiguration.getOhifJsonEndpoint(studyInstanceUid); 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /DICOMwebJS/Proxies/StowRsProxy.ts: -------------------------------------------------------------------------------- 1 | class StowRsProxy { 2 | public _baseUrl: string = ""; 3 | 4 | constructor(baseUrl: string = null) { 5 | this._baseUrl = baseUrl; 6 | } 7 | 8 | public get BaseUrl() { 9 | if (this._baseUrl === null) { 10 | return DICOMwebJS.ServerConfiguration.getStowUrl(); 11 | } 12 | else { 13 | return this._baseUrl; 14 | } 15 | } 16 | 17 | public set BaseUrl(value: string) { 18 | this._baseUrl = value; 19 | } 20 | 21 | private _returnJson: boolean = true; 22 | public get returnJson ( ) : boolean { return this._returnJson ; } 23 | public set returnJson( value : boolean ) { this._returnJson = value ; } 24 | 25 | StoreInstance 26 | ( 27 | fileBufferList: Array, 28 | studyInstanceUID: string, 29 | query:string 30 | ): JQueryPromise<{}> 31 | { 32 | var deffered = $.Deferred(); 33 | var studyPart = (studyInstanceUID) ? "/studies/" + studyInstanceUID : "/studies/"; 34 | var url = this.BaseUrl + studyPart + "?"+ (query||""); 35 | var xhr = new XMLHttpRequest(); 36 | var boundary = 'DICOM FILE'; 37 | var method = 'POST'; 38 | var acceptHeader = "application/json, application/dicom+xml; q=0.9, */*; q = 0.1"; //this will let the server favor json 39 | var url = url; 40 | var request = this.gen_multipart(" ", boundary, MimeTypes.DICOM, fileBufferList); 41 | var xhr = new XMLHttpRequest(); 42 | xhr.open(method, url, true); 43 | xhr.setRequestHeader("Content-Type", MimeTypes.getMultiPartAcceptHeader ( MimeTypes.DICOM ) + '; boundary="' + boundary + '"' ); 44 | xhr.setRequestHeader("accept", acceptHeader); //server also supports XML 45 | 46 | if (DICOMwebJS.ServerConfiguration.IncludeAuthorizationHeader) 47 | { 48 | xhr.setRequestHeader("Authorization", DICOMwebJS.ServerConfiguration.SecurityToken ); 49 | } 50 | 51 | xhr.onreadystatechange = function (data) { 52 | if (xhr.readyState == 4) { 53 | if (xhr.status == 200 || xhr.status == 304) { 54 | deffered.resolve(xhr); 55 | } 56 | else { 57 | deffered.reject( xhr); 58 | } 59 | } 60 | }; 61 | xhr.onerror = function (error) { 62 | deffered.reject(xhr); 63 | }; 64 | 65 | xhr.send(request); 66 | 67 | return deffered.promise(); 68 | } 69 | 70 | // 71 | //http://stackoverflow.com/questions/8262266/xmlhttprequest-multipart-related-post-with-xml-and-image-as-payload 72 | // 73 | private gen_multipart(title:string, boundary: string, mimetype: string, byteBufferList: Array) { 74 | 75 | 76 | var before = ["\r\n--", boundary, "\r\n", 'Content-Type:', mimetype, "\r\n\r\n"].join(''); 77 | var after = "\r\n--" + boundary + "--" ; 78 | var beforeArray : Uint8Array = new Uint8Array(before.length); 79 | var afterArray : Uint8Array = new Uint8Array(after.length); 80 | 81 | // Append the string. 82 | for (var i = 0; i < before.length; i++) { 83 | beforeArray[i] = before.charCodeAt(i) & 0xff; 84 | } 85 | 86 | // Append the remaining string 87 | for (var j = 0; j < after.length; j++) { 88 | afterArray[j] = after.charCodeAt(j) & 0xff; 89 | } 90 | 91 | var size = 0 92 | 93 | byteBufferList.forEach((byteBuffer: ArrayBuffer) => { 94 | size += before.length + byteBuffer.byteLength ; 95 | }); 96 | 97 | size += after.length; 98 | 99 | var uint8array = new Uint8Array(size); 100 | var offset = 0; 101 | 102 | for (var index = 0; index < byteBufferList.length; index++) 103 | { 104 | var buffer: Uint8Array = new Uint8Array(byteBufferList[index]); // Wrap in view to get data 105 | 106 | uint8array.set(beforeArray, offset) 107 | offset += beforeArray.byteLength; 108 | 109 | uint8array.set(buffer, offset); 110 | offset += buffer.byteLength; 111 | } 112 | 113 | uint8array.set(afterArray, offset); 114 | offset += afterArray.byteLength; 115 | 116 | return uint8array; // <-- This is an ArrayBuffer object! 117 | } 118 | } -------------------------------------------------------------------------------- /DICOMwebJS/Proxies/WadoUriProxy.ts: -------------------------------------------------------------------------------- 1 | class WadoUriProxy 2 | { 3 | private _xhr: XMLHttpRequest; 4 | private static _QueryParamsFormatted: string = "?RequestType=wado&studyUID={0}&seriesUID={1}&objectUID={2}" 5 | private _baseUrl: string = ""; 6 | 7 | constructor(baseUrl: string = null) { 8 | this._baseUrl = baseUrl; 9 | } 10 | 11 | public get BaseUrl() { 12 | if (this._baseUrl === null) { 13 | return DICOMwebJS.ServerConfiguration.getWadoUriUrl(); 14 | } 15 | else { 16 | return this._baseUrl; 17 | } 18 | } 19 | 20 | public set BaseUrl(value: string) 21 | { 22 | this._baseUrl = value; 23 | } 24 | 25 | //returns the DICOM DS 26 | getDicomInstance(instanceData: CommonDicomInstanceParams, anonymize: boolean, imageParams: WadoImageParams): JQueryPromise { 27 | return this.getObjectInstance(this.createUrl(instanceData, MimeTypes.DICOM, imageParams)); 28 | } 29 | 30 | //returns a jpeg image reprenstation of the DICOM image 31 | getJpegImage(instanceData: CommonDicomInstanceParams, imageParams: WadoImageParams): JQueryPromise 32 | { 33 | return this.getObjectInstance(this.createUrl(instanceData, MimeTypes.Jpeg, imageParams)); 34 | } 35 | 36 | //returns the image data after being decoded 37 | getUncompressedImage(instanceData: CommonDicomInstanceParams, imageParams: WadoImageParams): JQueryPromise 38 | { 39 | return this.getObjectInstance (this.createUrl(instanceData, MimeTypes.UncompressedData, imageParams)) 40 | } 41 | 42 | getObjectInstance 43 | ( 44 | url: string, 45 | ) :JQueryPromise 46 | { 47 | var deffered = $.Deferred(); 48 | var xhr = new XMLHttpRequest(); 49 | 50 | xhr.overrideMimeType("application/octet-stream"); 51 | xhr.open("GET", url, true); 52 | xhr.responseType = "arraybuffer"; 53 | xhr.onreadystatechange = function () { 54 | if (xhr.readyState == 4 && xhr.status == 200) { 55 | var buffer = new Uint8Array(xhr.response); 56 | 57 | deffered.resolve(buffer); 58 | } 59 | }; 60 | xhr.onerror = function (error) { 61 | deffered.reject(error); 62 | }; 63 | 64 | if (DICOMwebJS.ServerConfiguration.IncludeAuthorizationHeader) { 65 | xhr.setRequestHeader("Authorization", DICOMwebJS.ServerConfiguration.SecurityToken); 66 | } 67 | 68 | xhr.send(null); 69 | 70 | return deffered.promise(); 71 | } 72 | 73 | public createUrl(instanceData: CommonDicomInstanceParams,mimeType: string,imageParams: WadoImageParams): string { 74 | var url = this.BaseUrl; 75 | 76 | url += WadoUriProxy._QueryParamsFormatted.format(instanceData.studyUID, instanceData.seriesUID, instanceData.instanceUID); 77 | 78 | if (mimeType) 79 | { 80 | url += "&contentType=" + mimeType; 81 | } 82 | 83 | if (imageParams ) 84 | { 85 | if (imageParams.frameNumber) { 86 | url += "&frameNumber=" + imageParams.frameNumber; 87 | } 88 | 89 | if (imageParams.transferSyntax) 90 | { 91 | url += "&transferSyntax=" + imageParams.transferSyntax; 92 | } 93 | } 94 | 95 | //TODO: implement all other parameters.... 96 | 97 | return url; 98 | } 99 | } 100 | 101 | class CommonDicomInstanceParams 102 | { 103 | studyUID: string; 104 | seriesUID: string; 105 | instanceUID: string; 106 | } 107 | class WadoImageParams 108 | { 109 | //IWadoBurnAnnotation? BurnAnnotation { get; set; } 110 | 111 | //int? Rows { get; set; } 112 | //int? Columns { get; set; } 113 | frameNumber: string; 114 | //int? ImageQuality { get; set; } 115 | 116 | //string Region { get; set; } 117 | //string WindowCenter { get; set; } 118 | //string WindowWidth { get; set; } 119 | //string PresentationUID { get; set; } 120 | //string presentationSeriesUID { get; set; } 121 | transferSyntax: string; 122 | } -------------------------------------------------------------------------------- /DICOMwebJS/Types/DicomElement.ts: -------------------------------------------------------------------------------- 1 | class DicomElement { 2 | Tag: DicomTag; 3 | VR: string//DicomVR; 4 | Value: Array = []; 5 | 6 | public constructor() { } 7 | public SetUInt16(index: number, value: number) { 8 | this.Value[index] = value; 9 | } 10 | 11 | public GetUInt16(index: number, defaultValue: number): number { 12 | return parseInt(this.get(index, defaultValue)); 13 | } 14 | 15 | public SetString(index: number, value: string) { 16 | this.Value[index] = value; 17 | } 18 | 19 | public GetString(index: number, defaultValue: string): string { 20 | return this.get(index, defaultValue) + "" ; 21 | } 22 | 23 | public SetValue(index: number, value: any) { 24 | this.Value[index] = value; 25 | } 26 | 27 | public GetValue(index: number, defaultValue: string): any { 28 | return this.get(index, defaultValue); 29 | } 30 | 31 | public toString():string 32 | { 33 | if (this.Value && this.Value.length > 0) { 34 | return this.getStringValue(); 35 | } 36 | else 37 | { 38 | return "" ; 39 | } 40 | } 41 | 42 | private get(index: number, defaultValue: any): any { 43 | if (this.Value && this.Value.length > 0) { 44 | if (index >= this.Value.length) { 45 | throw "Invalid index"; 46 | } 47 | 48 | return this.Value[index]; 49 | } 50 | 51 | return defaultValue; 52 | } 53 | 54 | private getStringValue() 55 | { 56 | if (this.VR == "PN") 57 | { 58 | var pName: PersonName = this.Value[0]; 59 | 60 | if (pName) 61 | { 62 | return pName.Alphabetic + "" ; 63 | } 64 | } 65 | 66 | return this.Value[0].toString(); //TODO: must concatentate the values and stuff 67 | } 68 | 69 | 70 | } -------------------------------------------------------------------------------- /DICOMwebJS/Types/DicomModuleBase.ts: -------------------------------------------------------------------------------- 1 | class DicomModuleBase { 2 | 3 | DicomSourceProvider: IDicomDatasetService; 4 | 5 | public constructor(dicomProvider?: IDicomDatasetService) { 6 | if (dicomProvider) { 7 | this.DicomSourceProvider = dicomProvider; 8 | } 9 | else 10 | { 11 | this.DicomSourceProvider = new JsonDicomDatasetService(); 12 | } 13 | } 14 | 15 | public getUInt16(tagValue:number, valueIndex?:number, defaultValue?:number) : number 16 | { 17 | if (!valueIndex) 18 | { 19 | valueIndex = 0; 20 | } 21 | 22 | if (!defaultValue) 23 | { 24 | defaultValue = 0; 25 | } 26 | 27 | return this.DicomSourceProvider.getElement(tagValue).GetUInt16(valueIndex, defaultValue); 28 | } 29 | public setUInt16(tagValue: number, value: number, valueIndex?: number) { 30 | if (!valueIndex) { 31 | valueIndex = 0; 32 | } 33 | 34 | this.DicomSourceProvider.getElement(tagValue).SetUInt16(valueIndex, value); 35 | } 36 | 37 | public setString(tagValue: number, value: string, valueIndex?: number) { 38 | if (!valueIndex) { 39 | valueIndex = 0; 40 | } 41 | 42 | this.DicomSourceProvider.getElement(tagValue).SetString(valueIndex, value); 43 | } 44 | public getString(tagValue: number, valueIndex?: number, defaultValue?: string): string { 45 | if (!valueIndex) { 46 | valueIndex = 0; 47 | } 48 | 49 | if (!defaultValue) { 50 | defaultValue = ""; 51 | } 52 | 53 | return this.DicomSourceProvider.getElement(tagValue).GetString(valueIndex, defaultValue); 54 | } 55 | 56 | public setValue(tagValue: number, value: any, valueIndex?: number) { 57 | if (!valueIndex) { 58 | valueIndex = 0; 59 | } 60 | 61 | this.DicomSourceProvider.getElement(tagValue).SetValue(valueIndex, value); 62 | } 63 | public getValue(tagValue: number, valueIndex?: number, defaultValue?: string): any { 64 | if (!valueIndex) { 65 | valueIndex = 0; 66 | } 67 | 68 | if (!defaultValue) { 69 | defaultValue = ""; 70 | } 71 | 72 | return this.DicomSourceProvider.getElement(tagValue).GetValue(valueIndex, defaultValue); 73 | } 74 | } -------------------------------------------------------------------------------- /DICOMwebJS/Types/DicomSourceProvider.ts: -------------------------------------------------------------------------------- 1 | interface DicomElementArray extends Array{ 2 | [index: number]: DicomElement; 3 | //values(); 4 | } 5 | 6 | interface IDicomDatasetService 7 | { 8 | getElement(tagValue: number): DicomElement; 9 | getElements(): DicomElement[]; 10 | 11 | getSourceDataset(); 12 | } 13 | 14 | class DicomElementsCache //TODO: work around until I figure out how to enumerate the array 15 | { 16 | //private elementsArray: DicomElementArray; 17 | private elementsArray: {}; 18 | private elements: Array; 19 | 20 | constructor() 21 | { 22 | this.elementsArray = {}; 23 | this.elements = []; 24 | } 25 | public addElement(element: DicomElement) 26 | { 27 | this.elementsArray[element.Tag.StringValue] = element; 28 | //this.elementsArray[element.Tag.Value]; 29 | //this.elements.push(element); 30 | } 31 | 32 | public getElement(tagValue: number) : DicomElement 33 | { 34 | var element = this.elementsArray[DicomTag.getStringValue(tagValue)]; 35 | 36 | if (element) 37 | { 38 | return element; 39 | } 40 | 41 | return null; 42 | } 43 | 44 | public getAllElements(): DicomElement[] 45 | { 46 | var vals = Object.keys(this.elementsArray).map((key)=> { 47 | return this.elementsArray[key]; 48 | }); 49 | 50 | return vals; 51 | //return this.elements; 52 | } 53 | } 54 | 55 | class DicomDatasetService { 56 | 57 | static fromDateString(dateString: string): Date 58 | { 59 | return new Date(dateString);//TODO: this must be parsed for it to work; 60 | } 61 | static fromDate(date: Date): string 62 | { 63 | return date.toString();//TODO: this must be formatted according to DICOM; 64 | } 65 | } 66 | 67 | class JsonDicomDatasetService extends DicomDatasetService implements IDicomDatasetService { 68 | 69 | private _dataSource: {}; 70 | 71 | private _cache : DicomElementsCache ; 72 | 73 | constructor() 74 | { 75 | super(); 76 | this._dataSource = {}; 77 | this._cache = new DicomElementsCache(); 78 | } 79 | 80 | public setModel(jsonDicom?: Array) { 81 | this._dataSource = jsonDicom; 82 | } 83 | 84 | public getElement(tagValue: number): DicomElement { 85 | var element; 86 | if ((element = this._cache.getElement(tagValue)) != null ) { 87 | return element; 88 | } 89 | else { 90 | 91 | var dicomTag = new DicomTag(tagValue); 92 | 93 | var jsonElement = this._dataSource[dicomTag.StringValue]; 94 | 95 | element = new DicomElement(); 96 | 97 | if (jsonElement) { 98 | element.Value = jsonElement.Value; 99 | element.VR = jsonElement.vr; 100 | } 101 | 102 | element.Tag = dicomTag; 103 | 104 | this._cache.addElement(element); 105 | return element; 106 | } 107 | } 108 | 109 | public getElements(): DicomElement[] 110 | { 111 | for( var tagValue in this._dataSource){ 112 | if (!this._cache[tagValue]) { 113 | this._cache.addElement(this.getElement(parseInt(tagValue, 16))); 114 | } 115 | } 116 | 117 | return this._cache.getAllElements(); 118 | 119 | //return this._cache.values() ; 120 | //return []; 121 | } 122 | 123 | public getSourceDataset() 124 | { 125 | return this._dataSource; 126 | } 127 | 128 | } -------------------------------------------------------------------------------- /DICOMwebJS/Types/DicomTag.ts: -------------------------------------------------------------------------------- 1 | class DicomTag { 2 | public constructor(tagValue: number) { 3 | this.Value = tagValue; 4 | this.StringValue = DicomTag.getStringValue (tagValue); 5 | this.Group = ((tagValue & 0xffff0000) >> 16); //TODO:not working 6 | this.Element = (tagValue & 0x0000ffff);//TODO:not working 7 | } 8 | public Group: number; 9 | public Element: number; 10 | public StringValue: string; 11 | public Value: number; 12 | 13 | 14 | public toString(): string { 15 | return "(" + ("0000" + this.Group.toString(8)).substr(-4) + "," + ("0000" + this.Element.toString(8)).substr(-4) + ")"; 16 | } 17 | 18 | public static getStringValue(tagValue: number): string 19 | { 20 | return ("00000000" + tagValue.toString(16).toUpperCase()).substr(-8); 21 | } 22 | } -------------------------------------------------------------------------------- /DICOMwebJS/Types/DicomVR.ts: -------------------------------------------------------------------------------- 1 | class DicomVRs 2 | { 3 | CS: string = "CS"; 4 | PN: string = "PN"; //person name 5 | SQ: string = "SQ"; //DICOM Sequence 6 | } 7 | 8 | class DicomVR 9 | { 10 | Name: string; 11 | Description: string; 12 | } -------------------------------------------------------------------------------- /DICOMwebJS/Types/PersonName.ts: -------------------------------------------------------------------------------- 1 | interface PersonName 2 | { 3 | Alphabetic: string; 4 | } -------------------------------------------------------------------------------- /DICOMwebJS/Utils/StringExtensions.ts: -------------------------------------------------------------------------------- 1 |  2 | //TODO: move to common project 3 | interface String { 4 | format(...arguments:string[]): string; 5 | } 6 | 7 | String.prototype.format = function () { 8 | var args = arguments; 9 | return this.replace(/\{\{|\}\}|\{(\d+)\}/g, function (m, n) { 10 | if (m == "{{") { return "{"; } 11 | if (m == "}}") { return "}"; } 12 | return args[n]; 13 | }); 14 | }; -------------------------------------------------------------------------------- /DICOMwebJS/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /DICOMwebJS/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "noImplicitAny": false, 4 | "noEmitOnError": true, 5 | "removeComments": true, 6 | "sourceMap": true, 7 | "target": "es5", 8 | "module": "system", 9 | "declaration": true, 10 | "outFile": "../dist\\DICOMwebJS.js" 11 | }, 12 | "exclude": [ 13 | "node_modules", 14 | "wwwroot" 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /DICOMwebJS/web.Debug.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | -------------------------------------------------------------------------------- /DICOMwebJS/web.Release.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 30 | 31 | -------------------------------------------------------------------------------- /DICOMwebJS/web.config: -------------------------------------------------------------------------------- 1 |  2 | 6 | 7 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /Demo.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.26430.16 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Demo", "Demo\Demo.csproj", "{30AC3E94-5D36-4493-95FF-C5A848452A12}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DICOMwebJS", "DICOMwebJS\DICOMwebJS.csproj", "{21995373-4B66-42C6-8E50-EB3E314A4B1C}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Any CPU = Debug|Any CPU 13 | Release|Any CPU = Release|Any CPU 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {30AC3E94-5D36-4493-95FF-C5A848452A12}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 17 | {30AC3E94-5D36-4493-95FF-C5A848452A12}.Debug|Any CPU.Build.0 = Debug|Any CPU 18 | {30AC3E94-5D36-4493-95FF-C5A848452A12}.Release|Any CPU.ActiveCfg = Release|Any CPU 19 | {30AC3E94-5D36-4493-95FF-C5A848452A12}.Release|Any CPU.Build.0 = Release|Any CPU 20 | {21995373-4B66-42C6-8E50-EB3E314A4B1C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {21995373-4B66-42C6-8E50-EB3E314A4B1C}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {21995373-4B66-42C6-8E50-EB3E314A4B1C}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {21995373-4B66-42C6-8E50-EB3E314A4B1C}.Release|Any CPU.Build.0 = Release|Any CPU 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /Demo/.deployment: -------------------------------------------------------------------------------- 1 | [config] 2 | command = deploy.cmd 3 | -------------------------------------------------------------------------------- /Demo/App_Start/BundleConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using System.Web.Optimization; 3 | 4 | namespace DICOMwebJS.Demo 5 | { 6 | public class BundleConfig 7 | { 8 | // For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862 9 | public static void RegisterBundles(BundleCollection bundles) 10 | { 11 | bundles.Add(new ScriptBundle("~/bundles/jquery").Include( 12 | "~/Scripts/jquery-{version}.js")); 13 | 14 | bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include( 15 | "~/Scripts/jquery.validate*")); 16 | 17 | // Use the development version of Modernizr to develop with and learn from. Then, when you're 18 | // ready for production, use the build tool at http://modernizr.com to pick only the tests you need. 19 | bundles.Add(new ScriptBundle("~/bundles/modernizr").Include( 20 | "~/Scripts/modernizr-*")); 21 | 22 | bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include( 23 | "~/Scripts/bootstrap.js", 24 | "~/Scripts/respond.js")); 25 | 26 | 27 | bundles.Add(new StyleBundle("~/Content/css").Include( 28 | "~/Content/bootstrap.css" ) ); 29 | 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Demo/App_Start/BundleDemo.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using System.Web.Optimization; 3 | 4 | namespace DICOMwebJS.Demo 5 | { 6 | public class BundleDemo 7 | { 8 | // For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862 9 | public static void RegisterBundles(BundleCollection bundles) 10 | { 11 | bundles.Add(new ScriptBundle("~/bundles/dicomweb").Include( 12 | "~/Scripts/DICOMweb*")); 13 | 14 | bundles.Add(new ScriptBundle("~/bundles/app").Include ( 15 | "~/JSLib/uids.js", 16 | "~/dicomwebjs-demo.js")); 17 | 18 | bundles.Add(new StyleBundle("~/Content/dicomweb-js").Include( 19 | "~/Content/demo.css", 20 | "~/Content/cornerstone.min.css")); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Demo/App_Start/FilterConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using System.Web.Mvc; 3 | 4 | namespace DICOMwebJS.Demo 5 | { 6 | public class FilterConfig 7 | { 8 | public static void RegisterGlobalFilters(GlobalFilterCollection filters) 9 | { 10 | filters.Add(new HandleErrorAttribute()); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Demo/App_Start/RouteConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Routing; 7 | 8 | namespace DICOMwebJS.Demo 9 | { 10 | public class RouteConfig 11 | { 12 | public static void RegisterRoutes(RouteCollection routes) 13 | { 14 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 15 | 16 | routes.MapMvcAttributeRoutes ( ) ; 17 | 18 | routes.MapRoute( 19 | name: "Default", 20 | url: "{controller}/{action}/{id}", 21 | defaults: new { controller = "Demo", action = "Index", id = UrlParameter.Optional } 22 | ); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Demo/Content/cornerstone.min.css: -------------------------------------------------------------------------------- 1 | /*! cornerstone - v0.9.0 - 2016-02-03 | (c) 2014 Chris Hafey | https://github.com/chafey/cornerstone */.cornerstone-enabled-image{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default} -------------------------------------------------------------------------------- /Demo/Content/demo.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 80px; 3 | padding-bottom: 20px; 4 | } 5 | 6 | /* Set padding to keep content from hitting the edges */ 7 | .body-content { 8 | padding-left: 15px; 9 | padding-right: 15px; 10 | } 11 | 12 | /* Override the default bootstrap behavior where horizontal description lists 13 | will truncate terms that are too long to fit in the left column 14 | */ 15 | .dl-horizontal dt { 16 | white-space: normal; 17 | } 18 | 19 | .btn-file { 20 | position: relative; 21 | overflow: hidden; 22 | } 23 | .btn-file input[type=file] { 24 | position: absolute; 25 | top: 0; 26 | right: 0; 27 | min-width: 100%; 28 | min-height: 100%; 29 | font-size: 100px; 30 | text-align: right; 31 | filter: alpha(opacity=0); 32 | opacity: 0; 33 | background: red; 34 | cursor: inherit; 35 | display: block; 36 | } 37 | input[readonly] { 38 | background-color: white !important; 39 | cursor: text !important; 40 | } 41 | 42 | ul 43 | { 44 | list-style-type:none; 45 | /*padding:0px; 46 | margin:0px;*/ 47 | } 48 | 49 | li 50 | { 51 | background-repeat:no-repeat; 52 | background-position:0px 5px; 53 | padding-left:14px; 54 | } 55 | 56 | .tab-content { 57 | padding-top:30px; 58 | } 59 | 60 | .study-view , .series-view, .instance-view{ 61 | border:0; 62 | } 63 | 64 | .study-view [class^="col-"], .series-view [class^="col-"], .instance-view [class^="col-"] { 65 | padding-left: 5px; 66 | padding-right: 5px; 67 | margin-bottom: 10px; 68 | } 69 | 70 | .dicomWeb-js .thumbnail { 71 | cursor: pointer; 72 | font-size: 12px; 73 | height: 150px; 74 | padding: 10px; 75 | margin-bottom: 0px; 76 | /*margin-right:5px;*/ 77 | } 78 | 79 | .dicomWeb-js .thumbnail:hover, .dicomWeb-js .selected { 80 | background-color: #E1DBF3; 81 | } 82 | 83 | .dicomWeb-js .panel-footer { 84 | padding: 0; 85 | } 86 | 87 | .dicomWeb-js .thumbnail hr { 88 | margin-top: 5px; 89 | margin-bottom: 10px; 90 | } 91 | 92 | .pacs-metadata-viewer{ 93 | height:450px; 94 | } 95 | 96 | #dwv > .layerContainer { 97 | margin:auto; 98 | } 99 | 100 | .store-result-content { 101 | height:300px; 102 | } 103 | 104 | .my-btn-group { 105 | margin-top:-2px; 106 | } 107 | 108 | .panel-body.dicomWeb-js{ 109 | padding-left:0; 110 | padding-right:0; 111 | } 112 | -------------------------------------------------------------------------------- /Demo/Content/img/clippy.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Demo/Controllers/DemoController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Linq; 5 | using System.Security.Claims; 6 | using System.Web; 7 | using System.Web.Mvc; 8 | using DICOMwebJS.Demo.Models; 9 | 10 | namespace DICOMwebJS.Demo 11 | { 12 | public class DemoController : Controller 13 | { 14 | // GET: Demo 15 | public ActionResult Index() 16 | { 17 | 18 | if( Authorize() && !HttpContext.User.Identity.IsAuthenticated) 19 | { 20 | return new HttpUnauthorizedResult ( ) ; 21 | } 22 | 23 | var serverUrl = AppSettings.Current.ServerUrl; 24 | 25 | serverUrl = serverUrl ?? "" ; 26 | 27 | return View ( new ServersViewModel ( serverUrl.Split ( new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries ). 28 | Select ( (string x )=> 29 | { 30 | string[] keyValue = x.Split (';') ; 31 | 32 | if ( keyValue.Length == 2 ) 33 | { 34 | return new KeyValuePair ( keyValue[0], keyValue[1] ) ; 35 | } 36 | else 37 | { 38 | return new KeyValuePair ( x, x ); 39 | } 40 | } ).ToArray ( ) ) ) ; 41 | } 42 | 43 | private bool Authorize ( ) 44 | { 45 | return string.Compare (HttpContext.Request.QueryString["auth"], bool.TrueString, true) == 0 ; 46 | } 47 | 48 | [Route("_StudyItem")] 49 | [Route("dicomwebjs/_StudyItem")] 50 | public ActionResult _StudyItem() 51 | { 52 | return PartialView(); 53 | } 54 | 55 | [Route("_SeriesItem")] 56 | [Route("dicomwebjs/_SeriesItem")] 57 | public ActionResult _SeriesItem() 58 | { 59 | return PartialView(); 60 | } 61 | 62 | [Route("_InstanceItem")] 63 | [Route("dicomwebjs/_InstanceItem")] 64 | public ActionResult _InstanceItem() 65 | { 66 | return PartialView(); 67 | } 68 | } 69 | } -------------------------------------------------------------------------------- /Demo/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="DICOMwebJS.Demo.MvcApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /Demo/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Optimization; 7 | using System.Web.Routing; 8 | 9 | namespace DICOMwebJS.Demo 10 | { 11 | public class MvcApplication : System.Web.HttpApplication 12 | { 13 | protected void Application_Start() 14 | { 15 | AreaRegistration.RegisterAllAreas(); 16 | FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); 17 | RouteConfig.RegisterRoutes(RouteTable.Routes); 18 | BundleConfig.RegisterBundles(BundleTable.Bundles); 19 | BundleDemo.RegisterBundles(BundleTable.Bundles); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Demo/JSLib/Query/QueryModel.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"QueryModel.js","sourceRoot":"","sources":["QueryModel.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAE1F;IA0BG;QAxBO,2BAAsB,GAAc,IAAI,CAAC;QACzC,wBAAmB,GAAc,IAAI,CAAC;QACtC,uBAAkB,GAAc,IAAI,CAAC;QACrC,0BAAqB,GAAe,IAAI,CAAC;QAExC,4BAAuB,GAAG,IAAI,SAAS,EAAE,CAAC;QAC1C,6BAAwB,GAAG,IAAI,SAAS,EAAE,CAAC;QAC3C,+BAA0B,GAAG,IAAI,SAAS,EAAE,CAAC;QAO7C,sBAAiB,GAAgB,IAAI,WAAW,CAAC,IAAI,uBAAuB,EAAE,CAAC,CAAC;QAChF,aAAQ,GAAkB,EAAE,CAAC;QAC7B,YAAO,GAAmB,EAAE,CAAC;QAC7B,eAAU,GAAqB,EAAE,CAAC;QAElC,mBAAc,GAAW,CAAC,CAAC,CAAC;QAC5B,wBAAmB,GAAW,IAAI,CAAC,cAAc,CAAC;QAClD,yBAAoB,GAAW,IAAI,CAAC,cAAc,CAAE;QACpD,4BAAuB,GAAW,IAAI,CAAC,cAAc,CAAC;IAG5D,CAAC;IAhBH,sBAAW,iDAAyB;aAApC,cAA2C,MAAM,CAAC,IAAI,CAAC,uBAAuB,CAAE,CAAC,CAAC;;;OAAA;IAClF,sBAAW,kDAA0B;aAArC,cAA0C,MAAM,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC,CAAC;;;OAAA;IACjF,sBAAW,oDAA4B;aAAvC,cAA4C,MAAM,CAA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IAAI,CAAC,cAAc,CAAC;QAC/C,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC,cAAc,CAAC;QAEjD,EAAE,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,CAAC;YAC7B,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC7B,CAAC;IACL,CAAC;IAES,oCAAe,GAAzB;QACG,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC,cAAc,CAAC;QAC/C,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC,cAAc,CAAC;QAEjD,EAAE,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC;YAC3B,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAC7B,CAAC;IACJ,CAAC;IAES,uCAAkB,GAA5B;QAEG,IAAI,CAAC,uBAAuB,GAAG,IAAI,CAAC,cAAc,CAAC;QAEnD,EAAE,CAAC,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAC/B,CAAC;YACE,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAChC,CAAC;IACJ,CAAC;IACJ,iBAAC;AAAD,CAAC,AAzMD,IAyMC"} -------------------------------------------------------------------------------- /Demo/JSLib/Query/QueryPageModel.js: -------------------------------------------------------------------------------- 1 | /// 2 | var QueryPageModel = (function () { 3 | function QueryPageModel() { 4 | this.totalCount = 0; 5 | this._resultsCount = 0; 6 | this.firstOffset = -1; 7 | this.prevOffset = -1; 8 | this.nextOffset = -1; 9 | this.lastOffset = -1; 10 | this._currentPageOffset = 0; 11 | this.pageLimit = 12; 12 | this.currentPage = 0; 13 | this.pageCount = 0; 14 | } 15 | QueryPageModel.prototype.setLinkHeader = function (linkHeader, resultsCount, totalCount) { 16 | var _this = this; 17 | if (typeof linkHeader == "undefined" || linkHeader == null) { 18 | return; 19 | } 20 | this.totalCount = totalCount; 21 | this.ResultsCount = resultsCount; 22 | var pageLinks = linkHeader.split(","); 23 | this.firstOffset = this.prevOffset = this.nextOffset = this.lastOffset = -1; 24 | pageLinks.forEach(function (link) { 25 | var linkParts = link.split(";"); 26 | var queryPart = linkParts[0].split("?")[1]; 27 | var offset = parseInt(_this.getQueryVariable(queryPart, "offset"), 10); 28 | _this.pageLimit = parseInt(_this.getQueryVariable(queryPart, "limit"), 10); 29 | var rel = _this.getQueryVariable(linkParts[1], "rel"); 30 | switch (rel) { 31 | case "\"first\"": 32 | { 33 | _this.firstOffset = offset; 34 | } 35 | break; 36 | case "\"prev\"": 37 | { 38 | _this.prevOffset = offset; 39 | } 40 | break; 41 | case "\"next\"": 42 | { 43 | _this.nextOffset = offset; 44 | } 45 | break; 46 | case "\"last\"": 47 | { 48 | _this.lastOffset = offset; 49 | } 50 | break; 51 | } 52 | }); 53 | }; 54 | Object.defineProperty(QueryPageModel.prototype, "currentOffset", { 55 | get: function () { 56 | return this._currentPageOffset; 57 | }, 58 | set: function (offset) { 59 | this._currentPageOffset = offset; 60 | this.currentPage = Math.floor(this._currentPageOffset / this.pageLimit) + 1; 61 | }, 62 | enumerable: true, 63 | configurable: true 64 | }); 65 | Object.defineProperty(QueryPageModel.prototype, "pageLimit", { 66 | get: function () { 67 | return this._pageLimit; 68 | }, 69 | set: function (limit) { 70 | if (limit < 1) { 71 | throw "page limit can't be less than 1"; 72 | } 73 | this._pageLimit = limit; 74 | this.currentPage = Math.floor(this._currentPageOffset / this.pageLimit) + 1; 75 | }, 76 | enumerable: true, 77 | configurable: true 78 | }); 79 | Object.defineProperty(QueryPageModel.prototype, "ResultsCount", { 80 | get: function () { 81 | return this._resultsCount; 82 | }, 83 | set: function (count) { 84 | this._resultsCount = count; 85 | this.pageCount = Math.ceil(this.totalCount / this.pageLimit); 86 | }, 87 | enumerable: true, 88 | configurable: true 89 | }); 90 | //https://stackoverflow.com/questions/2090551/parse-query-string-in-javascript 91 | QueryPageModel.prototype.getQueryVariable = function (query, variable) { 92 | var vars = query.split('&'); 93 | for (var i = 0; i < vars.length; i++) { 94 | var pair = vars[i].split('='); 95 | if (decodeURIComponent(pair[0]).trim() == variable) { 96 | return decodeURIComponent(pair[1]); 97 | } 98 | } 99 | return ""; 100 | }; 101 | return QueryPageModel; 102 | }()); 103 | //# sourceMappingURL=QueryPageModel.js.map -------------------------------------------------------------------------------- /Demo/JSLib/Query/QueryPageModel.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"QueryPageModel.js","sourceRoot":"","sources":["QueryPageModel.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C;IAcG;QAEG,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;QACpB,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC;QACvB,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC,CAAC;QACtB,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC;QACrB,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC;QACrB,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC;QAErB,IAAI,CAAC,kBAAkB,GAAG,CAAC,CAAC;QAC5B,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;QAEpB,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC;QACrB,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC;IACtB,CAAC;IAGM,sCAAa,GAApB,UAAqB,UAAkB,EAAE,YAAmB,EAAE,UAAiB;QAA/E,iBA8CC;QA5CE,EAAE,CAAC,CAAC,OAAO,UAAU,IAAI,WAAW,IAAI,UAAU,IAAI,IAAI,CAAC,CAC3D,CAAC;YACE,MAAM,CAAC;QACV,CAAC;QAED,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QAEjC,IAAI,SAAS,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACtC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC;QAE5E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AC,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;YACtC,CAAC;QACJ,CAAC;QAED,MAAM,CAAC,EAAE,CAAC;IACb,CAAC;IAIJ,qBAAC;AAAD,CAAC,AAjID,IAiIC"} -------------------------------------------------------------------------------- /Demo/JSLib/Query/QueryPageModel.ts: -------------------------------------------------------------------------------- 1 | /// 2 | class QueryPageModel 3 | { 4 | public totalCount: number; 5 | public firstOffset: number; 6 | public prevOffset: number; 7 | public nextOffset: number; 8 | public lastOffset: number; 9 | public currentPage: number; 10 | public pageCount: number; 11 | 12 | private _resultsCount: number; 13 | private _currentPageOffset: number; 14 | private _pageLimit: number; 15 | 16 | constructor() 17 | { 18 | this.totalCount = 0; 19 | this._resultsCount = 0; 20 | this.firstOffset = -1; 21 | this.prevOffset = -1; 22 | this.nextOffset = -1; 23 | this.lastOffset = -1; 24 | 25 | this._currentPageOffset = 0; 26 | this.pageLimit = 12; 27 | 28 | this.currentPage = 0; 29 | this.pageCount = 0; 30 | } 31 | 32 | 33 | public setLinkHeader(linkHeader: string, resultsCount:number, totalCount:number) 34 | { 35 | if (typeof linkHeader == "undefined" || linkHeader == null) 36 | { 37 | return; 38 | } 39 | 40 | this.totalCount = totalCount; 41 | this.ResultsCount = resultsCount; 42 | 43 | var pageLinks = linkHeader.split(","); 44 | this.firstOffset = this.prevOffset = this.nextOffset = this.lastOffset = -1; 45 | 46 | pageLinks.forEach((link: string) => { 47 | var linkParts = link.split(";"); 48 | var queryPart = linkParts[0].split("?")[1]; 49 | var offset = parseInt(this.getQueryVariable(queryPart, "offset"), 10); 50 | this.pageLimit = parseInt(this.getQueryVariable(queryPart, "limit"), 10); 51 | var rel = this.getQueryVariable(linkParts[1], "rel"); 52 | switch (rel) 53 | { 54 | case "\"first\"": 55 | { 56 | this.firstOffset = offset; 57 | } 58 | break; 59 | 60 | case "\"prev\"": 61 | { 62 | this.prevOffset = offset; 63 | } 64 | break; 65 | 66 | case "\"next\"": 67 | { 68 | this.nextOffset = offset; 69 | } 70 | break; 71 | 72 | case "\"last\"": 73 | { 74 | this.lastOffset = offset; 75 | } 76 | break; 77 | } 78 | }); 79 | } 80 | 81 | get currentOffset() 82 | { 83 | return this._currentPageOffset; 84 | } 85 | set currentOffset(offset: number) 86 | { 87 | this._currentPageOffset = offset; 88 | 89 | this.currentPage = Math.floor(this._currentPageOffset / this.pageLimit) + 1; 90 | } 91 | 92 | get pageLimit() { 93 | return this._pageLimit; 94 | } 95 | set pageLimit(limit: number) 96 | { 97 | if (limit < 1) 98 | { 99 | throw "page limit can't be less than 1"; 100 | } 101 | 102 | this._pageLimit = limit; 103 | 104 | this.currentPage = Math.floor(this._currentPageOffset / this.pageLimit) + 1; 105 | } 106 | 107 | get ResultsCount() { 108 | return this._resultsCount; 109 | } 110 | set ResultsCount(count: number) { 111 | this._resultsCount = count; 112 | 113 | this.pageCount = Math.ceil(this.totalCount / this.pageLimit); 114 | } 115 | 116 | //https://stackoverflow.com/questions/2090551/parse-query-string-in-javascript 117 | getQueryVariable(query:string, variable:string) : string { 118 | var vars = query.split('&'); 119 | for (var i = 0; i < vars.length; i++) { 120 | var pair = vars[i].split('='); 121 | if (decodeURIComponent(pair[0]).trim() == variable) { 122 | return decodeURIComponent(pair[1]); 123 | } 124 | } 125 | 126 | return ""; 127 | } 128 | 129 | 130 | 131 | } -------------------------------------------------------------------------------- /Demo/JSLib/Query/QueryPagerView.js: -------------------------------------------------------------------------------- 1 | /// 2 | var QueryPagerView = (function () { 3 | function QueryPagerView($element, model) { 4 | this.onFirst = new LiteEvent(); 5 | this.onPrev = new LiteEvent(); 6 | this.onNext = new LiteEvent(); 7 | this.onLast = new LiteEvent(); 8 | this._$element = $element; 9 | this.model = model; 10 | this._$first = $(this._$element).find(".page-first"); 11 | this._$prev = $(this._$element).find(".page-previous"); 12 | this._$next = $(this._$element).find(".page-next"); 13 | this._$last = $(this._$element).find(".page-last"); 14 | this._$pageInfo = $(this._$element).find(".page-info"); 15 | this._registerEvents(); 16 | this.render(); 17 | } 18 | QueryPagerView.prototype._registerEvents = function () { 19 | var _this = this; 20 | this._$first.click(function () { _this.onFirst.trigger(); }); 21 | this._$prev.click(function () { _this.onPrev.trigger(); }); 22 | this._$next.click(function () { _this.onNext.trigger(); }); 23 | this._$last.click(function () { _this.onLast.trigger(); }); 24 | }; 25 | QueryPagerView.prototype.render = function () { 26 | if (this.model.firstOffset < 0) { 27 | this._$first.addClass("disabled"); 28 | } 29 | else { 30 | this._$first.removeClass("disabled"); 31 | } 32 | if (this.model.prevOffset < 0) { 33 | this._$prev.addClass("disabled"); 34 | } 35 | else { 36 | this._$prev.removeClass("disabled"); 37 | } 38 | if (this.model.nextOffset < 0) { 39 | this._$next.addClass("disabled"); 40 | } 41 | else { 42 | this._$next.removeClass("disabled"); 43 | } 44 | if (this.model.lastOffset < 0) { 45 | this._$last.addClass("disabled"); 46 | } 47 | else { 48 | this._$last.removeClass("disabled"); 49 | } 50 | this._$pageInfo.text("Page: " + this.model.currentPage + "/" + this.model.pageCount); 51 | }; 52 | QueryPagerView.prototype.show = function () { 53 | this._$element.show(); 54 | }; 55 | QueryPagerView.prototype.hide = function () { 56 | this._$element.hide(); 57 | }; 58 | return QueryPagerView; 59 | }()); 60 | //# sourceMappingURL=QueryPagerView.js.map -------------------------------------------------------------------------------- /Demo/JSLib/Query/QueryPagerView.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"QueryPagerView.js","sourceRoot":"","sources":["QueryPagerView.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C;IAeG,wBAAY,QAAe,EAAE,KAAoB;QAL1C,YAAO,GAAG,IAAI,SAAS,EAAQ,CAAC;QAChC,WAAM,GAAG,IAAI,SAAS,EAAQ,CAAC;QAC/B,WAAM,GAAG,IAAI,SAAS,EAAQ,CAAC;QAC/B,WAAM,GAAG,IAAI,SAAS,EAAQ,CAAC;QAInC,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,KAAK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;IACJ,qBAAC;AAAD,CAAC,AA9ED,IA8EC"} -------------------------------------------------------------------------------- /Demo/JSLib/Query/QueryPagerView.ts: -------------------------------------------------------------------------------- 1 | /// 2 | class QueryPagerView 3 | { 4 | _$first: JQuery; 5 | _$prev: JQuery; 6 | _$next: JQuery; 7 | _$last: JQuery; 8 | _$pageInfo: JQuery; 9 | _$element: JQuery; 10 | model : QueryPageModel; 11 | 12 | public onFirst = new LiteEvent(); 13 | public onPrev = new LiteEvent(); 14 | public onNext = new LiteEvent(); 15 | public onLast = new LiteEvent(); 16 | 17 | constructor($element:JQuery, model:QueryPageModel) 18 | { 19 | this._$element = $element; 20 | this.model = model; 21 | this._$first = $(this._$element).find(".page-first"); 22 | this._$prev = $(this._$element).find(".page-previous"); 23 | this._$next = $(this._$element).find(".page-next"); 24 | this._$last = $(this._$element).find(".page-last"); 25 | this._$pageInfo = $(this._$element).find(".page-info"); 26 | this._registerEvents(); 27 | this.render(); 28 | } 29 | 30 | private _registerEvents() 31 | { 32 | this._$first.click(() => { this.onFirst.trigger(); }); 33 | this._$prev.click(() => { this.onPrev.trigger(); }); 34 | this._$next.click(() => { this.onNext.trigger(); }); 35 | this._$last.click(() => { this.onLast.trigger(); }); 36 | } 37 | 38 | public render() 39 | { 40 | if (this.model.firstOffset < 0) { 41 | this._$first.addClass("disabled"); 42 | } 43 | else 44 | { 45 | this._$first.removeClass("disabled"); 46 | } 47 | 48 | if (this.model.prevOffset < 0) { 49 | this._$prev.addClass("disabled"); 50 | } 51 | else { 52 | this._$prev.removeClass("disabled"); 53 | } 54 | 55 | if (this.model.nextOffset < 0) { 56 | this._$next.addClass("disabled"); 57 | } 58 | else { 59 | this._$next.removeClass("disabled"); 60 | } 61 | 62 | if (this.model.lastOffset < 0) { 63 | this._$last.addClass("disabled"); 64 | } 65 | else { 66 | this._$last.removeClass("disabled"); 67 | } 68 | 69 | if (this.model.pageCount >= this.model.currentPage) { 70 | this._$pageInfo.text("Page: " + this.model.currentPage + "/" + this.model.pageCount); 71 | } 72 | else 73 | { 74 | this._$pageInfo.text("Page: " + this.model.currentPage); 75 | } 76 | } 77 | 78 | public show() 79 | { 80 | this._$element.show(); 81 | } 82 | 83 | public hide() { 84 | this._$element.hide(); 85 | } 86 | } -------------------------------------------------------------------------------- /Demo/JSLib/Query/RetrieveService.js: -------------------------------------------------------------------------------- 1 | var RetrieveService = (function () { 2 | //_queryModel: QueryModel; 3 | function RetrieveService(retrieveServic) { 4 | this._retrieveService = retrieveServic; 5 | } 6 | RetrieveService.prototype.getObjectInstance = function (instance, mediaType, successCallback) { 7 | this._retrieveService.getObjectInstance(instance.StudyInstanceUid, instance.SeriesInstanceUID, instance.SopInstanceUid, mediaType) 8 | .done(function (data) { 9 | successCallback(data); 10 | }) 11 | .fail(function (ev) { 12 | console.error("getObject failed"); 13 | }); 14 | }; 15 | RetrieveService.prototype.getObjectInstanceMetadata = function (instance, successCallback, mediaType) { 16 | this._retrieveService.getObjectInstanceMetadata(instance.StudyInstanceUid, instance.SeriesInstanceUID, instance.SopInstanceUid, mediaType) 17 | .done(function (data) { 18 | if (mediaType == MimeTypes.Json) { 19 | data = JSON.parse(data); 20 | } 21 | successCallback(data); 22 | //TODO: if XML then parse multipart and return the raw XML 23 | }) 24 | .fail(function (ev) { 25 | console.error("getObjectMetadata failed"); 26 | }); 27 | }; 28 | RetrieveService.prototype.getStudyAsJson = function (study, successCallback) { 29 | this._retrieveService.getStudyMetadata(study.StudyInstanceUid, MimeTypes.Json) 30 | .done(function (data, textStatus, jqXHR) { 31 | successCallback(JSON.parse(data)); 32 | }) 33 | .fail(function (ev) { 34 | console.error("getStudyMetadata failed"); 35 | }); 36 | }; 37 | RetrieveService.prototype.getStudyAsXml = function (study, successCallback) { 38 | this._retrieveService.getStudyMetadata(study.StudyInstanceUid, MimeTypes.xmlDicom) 39 | .done(function (data, textStatus, jqXHR) { 40 | successCallback(data); 41 | }) 42 | .fail(function (ev) { 43 | console.error("getStudyMetadata failed"); 44 | }); 45 | }; 46 | RetrieveService.prototype.getSeries = function (series, successCallback, mediaType) { 47 | if (mediaType === void 0) { mediaType = null; } 48 | if (null === mediaType) { 49 | mediaType = MimeTypes.Json; 50 | } 51 | this._retrieveService.getSeriesMetadata(series.StudyInstanceUid, series.SeriesInstanceUID, mediaType) 52 | .done(function (data, textStatus, jqXHR) { 53 | if (mediaType == MimeTypes.Json) { 54 | data = JSON.parse(data); 55 | } 56 | successCallback(data); 57 | }) 58 | .fail(function (ev) { 59 | console.error("getStudyMetadata failed"); 60 | }); 61 | }; 62 | RetrieveService.prototype.getFrameUncompressed = function (instance, frameList, successCallback, failureCallback) { 63 | this._retrieveService.getFrame(instance.StudyInstanceUid, instance.SeriesInstanceUID, instance.SopInstanceUid, frameList, MimeTypes.UncompressedData) 64 | .done(successCallback) 65 | .fail(failureCallback); 66 | }; 67 | RetrieveService.prototype.DownloadObject = function (instance, successCallback) { 68 | this._retrieveService.getObjectInstance(instance.StudyInstanceUid, instance.SeriesInstanceUID, instance.SopInstanceUid, MimeTypes.DICOM) 69 | .done(function (data, textStatus) { 70 | successCallback(data); 71 | }) 72 | .fail(function (ev) { 73 | alert("failed: " + ev); //TODO: move to view 74 | }); 75 | }; 76 | RetrieveService.prototype.DownloadStudy = function (instance, successCallback) { 77 | this._retrieveService.getStudy(instance.StudyInstanceUid, MimeTypes.DICOM) 78 | .done(function (data, textStatus) { 79 | successCallback(data); 80 | }) 81 | .fail(function (ev) { 82 | alert("failed: " + ev); //TODO: move to view 83 | }); 84 | }; 85 | return RetrieveService; 86 | }()); 87 | //# sourceMappingURL=RetrieveService.js.map -------------------------------------------------------------------------------- /Demo/JSLib/Query/RetrieveService.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"RetrieveService.js","sourceRoot":"","sources":["RetrieveService.ts"],"names":[],"mappings":"AAAA;IAEG,0BAA0B;IAG1B,yBAAY,cAA2B;QACpC,IAAI,CAAC,gBAAgB,GAAG,cAAc,CAAE;IAG3C,CAAC;IAGD,2CAA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,eAAoC;QAGpC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,QAAQ,CAAC,gBAAgB,EAAE,QAAQ,CAAC,iBAAiB,EACjF,QAAQ,CAAC,cAAc,EAAE,SAAS,EAAE,SAAS,CAAC,gBAAgB,CAAC;aAC9D,IAAI,CAAC,eAAe,CAAC;aACrB,IAAI,CAAE,eAAe,CAAC,CAAC;IAC9B,CAAC;IAED,wCAAc,GAAd,UAAe,QAAwB,EAAE,eAAoC;QAE1E,IAAI,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,QAAQ,CAAC,gBAAgB,EAC1B,QAAQ,CAAC,iBAAiB,EAC1B,QAAQ,CAAC,cAAc,EACvB,SAAS,CAAC,KAAK,CAAC;aACnD,IAAI,CACL,UAAC,IAAS,EAAE,UAAkB;YAC3B,eAAe,CAAC,IAAI,CAAC,CAAC;QACzB,CAAC,CAAC;aACD,IAAI,CACL,UAAC,EAAS;YACP,KAAK,CAAC,UAAU,GAAG,EAAE,CAAC,CAAC,CAAA,oBAAoB;QAC9C,CAAC,CAAC,CAAC;IACT,CAAC;IAED,uCAAa,GAAb,UAAc,QAAqB,EAAE,eAAoC;QAEtE,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,QAAQ,CAAC,gBAAgB,EAAE,SAAS,CAAC,KAAK,CAAC;aACtE,IAAI,CACL,UAAC,IAAS,EAAE,UAAkB;YAC3B,eAAe,CAAC,IAAI,CAAC,CAAC;QACzB,CAAC,CAAC;aACD,IAAI,CACL,UAAC,EAAS;YACP,KAAK,CAAC,UAAU,GAAG,EAAE,CAAC,CAAC,CAAA,oBAAoB;QAC9C,CAAC,CAAC,CAAC;IACT,CAAC;IAEJ,sBAAC;AAAD,CAAC,AAxID,IAwIC"} -------------------------------------------------------------------------------- /Demo/JSLib/Store/StoreResultView.js: -------------------------------------------------------------------------------- 1 | var StoreResultView = (function () { 2 | function StoreResultView($view, uriProxy) { 3 | this.$view = $view; 4 | this.$progress = this.$view.find(".progress").hide(); 5 | this.$alert = this.$view.find(".store-result-alert"); 6 | this.$resultBody = this.$view.find(".store-result-body").hide(); 7 | this.$resultTitle = this.$view.find(".store-result-title"); 8 | this.$resultContent = this.$view.find(".store-result-content"); 9 | this._copyImageView = new copyImageUrlView($view, uriProxy); 10 | } 11 | StoreResultView.prototype.showProgress = function () { 12 | this.$resultBody.hide(); 13 | this.$progress.show(); 14 | }; 15 | StoreResultView.prototype.showSuccess = function (xmlData) { 16 | this.$progress.hide(); 17 | this.$resultBody.show(); 18 | this.$alert.addClass("alert-success").removeClass("alert-danger"); 19 | this.$resultTitle.text("Success!"); 20 | if (xmlData) { 21 | var $referencedInstance = $(xmlData).find("DicomAttribute[keyword='ReferencedInstanceSequence']"); 22 | var instanceUrl = $referencedInstance.find("DicomAttribute[keyword='RetrieveURI']").children("Value").text(); 23 | this._copyImageView.setUrl(instanceUrl); 24 | CodeRenderer.renderXml(this.$resultContent[0], this.getString(xmlData)); 25 | } 26 | else { 27 | this._copyImageView.setUrl(""); 28 | CodeRenderer.renderXml(this.$resultContent[0], ""); 29 | } 30 | }; 31 | StoreResultView.prototype.showError = function (xmlData, error) { 32 | this.$progress.hide(); 33 | this.$resultBody.show(); 34 | this.$alert.addClass("alert-danger").removeClass("alert-success"); 35 | this.$resultTitle.text(error); 36 | this._copyImageView.setUrl(""); 37 | if (xmlData) { 38 | CodeRenderer.renderXml(this.$resultContent[0], this.getString(xmlData)); 39 | } 40 | else { 41 | this._copyImageView.setUrl(""); 42 | CodeRenderer.renderXml(this.$resultContent[0], ""); 43 | } 44 | }; 45 | StoreResultView.prototype.hide = function () { 46 | this.$view.hide(); 47 | }; 48 | StoreResultView.prototype.show = function () { 49 | this.$view.show(); 50 | }; 51 | StoreResultView.prototype.getString = function (data) { 52 | return data.xml ? data.xml : (new XMLSerializer()).serializeToString(data); 53 | }; 54 | return StoreResultView; 55 | }()); 56 | //# sourceMappingURL=StoreResultView.js.map -------------------------------------------------------------------------------- /Demo/JSLib/Store/StoreResultView.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"StoreResultView.js","sourceRoot":"","sources":["StoreResultView.ts"],"names":[],"mappings":"AAAA;IAUG,yBAAY,KAAa,EAAE,QAAsB;QAE9C,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QAEnB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,IAAI,EAAE,CAAC;QACrD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;QACrD,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,IAAI,EAAE,CAAC;QAChE,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;QAC3D,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;QAE/D,IAAI,CAAC,cAAc,GAAG,IAAI,gBAAgB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IAC/D,CAAC;IAEM,sCAAY,GAAnB;QAGG,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;QACxB,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;IACzB,CAAC;IAEM,qCAAW,GAAlB,UAAmB,OAAiB;QAEjC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;QACtB,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;QAExB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;QAClE,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAEnC,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;YACX,IAAI,mBAAmB,GAAG,C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AC,cAAc,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACtD,CAAC;IACJ,CAAC;IAEM,8BAAI,GAAX;QAEG,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;IACrB,CAAC;IAEM,8BAAI,GAAX;QAEG,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;IACrB,CAAC;IAEO,mCAAS,GAAjB,UAAkB,IAAS;QAExB,MAAM,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,GAAG,CAAC,IAAI,aAAa,EAAE,CAAC,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAC9E,CAAC;IAEJ,sBAAC;AAAD,CAAC,AAtFD,IAsFC"} -------------------------------------------------------------------------------- /Demo/JSLib/Store/StoreResultView.ts: -------------------------------------------------------------------------------- 1 | class StoreResultView 2 | { 3 | private $view: JQuery; 4 | private $progress: JQuery; 5 | private $alert: JQuery; 6 | private $resultBody:JQuery 7 | private $resultContent: JQuery; 8 | private $resultTitle: JQuery; 9 | private _copyImageView: copyImageUrlView; 10 | 11 | constructor($view: JQuery, uriProxy: WadoUriProxy) 12 | { 13 | this.$view = $view; 14 | 15 | this.$progress = this.$view.find(".progress").hide(); 16 | this.$alert = this.$view.find(".store-result-alert"); 17 | this.$resultBody = this.$view.find(".store-result-body").hide(); 18 | this.$resultTitle = this.$view.find(".store-result-title"); 19 | this.$resultContent = this.$view.find(".store-result-content"); 20 | 21 | this._copyImageView = new copyImageUrlView($view, uriProxy); 22 | } 23 | 24 | public showProgress() 25 | { 26 | 27 | this.$resultBody.hide(); 28 | this.$progress.show(); 29 | } 30 | 31 | public showSuccess(xmlData: Document) 32 | { 33 | var codeRenderer = new CodeRenderer(); 34 | 35 | 36 | this.$progress.hide(); 37 | this.$resultBody.show(); 38 | 39 | this.setAlertClass("alert-success"); 40 | this.$resultTitle.text("Success!"); 41 | 42 | if (xmlData) { 43 | var $referencedInstance = $(xmlData).find("DicomAttribute[keyword='ReferencedInstanceSequence']") 44 | var instanceUrl = $referencedInstance.find("DicomAttribute[keyword='RetrieveURI']").children("Value").text(); 45 | 46 | this._copyImageView.setUrl(instanceUrl); 47 | 48 | codeRenderer.renderXml(this.$resultContent[0], this.getString(xmlData)); 49 | } 50 | else 51 | { 52 | this._copyImageView.setUrl(""); 53 | codeRenderer.renderXml(this.$resultContent[0], ""); 54 | } 55 | } 56 | 57 | public showError(xmlData: any, error: string) { 58 | this.showFailure(xmlData, error, "alert-danger"); 59 | } 60 | 61 | public showWarning(xmlData: any, error: string) { 62 | this.showFailure(xmlData, error, "alert-warning"); 63 | } 64 | 65 | private showFailure(xmlData: any, error: string, alertStyle:string) { 66 | var codeRenderer = new CodeRenderer(); 67 | 68 | 69 | this.$progress.hide(); 70 | this.$resultBody.show(); 71 | 72 | this.setAlertClass(alertStyle); 73 | 74 | this.$resultTitle.text(error); 75 | this._copyImageView.setUrl(""); 76 | 77 | if (xmlData) { 78 | codeRenderer.renderXml(this.$resultContent[0], this.getString(xmlData)); 79 | } 80 | else { 81 | this._copyImageView.setUrl(""); 82 | codeRenderer.renderXml(this.$resultContent[0], ""); 83 | } 84 | } 85 | 86 | private setAlertClass(alertClass) 87 | { 88 | this.$alert.removeClass("alert-success alert-warning alert-danger").addClass(alertClass); 89 | } 90 | 91 | public hide() 92 | { 93 | this.$view.hide(); 94 | } 95 | 96 | public show() 97 | { 98 | this.$view.show(); 99 | } 100 | 101 | private getString(data: any) 102 | { 103 | return data.xml ? data.xml : (new XMLSerializer()).serializeToString(data); 104 | } 105 | 106 | } -------------------------------------------------------------------------------- /Demo/JSLib/Store/StoreView.js: -------------------------------------------------------------------------------- 1 | var StoreView = (function () { 2 | function StoreView(parentElement) { 3 | this._parent = parentElement; 4 | this._resultView = new StoreResultView($(".store-result-view"), new WadoUriProxy(DICOMwebJS.ServerConfiguration.getWadoRsUrl())); 5 | this._resultView.hide(); 6 | this.registerEvents(); 7 | } 8 | StoreView.prototype.registerEvents = function () { 9 | var _this = this; 10 | $(this._parent).find("#addFileButton").click(function (e) { 11 | e.preventDefault(); 12 | var newName = jQuery('#displayName').val(); 13 | // Initiate method calls using jQuery promises. 14 | // Get the local file as an array buffer. 15 | var getFile = _this.getFileBuffer(); 16 | var url = DICOMwebJS.ServerConfiguration.getStowUrl(); 17 | var anonymizedElementsQuery = _this.getAnonymizedElementsQuery(); 18 | getFile.done(function (arrayBuffer) { 19 | var proxy = new StowRsProxy(url); 20 | var dlg = new ModalDialog("#modal-alert"); 21 | _this._resultView.show(); 22 | _this._resultView.showProgress(); 23 | proxy.StoreInstance(arrayBuffer, null, anonymizedElementsQuery).done(function (xhr) { 24 | if (xhr.getResponseHeader("content-type").indexOf("application/json") >= 0) { 25 | dlg.showJson("JSON Store Response", JSON.parse(xhr.response)); 26 | } 27 | else { 28 | _this._resultView.showSuccess(xhr.responseXML); 29 | } 30 | }) 31 | .fail(function (xhr) { 32 | //dlg.showText("Error Storing Dataset", xhr.response); 33 | _this._resultView.showError(xhr.responseXML, "Error Storing Dataset"); 34 | }); 35 | }); 36 | }); 37 | }; 38 | // Get the local file as an array buffer. 39 | StoreView.prototype.getFileBuffer = function () { 40 | var fileInput = $('#getFile'); 41 | var deferred = jQuery.Deferred(); 42 | var reader = new FileReader(); 43 | reader.onloadend = function (e) { 44 | deferred.resolve(e.target.result); 45 | }; 46 | reader.onerror = function (e) { 47 | deferred.reject(e.target.error); 48 | }; 49 | reader.readAsArrayBuffer(fileInput[0].files[0]); 50 | return deferred.promise(); 51 | }; 52 | StoreView.prototype.getAnonymizedElementsQuery = function () { 53 | var anonyElementsQuery = ""; 54 | $(this._parent).find(".app-anonymizer-field").each(function (index, element) { 55 | var tagKey = $(element).attr("data-app-tag"); 56 | var tagValue = $(element).val(); 57 | if (tagValue !== "") { 58 | anonyElementsQuery += tagKey + "=" + tagValue + "&"; 59 | } 60 | }); 61 | return anonyElementsQuery; 62 | }; 63 | return StoreView; 64 | }()); 65 | //# sourceMappingURL=StoreView.js.map -------------------------------------------------------------------------------- /Demo/JSLib/Store/StoreView.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"StoreView.js","sourceRoot":"","sources":["StoreView.ts"],"names":[],"mappings":"AAAA;IAMG,mBAAY,aAA0B;QACnC,IAAI,CAAC,OAAO,GAAG,aAAa,CAAC;QAC7B,IAAI,CAAC,WAAW,GAAG,IAAI,eAAe,CAAC,CAAC,CAAC,oBAAoB,CAAC,EAC3D,IAAI,YAAY,CAAC,UAAU,CAAC,mBAAmB,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;QAEpE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;QAExB,IAAI,CAAC,cAAc,EAAE,CAAC;IACzB,CAAC;IAEO,kCAAc,GAAtB;QAAA,iBAkCC;QAhCE,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,KAAK,CAAC,UAAC,CAAC;YAC5C,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,IAAI,OAAO,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC,GAAG,EAAE,CAAC;YAE3C,+CAA+C;YAC/C,yCAAyC;YACzC,IAAI,OAAO,GAAG,KAAI,CAAC,aAAa,EAAE,CAAC;YACnC,IAAI,GAAG,GAAG,UAAU,CAAC,mBAAmB,CAAC,UAAU,EAAE,CAAC;YACtD,IAAI,uBAAuB,GAAG,KAAI,CAAC,0BAA0B,EAAE,CAAC;YAGhE,OAAO,CAAC,IAAI,CAAC,UAAC,WAAwB;gBACnC,IAAI,KAAK,GAAG,IAAI,WAAW,CAAC,GAAG,CAAC,CAAC;gBACjC,IAAI,GAAG,GAAG,IAAI,WAAW,CAAC,cAAc,CAAC,CAAC;gBAE1C,KAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;gBACxB,KAAI,CAAC,WAAW,CAAC,YAAY,EAAE,CAAC;gBAChC,KAAK,CAAC,aAAa,CAAC,WAAW,EAAE,IAAI,E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C,OAAO,EAAE,CAAC;IAC7B,CAAC;IAEO,8CAA0B,GAAlC;QACG,IAAI,kBAAkB,GAAG,EAAE,CAAC;QAE5B,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC,IAAI,CAAC,UAAC,KAAK,EAAE,OAAO;YAC/D,IAAI,MAAM,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;YAC7C,IAAI,QAAQ,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC;YAEhC,EAAE,CAAC,CAAC,QAAQ,KAAK,EAAE,CAAC,CAAC,CAAC;gBACnB,kBAAkB,IAAI,MAAM,GAAG,GAAG,GAAG,QAAQ,GAAG,GAAG,CAAC;YACvD,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,MAAM,CAAC,kBAAkB,CAAC;IAC7B,CAAC;IAIJ,gBAAC;AAAD,CAAC,AAxFD,IAwFC"} -------------------------------------------------------------------------------- /Demo/JSLib/Store/StoreView.ts: -------------------------------------------------------------------------------- 1 | declare var dcloudMaxUpload: number; 2 | 3 | class StoreView 4 | { 5 | private _parent: HTMLElement; 6 | private _resultView: StoreResultView; 7 | 8 | 9 | constructor(parentElement: HTMLElement) { 10 | this._parent = parentElement; 11 | this._resultView = new StoreResultView($(".store-result-view"), 12 | new WadoUriProxy(DICOMwebJS.ServerConfiguration.getWadoRsUrl())); 13 | 14 | this._resultView.hide(); 15 | 16 | this.registerEvents(); 17 | } 18 | 19 | private registerEvents() 20 | { 21 | //https://stackoverflow.com/questions/15854946/how-do-i-limit-the-number-of-file-upload-in-html 22 | 23 | if (typeof (dcloudMaxUpload) !== "undefined" && dcloudMaxUpload > 0) { 24 | $('#getFile').change(function () { 25 | if (this.files.length > dcloudMaxUpload) { 26 | new ModalDialog().showError("Too many files", "Please select no more than " + dcloudMaxUpload + " files"); 27 | this.value = ''; 28 | } 29 | }); 30 | } 31 | 32 | $(this._parent).find("#addFileButton").click((e) => { 33 | e.preventDefault(); 34 | var newName = jQuery('#displayName').val(); 35 | 36 | // Initiate method calls using jQuery promises. 37 | // Get the local file as an array buffer. 38 | var getFile = this.getFileBuffer(); 39 | var url = DICOMwebJS.ServerConfiguration.getStowUrl(); 40 | var anonymizedElementsQuery = this.getAnonymizedElementsQuery(); 41 | 42 | 43 | getFile.done((arrayBufferList: Array) => { 44 | var proxy = new StowRsProxy(url); 45 | var dlg = new ModalDialog("#modal-alert"); 46 | 47 | this._resultView.show(); 48 | this._resultView.showProgress(); 49 | proxy.StoreInstance(arrayBufferList, null, anonymizedElementsQuery).done ( (xhr: XMLHttpRequest) => { 50 | 51 | if (xhr.getResponseHeader("content-type").indexOf("application/json") >= 0) { 52 | dlg.showJson("JSON Store Response", JSON.parse(xhr.response)); 53 | } 54 | else { 55 | this._resultView.showSuccess(xhr.responseXML); 56 | } 57 | }) 58 | .fail((xhr: XMLHttpRequest) => { 59 | if (xhr.status === 202) //Accepted 60 | { 61 | this._resultView.showWarning(xhr.responseXML, "Some Errors during store - " + xhr.statusText); 62 | } 63 | else 64 | { 65 | this._resultView.showError(xhr.responseXML, "Error Storing Dataset - " + xhr.statusText); 66 | } 67 | }); 68 | }); 69 | }); 70 | } 71 | 72 | // Get the local file as an array buffer. 73 | private getFileBuffer() { 74 | var results: Array = []; 75 | var fileInput: HTMLInputElement = $('#getFile')[0]; 76 | var promises: Array> = []; 77 | var deferred = jQuery.Deferred(); 78 | var files = fileInput.files; 79 | 80 | for (var index = 0; index < files.length; index++) 81 | { 82 | var reader = new fileReaderAsync(); 83 | 84 | promises.push(reader.read(files[index]).done((result) => { results.push(result);})); 85 | } 86 | 87 | $.when.apply($, promises).then(() => { 88 | deferred.resolve(results); 89 | }); 90 | 91 | return deferred.promise(); 92 | } 93 | 94 | private getAnonymizedElementsQuery() { 95 | var anonyElementsQuery = ""; 96 | 97 | $(this._parent).find(".app-anonymizer-field").each((index, element) => { 98 | var tagKey = $(element).attr("data-app-tag"); 99 | var tagValue = $(element).val(); 100 | 101 | if (tagValue !== "") { 102 | anonyElementsQuery += tagKey + "=" + tagValue + "&"; 103 | } 104 | }); 105 | 106 | return anonyElementsQuery; 107 | } 108 | } -------------------------------------------------------------------------------- /Demo/JSLib/Types/CodeRenderer.js: -------------------------------------------------------------------------------- 1 | var CodeRenderer = (function () { 2 | function CodeRenderer() { 3 | } 4 | CodeRenderer.renderJson = function (uiElement, data) { 5 | var editor = uiElement; 6 | ; 7 | var editorSession; 8 | editor = ace.edit(uiElement); 9 | editorSession = editor.getSession(); 10 | editorSession.setValue(JSON.stringify(data, null, '\t')); 11 | editorSession.setMode("ace/mode/json"); 12 | editor.resize(); 13 | }; 14 | CodeRenderer.renderXml = function (uiElement, data) { 15 | var editor; 16 | var editorSession; 17 | editor = ace.edit(uiElement); 18 | editorSession = editor.getSession(); 19 | editorSession.setValue(data); 20 | editorSession.setMode("ace/mode/xml"); 21 | editor.resize(); 22 | }; 23 | CodeRenderer.renderValue = function (uiElement, data) { 24 | this.renderEditor(uiElement, data); 25 | }; 26 | CodeRenderer.renderEditor = function (uiElement, data, editorMode) { 27 | var editor; 28 | var editorSession; 29 | editor = ace.edit(uiElement); 30 | editorSession = editor.getSession(); 31 | editorSession.setValue(data); 32 | if (typeof editorMode !== "undefined") { 33 | editorSession.setMode(editorMode); 34 | } 35 | editor.resize(); 36 | }; 37 | return CodeRenderer; 38 | }()); 39 | //# sourceMappingURL=CodeRenderer.js.map -------------------------------------------------------------------------------- /Demo/JSLib/Types/CodeRenderer.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"CodeRenderer.js","sourceRoot":"","sources":["CodeRenderer.ts"],"names":[],"mappings":"AAAA;IAAA;IAoDA,CAAC;IAlDgB,uBAAU,GAAxB,UAAyB,SAAqB,EAAE,IAAS;QAEtD,IAAI,MAAM,GAAS,SAAS,CAAC;QAAA,CAAC;QAC9B,IAAI,aAAa,CAAC;QAGlB,MAAM,GAAG,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AC,AApDD,IAoDC"} -------------------------------------------------------------------------------- /Demo/JSLib/Types/CodeRenderer.ts: -------------------------------------------------------------------------------- 1 | class CodeRenderer 2 | { 3 | public renderJson(uiElement: HTMLElement, data: any) 4 | { 5 | return this.renderEditor(uiElement, JSON.stringify(data, null, '\t'), "ace/mode/json"); 6 | } 7 | 8 | public renderXml(uiElement: HTMLElement, data: any) : any 9 | { 10 | return this.renderEditor(uiElement, data, "ace/mode/xml"); 11 | } 12 | 13 | public renderValue(uiElement: HTMLElement, data: any) :any { 14 | return this.renderEditor(uiElement, data, null, true); 15 | } 16 | 17 | public clean(editor: any) 18 | { 19 | if (editor) { 20 | editor.destroy(); 21 | var oldDiv = editor.container 22 | var newDiv = oldDiv.cloneNode(false) 23 | 24 | oldDiv.parentNode.replaceChild(newDiv, oldDiv) 25 | 26 | editor.container = null; 27 | editor.renderer = null; 28 | 29 | editor = null; 30 | } 31 | } 32 | 33 | private renderEditor(uiElement: HTMLElement, data: any, editorMode?:string, autoWrap:Boolean = false) { 34 | var editor = ace.edit(uiElement); 35 | var editorSession = editorSession = editor.getSession(); 36 | 37 | if (data) { 38 | editorSession.setValue(data); 39 | } 40 | else 41 | { 42 | editorSession.setValue(""); 43 | } 44 | 45 | if (editorMode) { 46 | editorSession.setMode(editorMode); 47 | } 48 | 49 | if (autoWrap) { 50 | editorSession.setUseWrapMode(true); 51 | } 52 | 53 | editor.resize(); 54 | } 55 | } -------------------------------------------------------------------------------- /Demo/JSLib/Types/ILiteEvent.js: -------------------------------------------------------------------------------- 1 | var LiteEvent = (function () { 2 | function LiteEvent() { 3 | this.handlers = []; 4 | } 5 | LiteEvent.prototype.on = function (handler) { 6 | this.handlers.push(handler); 7 | }; 8 | LiteEvent.prototype.off = function (handler) { 9 | this.handlers = this.handlers.filter(function (h) { return h !== handler; }); 10 | }; 11 | LiteEvent.prototype.trigger = function (data) { 12 | this.handlers.slice(0).forEach(function (h) { return h(data); }); 13 | }; 14 | return LiteEvent; 15 | }()); 16 | //# sourceMappingURL=iliteevent.js.map -------------------------------------------------------------------------------- /Demo/JSLib/Types/ILiteEvent.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"iliteevent.js","sourceRoot":"","sources":["iliteevent.ts"],"names":[],"mappings":"AAMA;IAAA;QACW,aAAQ,GAA4B,EAAE,CAAC;IAalD,CAAC;IAXS,sBAAE,GAAT,UAAU,OAA6B;QACpC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC/B,CAAC;IAEM,uBAAG,GAAV,UAAW,OAA6B;QACrC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,KAAK,OAAO,EAAb,CAAa,CAAC,CAAC;IAC5D,CAAC;IAEM,2BAAO,GAAd,UAAe,IAAQ;QACpB,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,IAAI,CAAC,EAAP,CAAO,CAAC,CAAC;IAChD,CAAC;IACJ,gBAAC;AAAD,CAAC,AAdD,IAcC"} -------------------------------------------------------------------------------- /Demo/JSLib/Types/ILiteEvent.ts: -------------------------------------------------------------------------------- 1 | //http://stackoverflow.com/questions/12881212/does-typescript-support-events-on-classes 2 | interface ILiteEvent { 3 | on(handler: { (data?: T): void }); 4 | off(handler: { (data?: T): void }); 5 | } 6 | 7 | class LiteEvent implements ILiteEvent { 8 | private handlers: { (data?: T): void; }[] = []; 9 | 10 | public on(handler: { (data?: T): void }) { 11 | this.handlers.push(handler); 12 | } 13 | 14 | public off(handler: { (data?: T): void }) { 15 | this.handlers = this.handlers.filter(h => h !== handler); 16 | } 17 | 18 | public trigger(data?: T) { 19 | this.handlers.slice(0).forEach(h => h(data)); 20 | } 21 | } -------------------------------------------------------------------------------- /Demo/JSLib/Types/ModelDialog.js: -------------------------------------------------------------------------------- 1 | /// 2 | var ModalDialog = (function () { 3 | function ModalDialog($dialogName) { 4 | this._onDlgClose = new LiteEvent(); 5 | this._$dialogName = $dialogName; 6 | } 7 | Object.defineProperty(ModalDialog.prototype, "dilaogClosed", { 8 | get: function () { return this._onDlgClose; }, 9 | enumerable: true, 10 | configurable: true 11 | }); 12 | ModalDialog.prototype.showJson = function (title, data) { 13 | var $dlg = $(this._$dialogName); 14 | var $contentElement = $dlg.find(".model-body-content"); 15 | $dlg.find(".modal-title").text(title); 16 | CodeRenderer.renderJson($contentElement[0], data); 17 | $dlg.modal("show"); 18 | this.onDialogClose($dlg); 19 | }; 20 | ModalDialog.prototype.showXml = function (title, data) { 21 | var $dlg = $(this._$dialogName); 22 | var $contentElement = $dlg.find(".model-body-content"); 23 | $dlg.find(".modal-title").text(title); 24 | CodeRenderer.renderXml($contentElement[0], data); 25 | $dlg.modal("show"); 26 | this.onDialogClose($dlg); 27 | }; 28 | ModalDialog.prototype.showText = function (title, data) { 29 | var $dlg = $(this._$dialogName); 30 | var $contentElement = $dlg.find(".model-body-content"); 31 | $dlg.find(".modal-title").text(title); 32 | CodeRenderer.renderValue($contentElement[0], data); 33 | $dlg.modal("show"); 34 | this.onDialogClose($dlg); 35 | }; 36 | ModalDialog.prototype.show = function (title) { 37 | var $dlg = $(this._$dialogName); 38 | $dlg.find(".modal-title").text(title); 39 | $dlg.modal("show"); 40 | this.onDialogClose($dlg); 41 | }; 42 | ModalDialog.prototype.$getPreContentElement = function () { 43 | var $dlg = $(this._$dialogName); 44 | return $dlg.find(".model-body-preContent"); 45 | }; 46 | ModalDialog.prototype.onDialogClose = function ($dlg) { 47 | var _this = this; 48 | $dlg.on('hidden.bs.modal', function () { 49 | _this._onDlgClose.trigger(_this._$dialogName); 50 | }); 51 | }; 52 | return ModalDialog; 53 | }()); 54 | //# sourceMappingURL=ModelDialog.js.map -------------------------------------------------------------------------------- /Demo/JSLib/Types/ModelDialog.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"ModelDialog.js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I,IAAI,GAAQ,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACrC,IAAI,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;QAEvD,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAEtC,YAAY,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;QAEnD,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAEnB,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;IAEM,0BAAI,GAAX,UAAY,KAAa;QAEtB,IAAI,IAAI,GAAQ,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACrC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAEtC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAEnB,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;IAEM,2CAAqB,GAA5B;QAEG,IAAI,IAAI,GAAQ,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAErC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;IAC9C,CAAC;IAEO,mCAAa,GAArB,UAAsB,IAAS;QAA/B,iBAMC;QAJE,IAAI,CAAC,EAAE,CAAC,iBAAiB,EAAE;YAExB,KAAI,CAAC,WAAW,CAAC,OAAO,CAAC,KAAI,CAAC,YAAY,CAAC,CAAC;QAC/C,CAAC,CAAC,CAAC;IACN,CAAC;IACJ,kBAAC;AAAD,CAAC,AA1ED,IA0EC"} -------------------------------------------------------------------------------- /Demo/JSLib/Types/ModelDialog.ts: -------------------------------------------------------------------------------- 1 | /// 2 | class ModalDialog { 3 | private _$dialogName: string; 4 | private _$dlg: JQuery; 5 | private _$dlgContentParent: JQuery; 6 | private _contentElement: HTMLElement; 7 | private _$dlgTitle: JQuery; 8 | private _$dlgHeader: JQuery; 9 | private _onDlgClose = new LiteEvent(); 10 | private _codeRenderer = new CodeRenderer(); 11 | private _editor: any; 12 | 13 | public get dilaogClosed() { return this._onDlgClose; } 14 | 15 | constructor($dialogName: string = "#modal-alert") { 16 | this._$dialogName = $dialogName; 17 | this._$dlg = $(this._$dialogName); 18 | this._$dlgTitle = this._$dlg.find(".modal-title"); 19 | this._$dlgHeader = this._$dlg.find(".modal-header"); 20 | this._$dlgContentParent = this._$dlg.find(".model-body-content"); 21 | 22 | 23 | this._contentElement = this._$dlgContentParent[0]; 24 | } 25 | 26 | public showJson(title: string, data: any) { 27 | this._$dlgTitle.text(title); 28 | 29 | this._editor = this._codeRenderer.renderJson(this._contentElement, data); 30 | 31 | this._$dlg.modal("show"); 32 | 33 | this.onDialogClose(this._$dlg); 34 | } 35 | 36 | public showXml(title: string, data: any) { 37 | 38 | this._$dlgTitle.text(title); 39 | 40 | this._editor = this._codeRenderer.renderXml(this._contentElement, data); 41 | 42 | this._$dlg.modal("show"); 43 | 44 | this.onDialogClose(this._$dlg); 45 | } 46 | 47 | public showText(title: string, data: string) { 48 | 49 | this._$dlgTitle.text(title); 50 | 51 | if (data) { 52 | data = data.toString() 53 | } 54 | 55 | this._editor = this._codeRenderer.renderValue(this._contentElement, data); 56 | 57 | this._$dlg.modal("show"); 58 | 59 | this.onDialogClose(this._$dlg); 60 | } 61 | 62 | public show(title: string) 63 | { 64 | this.showText(title, ""); 65 | } 66 | 67 | public showError(title: string, data: string) 68 | { 69 | this._$dlgHeader.addClass("bg-danger"); 70 | 71 | this.showText(title, data); 72 | } 73 | 74 | private onDialogClose($dlg: any) 75 | { 76 | $dlg.on('hidden.bs.modal', () => { 77 | this._$dlgHeader.removeClass("bg-danger"); 78 | this._codeRenderer.clean(this._editor); 79 | this._onDlgClose.trigger(this._$dialogName); 80 | }); 81 | } 82 | } -------------------------------------------------------------------------------- /Demo/JSLib/Types/QidoRsEventArgs.js: -------------------------------------------------------------------------------- 1 | var QidoRsEventArgs = (function () { 2 | function QidoRsEventArgs(mediaType, studyInstanceUid, seriesInstanceUid, sopInstanceUid) { 3 | this.StudyInstanceUID = studyInstanceUid; 4 | this.SeriesInstanceUID = seriesInstanceUid; 5 | this.SopInstanceUID = sopInstanceUid; 6 | this.MediaType = mediaType; 7 | } 8 | Object.defineProperty(QidoRsEventArgs.prototype, "StudyInstanceUID", { 9 | get: function () { 10 | return this._studyInstanceUid; 11 | }, 12 | set: function (studyInstanceUID) { 13 | this._studyInstanceUid = studyInstanceUID; 14 | }, 15 | enumerable: true, 16 | configurable: true 17 | }); 18 | Object.defineProperty(QidoRsEventArgs.prototype, "SeriesInstanceUID", { 19 | get: function () { 20 | return this._seriesInstanceUid; 21 | }, 22 | set: function (seriesInstanceUID) { 23 | this._seriesInstanceUid = seriesInstanceUID; 24 | }, 25 | enumerable: true, 26 | configurable: true 27 | }); 28 | Object.defineProperty(QidoRsEventArgs.prototype, "SopInstanceUID", { 29 | get: function () { 30 | return this._sopInstanceUid; 31 | }, 32 | set: function (sopInstanceUID) { 33 | this._sopInstanceUid = sopInstanceUID; 34 | }, 35 | enumerable: true, 36 | configurable: true 37 | }); 38 | Object.defineProperty(QidoRsEventArgs.prototype, "MediaType", { 39 | get: function () { 40 | return this._mediaType; 41 | }, 42 | set: function (mediaType) { 43 | this._mediaType = mediaType; 44 | }, 45 | enumerable: true, 46 | configurable: true 47 | }); 48 | return QidoRsEventArgs; 49 | }()); 50 | //# sourceMappingURL=QidoRsEventArgs.js.map -------------------------------------------------------------------------------- /Demo/JSLib/Types/QidoRsEventArgs.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"QidoRsEventArgs.js","sourceRoot":"","sources":["QidoRsEventArgs.ts"],"names":[],"mappings":"AAAA;IAOG,yBAAY,SAAiB,EAAE,gBAAyB,EAAE,iBAA0B,EAAE,cAAuB;QAE1G,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QACzC,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;QAC3C,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACrC,IAAI,CAAC,SAAS,GAAU,SAAS,CAAE;IACtC,CAAC;IAED,sBAAW,6CAAgB;aAA3B;YAEG,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC;QACjC,CAAC;aAED,UAA4B,gBAAwB;YAEjD,IAAI,CAAC,iBAAiB,GAAG,gBAAgB,CAAC;QAC7C,CAAC;;;OALA;IAOD,sBAAW,8CAAiB;aAA5B;YACG,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC;QAClC,CAAC;aAED,UAA6B,iBAAyB;YACnD,IAAI,CAAC,kBAAkB,GAAG,iBAAiB,CAAC;QAC/C,CAAC;;;OAJA;IAMD,sBAAW,2CAAc;aAAzB;YACG,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC;QAC/B,CAAC;aAED,UAA0B,cAAsB;YAC7C,IAAI,CAAC,eAAe,GAAG,cAAc,CAAC;QACzC,CAAC;;;OAJA;IAMD,sBAAW,sCAAS;aAApB;YACG,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC;QAC1B,CAAC;aAED,UAAqB,SAAiB;YACnC,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC/B,CAAC;;;OAJA;IAMJ,sBAAC;AAAD,CAAC,AAjDD,IAiDC"} -------------------------------------------------------------------------------- /Demo/JSLib/Types/QidoRsEventArgs.ts: -------------------------------------------------------------------------------- 1 | class QidoRsEventArgs 2 | { 3 | private _studyInstanceUid: string; 4 | private _seriesInstanceUid: string; 5 | private _sopInstanceUid: string; 6 | private _mediaType: string; 7 | 8 | constructor(mediaType: string, studyInstanceUid?: string, seriesInstanceUid?: string, sopInstanceUid?: string ) 9 | { 10 | this.StudyInstanceUID = studyInstanceUid; 11 | this.SeriesInstanceUID = seriesInstanceUid; 12 | this.SopInstanceUID = sopInstanceUid; 13 | this.MediaType = mediaType ; 14 | } 15 | 16 | public get StudyInstanceUID() 17 | { 18 | return this._studyInstanceUid; 19 | } 20 | 21 | public set StudyInstanceUID(studyInstanceUID: string) 22 | { 23 | this._studyInstanceUid = studyInstanceUID; 24 | } 25 | 26 | public get SeriesInstanceUID() { 27 | return this._seriesInstanceUid; 28 | } 29 | 30 | public set SeriesInstanceUID(seriesInstanceUID: string) { 31 | this._seriesInstanceUid = seriesInstanceUID; 32 | } 33 | 34 | public get SopInstanceUID() { 35 | return this._sopInstanceUid; 36 | } 37 | 38 | public set SopInstanceUID(sopInstanceUID: string) { 39 | this._sopInstanceUid = sopInstanceUID; 40 | } 41 | 42 | public get MediaType() { 43 | return this._mediaType; 44 | } 45 | 46 | public set MediaType(mediaType: string) { 47 | this._mediaType = mediaType; 48 | } 49 | 50 | } -------------------------------------------------------------------------------- /Demo/JSLib/Types/RsFramesEventArgs.js: -------------------------------------------------------------------------------- 1 | var __extends = (this && this.__extends) || function (d, b) { 2 | for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; 3 | function __() { this.constructor = d; } 4 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 5 | }; 6 | /// 7 | var RsFramesEventArgs = (function (_super) { 8 | __extends(RsFramesEventArgs, _super); 9 | function RsFramesEventArgs(instance, mediaType, frames) { 10 | var _this = _super.call(this, instance, mediaType) || this; 11 | _this._frames = frames; 12 | return _this; 13 | } 14 | Object.defineProperty(RsFramesEventArgs.prototype, "FrameList", { 15 | get: function () { 16 | return this._frames; 17 | }, 18 | set: function (frames) { 19 | this._frames = frames; 20 | }, 21 | enumerable: true, 22 | configurable: true 23 | }); 24 | ; 25 | ; 26 | return RsFramesEventArgs; 27 | }(RsInstanceEventArgs)); 28 | //# sourceMappingURL=RsFramesEventArgs.js.map -------------------------------------------------------------------------------- /Demo/JSLib/Types/RsFramesEventArgs.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"RsFramesEventArgs.js","sourceRoot":"","sources":["RsFramesEventArgs.ts"],"names":[],"mappings":";;;;;AAAA,+CAA+C;AAC/C;IAAgC,qCAAmB;IAEhD,2BAAY,QAAwB,EAAE,SAAiB,EAAE,MAAc;QAAvE,YACG,kBAAM,QAAQ,EAAE,SAAS,CAAC,SAG5B;QADE,KAAI,CAAC,OAAO,GAAE,MAAM,CAAE;;IACzB,CAAC;IAID,sBAAW,wCAAS;aAApB;YACG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;QACvB,CAAC;aACD,UAAqB,MAAc;YAChC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACzB,CAAC;;;OAHA;IAAA,CAAC;IAGD,CAAC;IACL,wBAAC;AAAD,CAAC,AAhBD,CAAgC,mBAAmB,GAgBlD"} -------------------------------------------------------------------------------- /Demo/JSLib/Types/RsFramesEventArgs.ts: -------------------------------------------------------------------------------- 1 | /// 2 | class RsFramesEventArgs extends RsInstanceEventArgs 3 | { 4 | constructor(instance: InstanceParams, mediaType: string, frames: string) { 5 | super(instance, mediaType); 6 | 7 | this._frames= frames ; 8 | } 9 | 10 | private _frames: string; 11 | 12 | public get FrameList(): string { 13 | return this._frames; 14 | }; 15 | public set FrameList(frames: string) { 16 | this._frames = frames; 17 | }; 18 | } -------------------------------------------------------------------------------- /Demo/JSLib/Types/RsInstanceEventArgs.ts: -------------------------------------------------------------------------------- 1 | class RsInstanceEventArgs 2 | { 3 | constructor(instance: InstanceParams, mediaType: string) 4 | { 5 | this._instanceParams = instance; 6 | this._mediaType = mediaType; 7 | } 8 | 9 | private _instanceParams: InstanceParams; 10 | private _mediaType: string; 11 | 12 | public get InstanceParams(): InstanceParams { 13 | return this._instanceParams; 14 | }; 15 | public set InstanceParams( instance : InstanceParams ) { 16 | this._instanceParams = instance ; 17 | }; 18 | 19 | public get MediaType(): string { 20 | return this._mediaType; 21 | }; 22 | public set MediaType(mediaType: string) { 23 | this._mediaType = mediaType; 24 | }; 25 | 26 | 27 | } -------------------------------------------------------------------------------- /Demo/JSLib/Types/StudyEventArgs.js: -------------------------------------------------------------------------------- 1 | var StudyEventArgs = (function () { 2 | function StudyEventArgs(study) { 3 | this._studyParams = study; 4 | } 5 | Object.defineProperty(StudyEventArgs.prototype, "StudyParams", { 6 | get: function () { 7 | return this._studyParams; 8 | }, 9 | set: function (instance) { 10 | this._studyParams = instance; 11 | }, 12 | enumerable: true, 13 | configurable: true 14 | }); 15 | ; 16 | ; 17 | return StudyEventArgs; 18 | }()); 19 | //# sourceMappingURL=StudyEventArgs.js.map -------------------------------------------------------------------------------- /Demo/JSLib/Types/StudyEventArgs.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"StudyEventArgs.js","sourceRoot":"","sources":["StudyEventArgs.ts"],"names":[],"mappings":"AAAA;IACG,wBAAY,KAAkB;QAC3B,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;IAC7B,CAAC;IAID,sBAAW,uCAAW;aAAtB;YACG,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC;QAC5B,CAAC;aACD,UAAuB,QAAqB;YACzC,IAAI,CAAC,YAAY,GAAG,QAAQ,CAAC;QAChC,CAAC;;;OAHA;IAAA,CAAC;IAGD,CAAC;IACL,qBAAC;AAAD,CAAC,AAbD,IAaC"} -------------------------------------------------------------------------------- /Demo/JSLib/Types/StudyEventArgs.ts: -------------------------------------------------------------------------------- 1 | class StudyEventArgs { 2 | constructor(study: StudyParams) { 3 | this._studyParams = study; 4 | } 5 | 6 | private _studyParams: StudyParams; 7 | 8 | public get StudyParams(): StudyParams{ 9 | return this._studyParams; 10 | }; 11 | public set StudyParams(instance: StudyParams) { 12 | this._studyParams = instance; 13 | }; 14 | } -------------------------------------------------------------------------------- /Demo/JSLib/Types/WadoUriEventArgs.js: -------------------------------------------------------------------------------- 1 | var __extends = (this && this.__extends) || function (d, b) { 2 | for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; 3 | function __() { this.constructor = d; } 4 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 5 | }; 6 | var WadoUriEventArgs = (function (_super) { 7 | __extends(WadoUriEventArgs, _super); 8 | function WadoUriEventArgs(instance, contentType, frame) { 9 | var _this = _super.call(this, instance, contentType) || this; 10 | _this._frame = ""; 11 | _this._frame = frame; 12 | return _this; 13 | } 14 | Object.defineProperty(WadoUriEventArgs.prototype, "Frame", { 15 | get: function () { 16 | return this._frame; 17 | }, 18 | set: function (frame) { 19 | this._frame = frame; 20 | }, 21 | enumerable: true, 22 | configurable: true 23 | }); 24 | ; 25 | ; 26 | return WadoUriEventArgs; 27 | }(RsInstanceEventArgs)); 28 | //# sourceMappingURL=WadoUriEventArgs.js.map -------------------------------------------------------------------------------- /Demo/JSLib/Types/WadoUriEventArgs.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"WadoUriEventArgs.js","sourceRoot":"","sources":["WadoUriEventArgs.ts"],"names":[],"mappings":";;;;;AAAA;IAA+B,oCAAmB;IAG5C,0BAAY,QAAwB,EAAE,WAAmB,EAAE,KAAa;QAAxE,YACA,kBAAM,QAAQ,EAAE,WAAW,CAAC,SAG3B;QALO,YAAM,GAAW,EAAE,CAAC;QAI5B,KAAI,CAAC,MAAM,GAAG,KAAK,CAAC;;IACpB,CAAC;IAED,sBAAW,mCAAK;aAAhB;YACG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;QACtB,CAAC;aACD,UAAiB,KAAa;YAC3B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACvB,CAAC;;;OAHA;IAAA,CAAC;IAGD,CAAC;IAER,uBAAC;AAAD,CAAC,AAhBD,CAA+B,mBAAmB,GAgBjD"} -------------------------------------------------------------------------------- /Demo/JSLib/Types/WadoUriEventArgs.ts: -------------------------------------------------------------------------------- 1 | class WadoUriEventArgs extends RsInstanceEventArgs 2 | { 3 | private _frame: string = ""; 4 | constructor(instance: InstanceParams, contentType: string, frame: string) { 5 | super(instance, contentType); 6 | 7 | this._frame = frame; 8 | } 9 | 10 | public get Frame(): string { 11 | return this._frame; 12 | }; 13 | public set Frame(frame: string) { 14 | this._frame = frame; 15 | }; 16 | 17 | } -------------------------------------------------------------------------------- /Demo/JSLib/Types/fileReaderAsync.js: -------------------------------------------------------------------------------- 1 | var fileReaderAsync = (function () { 2 | function fileReaderAsync() { 3 | } 4 | fileReaderAsync.prototype.read = function (file) { 5 | var deferred = $.Deferred(); 6 | var reader = new FileReader(); 7 | reader.onloadend = function (e) { 8 | deferred.resolve(e.target.result); 9 | }; 10 | reader.onerror = function (e) { 11 | deferred.reject(e.target.error); 12 | }; 13 | reader.readAsArrayBuffer(file); 14 | return deferred.promise(); 15 | }; 16 | return fileReaderAsync; 17 | }()); 18 | //# sourceMappingURL=fileReaderAsync.js.map -------------------------------------------------------------------------------- /Demo/JSLib/Types/fileReaderAsync.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"fileReaderAsync.js","sourceRoot":"","sources":["fileReaderAsync.ts"],"names":[],"mappings":"AAAA;IAAA;IAkBA,CAAC;IAjBS,8BAAI,GAAX,UAAY,IAAS;QAClB,IAAI,QAAQ,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC;QAC5B,IAAI,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;QAG9B,MAAM,CAAC,SAAS,GAAG,UAAU,CAAM;YAChC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACrC,CAAC,CAAA;QAED,MAAM,CAAC,OAAO,GAAG,UAAU,CAAM;YAC9B,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACnC,CAAC,CAAA;QAED,MAAM,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;QAE/B,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;IAC7B,CAAC;IACJ,sBAAC;AAAD,CAAC,AAlBD,IAkBC"} -------------------------------------------------------------------------------- /Demo/JSLib/Types/fileReaderAsync.ts: -------------------------------------------------------------------------------- 1 | class fileReaderAsync { 2 | public read(file: any): JQueryPromise { 3 | var deferred = $.Deferred(); 4 | var reader = new FileReader(); 5 | 6 | 7 | reader.onloadend = function (e: any) { 8 | deferred.resolve(e.target.result); 9 | } 10 | 11 | reader.onerror = function (e: any) { 12 | deferred.reject(e.target.error); 13 | } 14 | 15 | reader.readAsArrayBuffer(file); 16 | 17 | return deferred.promise(); 18 | } 19 | } -------------------------------------------------------------------------------- /Demo/JSLib/Types/rsinstanceeventargs.js: -------------------------------------------------------------------------------- 1 | var RsInstanceEventArgs = (function () { 2 | function RsInstanceEventArgs(instance, mediaType) { 3 | this._instanceParams = instance; 4 | this._mediaType = mediaType; 5 | } 6 | Object.defineProperty(RsInstanceEventArgs.prototype, "InstanceParams", { 7 | get: function () { 8 | return this._instanceParams; 9 | }, 10 | set: function (instance) { 11 | this._instanceParams = instance; 12 | }, 13 | enumerable: true, 14 | configurable: true 15 | }); 16 | ; 17 | ; 18 | Object.defineProperty(RsInstanceEventArgs.prototype, "MediaType", { 19 | get: function () { 20 | return this._mediaType; 21 | }, 22 | set: function (mediaType) { 23 | this._mediaType = mediaType; 24 | }, 25 | enumerable: true, 26 | configurable: true 27 | }); 28 | ; 29 | ; 30 | return RsInstanceEventArgs; 31 | }()); 32 | //# sourceMappingURL=rsinstanceeventargs.js.map -------------------------------------------------------------------------------- /Demo/JSLib/Types/rsinstanceeventargs.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"rsinstanceeventargs.js","sourceRoot":"","sources":["rsinstanceeventargs.ts"],"names":[],"mappings":"AAAA;IAEG,6BAAY,QAAwB,EAAE,SAAiB;QAEpD,IAAI,CAAC,eAAe,GAAG,QAAQ,CAAC;QAChC,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;IAC/B,CAAC;IAKD,sBAAW,+CAAc;aAAzB;YACG,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC;QAC/B,CAAC;aACD,UAA2B,QAAyB;YACjD,IAAI,CAAC,eAAe,GAAG,QAAQ,CAAE;QACpC,CAAC;;;OAHA;IAAA,CAAC;IAGD,CAAC;IAEF,sBAAW,0CAAS;aAApB;YACG,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC;QAC1B,CAAC;aACD,UAAqB,SAAiB;YACnC,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC/B,CAAC;;;OAHA;IAAA,CAAC;IAGD,CAAC;IAGL,0BAAC;AAAD,CAAC,AA1BD,IA0BC"} -------------------------------------------------------------------------------- /Demo/JSLib/appUtils.js: -------------------------------------------------------------------------------- 1 | var appUtils; 2 | (function (appUtils) { 3 | function download(data, filename) { 4 | //http://stackoverflow.com/questions/16086162/handle-file-download-from-ajax-post/23797348#23797348 5 | var blob = new Blob([data], { type: "application/octet-stream" }); 6 | if (typeof window.navigator.msSaveBlob !== 'undefined') { 7 | // IE workaround for "HTML7007: One or more blob URLs were revoked by closing the blob for which they were created. These URLs will no longer resolve as the data backing the URL has been freed." 8 | window.navigator.msSaveBlob(blob, filename); 9 | } 10 | else { 11 | var URL = window.URL || window.webkitURL; 12 | var downloadUrl = URL.createObjectURL(blob); 13 | if (filename) { 14 | // use HTML5 a[download] attribute to specify filename 15 | var a = document.createElement("a"); 16 | // safari doesn't support this yet 17 | if (typeof a.download === 'undefined') { 18 | window.location.assign(downloadUrl); 19 | } 20 | else { 21 | a.href = downloadUrl; 22 | a.download = filename; 23 | document.body.appendChild(a); 24 | a.click(); 25 | //TODO: this should be added, need testing 26 | document.body.removeChild(a); 27 | } 28 | } 29 | else { 30 | window.location.assign(downloadUrl); 31 | } 32 | } 33 | } 34 | appUtils.download = download; 35 | function showError(message) { 36 | alert("Error\n\n" + message); 37 | } 38 | appUtils.showError = showError; 39 | function showInfo(message) { 40 | alert(message); 41 | } 42 | appUtils.showInfo = showInfo; 43 | })(appUtils || (appUtils = {})); 44 | //# sourceMappingURL=appUtils.js.map -------------------------------------------------------------------------------- /Demo/JSLib/appUtils.js.map: -------------------------------------------------------------------------------- 1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AC;YACJ,CAAC;YAAC,IAAI,CAAC,CAAC;gBACL,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;YACvC,CAAC;QACJ,CAAC;IACJ,CAAC;IA9Be,iBAAQ,WA8BvB,CAAA;IAED,mBAA0B,OAAgB;QAGvC,KAAK,CAAC,WAAW,GAAG,OAAO,CAAC,CAAC;IAChC,CAAC;IAJe,kBAAS,YAIxB,CAAA;IAED,kBAAyB,OAAc;QACpC,KAAK,CAAC,OAAO,CAAC,CAAC;IAClB,CAAC;IAFe,iBAAQ,WAEvB,CAAA;AACJ,CAAC,EA3CM,QAAQ,KAAR,QAAQ,QA2Cd"} -------------------------------------------------------------------------------- /Demo/JSLib/appUtils.ts: -------------------------------------------------------------------------------- 1 | module appUtils 2 | { 3 | export function download(data: any, filename: string) 4 | { 5 | //http://stackoverflow.com/questions/16086162/handle-file-download-from-ajax-post/23797348#23797348 6 | var blob = new Blob([data], { type: "application/octet-stream" }); 7 | if (typeof window.navigator.msSaveBlob !== 'undefined') { 8 | // IE workaround for "HTML7007: One or more blob URLs were revoked by closing the blob for which they were created. These URLs will no longer resolve as the data backing the URL has been freed." 9 | window.navigator.msSaveBlob(blob, filename); 10 | } 11 | else { 12 | var URL = window.URL || window.webkitURL; 13 | var downloadUrl = URL.createObjectURL(blob); 14 | 15 | if (filename) { 16 | // use HTML5 a[download] attribute to specify filename 17 | var a = document.createElement("a"); 18 | // safari doesn't support this yet 19 | if (typeof a.download === 'undefined') { 20 | window.location.assign(downloadUrl); 21 | } else { 22 | a.href = downloadUrl; 23 | a.download = filename; 24 | document.body.appendChild(a); 25 | a.click(); 26 | //TODO: this should be added, need testing 27 | document.body.removeChild(a); 28 | } 29 | } else { 30 | window.location.assign(downloadUrl); 31 | } 32 | } 33 | } 34 | 35 | } -------------------------------------------------------------------------------- /Demo/JSLib/copyImageUrlView.js: -------------------------------------------------------------------------------- 1 | var copyImageUrlView = (function () { 2 | function copyImageUrlView($parent, uriProxy) { 3 | this._$parent = $parent; 4 | this._uriProxy = uriProxy; 5 | this._instanceUrl = null; 6 | this._$copyBtn = $parent.find('#copy-image-url-button'); 7 | this._$downloadBtn = $parent.find('#dlownload-image-url-button'); 8 | this.registerImageURLButtons(); 9 | } 10 | copyImageUrlView.prototype.setUrl = function (instanceUrl) { 11 | this._instanceUrl = instanceUrl; 12 | this._$parent.find("#image-url-input").val(instanceUrl); 13 | }; 14 | copyImageUrlView.prototype.registerImageURLButtons = function () { 15 | var _this = this; 16 | this._$downloadBtn.bind('click', function () { 17 | if (_this._instanceUrl) { 18 | _this._uriProxy.getObjectInstance(_this._instanceUrl).done(function (data) { 19 | appUtils.download(data, "dicom.dcm"); 20 | }).fail(function (err) { 21 | appUtils.showError(err.message); 22 | }); 23 | } 24 | }); 25 | this._$copyBtn.on('click', function () { 26 | var inputSelector = _this._$copyBtn.attr("data-clipboard-target"); 27 | var input = _this._$parent[0].querySelector(inputSelector); 28 | if ($(input).val() == "") { 29 | return; 30 | } 31 | input.select(); 32 | try { 33 | var success = document.execCommand('copy'); 34 | if (success) { 35 | _this._$copyBtn.trigger('copied', ['Copied!']); 36 | } 37 | else { 38 | _this._$copyBtn.trigger('copied', ['Copy with Ctrl-c']); 39 | } 40 | } 41 | catch (err) { 42 | _this._$copyBtn.trigger('copied', ['Copy with Ctrl-c']); 43 | } 44 | }); 45 | // Handler for updating the tooltip message. 46 | this._$copyBtn.on('copied', function (event, message) { 47 | _this._$copyBtn.attr('title', message) 48 | .tooltip('fixTitle') 49 | .tooltip('show') 50 | .attr('title', "Copy to Clipboard") 51 | .tooltip('fixTitle'); 52 | }); 53 | }; 54 | return copyImageUrlView; 55 | }()); 56 | //# sourceMappingURL=copyImageUrlView.js.map -------------------------------------------------------------------------------- /Demo/JSLib/copyImageUrlView.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"copyImageUrlView.js","sourceRoot":"","sources":["copyImageUrlView.ts"],"names":[],"mappings":"AAAA;IAQG,0BAAY,OA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aAAa,CAAC,CAAC;YAE1D,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;gBAAC,MAAM,CAAC;YAAC,CAAC;YAErC,KAAK,CAAC,MAAM,EAAE,CAAC;YAEf,IAAI,CAAC;gBACF,IAAI,OAAO,GAAG,QAAQ,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;gBAC3C,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;oBACX,KAAI,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;gBACjD,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACL,KAAI,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,kBAAkB,CAAC,CAAC,CAAC;gBAC1D,CAAC;YACJ,CAAC;YAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;gBACZ,KAAI,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,kBAAkB,CAAC,CAAC,CAAC;YAC1D,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,4CAA4C;QAC5C,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,QAAQ,EAAE,UAAC,KAAK,EAAE,OAAO;YACxC,KAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC;iBACjC,OAAO,CAAC,UAAU,CAAC;iBACnB,OAAO,CAAC,MAAM,CAAC;iBACf,IAAI,CAAC,OAAO,EAAE,mBAAmB,CAAC;iBAClC,OAAO,CAAC,UAAU,CAAC,CAAC;QAC3B,CAAC,CAAC,CAAC;IAGN,CAAC;IACJ,uBAAC;AAAD,CAAC,AA5ED,IA4EC"} -------------------------------------------------------------------------------- /Demo/JSLib/copyImageUrlView.ts: -------------------------------------------------------------------------------- 1 | class copyImageUrlView 2 | { 3 | private _$parent: JQuery; 4 | private _instanceUrl: string; 5 | private _uriProxy: WadoUriProxy; 6 | private _$copyBtn: JQuery; 7 | private _$downloadBtn: JQuery; 8 | 9 | constructor($parent: JQuery, uriProxy: WadoUriProxy ) 10 | { 11 | this._$parent = $parent; 12 | this._uriProxy = uriProxy; 13 | this._instanceUrl = null; 14 | 15 | this._$copyBtn = $parent.find('#copy-image-url-button'); 16 | this._$downloadBtn = $parent.find('#dlownload-image-url-button'); 17 | 18 | this.registerImageURLButtons(); 19 | } 20 | 21 | public setUrl(instanceUrl: string) 22 | { 23 | this._instanceUrl = instanceUrl; 24 | 25 | this._$parent.find("#image-url-input").val(instanceUrl); 26 | } 27 | 28 | private registerImageURLButtons() { 29 | 30 | this._$downloadBtn.bind('click', () => { 31 | 32 | if (this._instanceUrl) { 33 | 34 | this._uriProxy.getObjectInstance(this._instanceUrl).done( 35 | (data) => { 36 | appUtils.download(data, "dicom.dcm"); 37 | }).fail( 38 | (err) => { 39 | new ModalDialog().showError("Error", err.message); 40 | } 41 | ); 42 | } 43 | }); 44 | 45 | 46 | this._$copyBtn.on('click', () => { 47 | var inputSelector = this._$copyBtn.attr("data-clipboard-target"); 48 | var input = this._$parent[0].querySelector(inputSelector); 49 | 50 | if ($(input).val() == "") { return; } 51 | 52 | input.select(); 53 | 54 | try { 55 | var success = document.execCommand('copy'); 56 | if (success) { 57 | this._$copyBtn.trigger('copied', ['Copied!']); 58 | } else { 59 | this._$copyBtn.trigger('copied', ['Copy with Ctrl-c']); 60 | } 61 | } catch (err) { 62 | this._$copyBtn.trigger('copied', ['Copy with Ctrl-c']); 63 | } 64 | }); 65 | 66 | // Handler for updating the tooltip message. 67 | this._$copyBtn.on('copied', (event, message) => { 68 | this._$copyBtn.attr('title', message) 69 | .tooltip('fixTitle') 70 | .tooltip('show') 71 | .attr('title', "Copy to Clipboard") 72 | .tooltip('fixTitle'); 73 | }); 74 | 75 | 76 | } 77 | } -------------------------------------------------------------------------------- /Demo/JSLib/demo.js: -------------------------------------------------------------------------------- 1 | window.onload = function () { 2 | new app(); 3 | }; 4 | var app = (function () { 5 | function app() { 6 | this.__AUTHENTICATION_COOKIE = "__dicomwebclient"; 7 | this.init(); 8 | } 9 | app.prototype.init = function () { 10 | if (typeof (serverUrl) != "undefined") { 11 | DICOMwebJS.ServerConfiguration.BaseServerUrl = serverUrl; 12 | } 13 | else { 14 | DICOMwebJS.ServerConfiguration.BaseServerUrl = $("#serverList").val(); 15 | } 16 | var model = new QueryModel(); 17 | var rsProxy = new WadoRsProxy(); 18 | var uriProxy = new WadoUriProxy(); 19 | var qidoProxy = new QidoRsProxy(); 20 | var rsService = new RetrieveService(rsProxy); 21 | var delowProxy = new DelowRsProxy(); 22 | var queryView = new QueryView(document.getElementById("#content"), model, rsService); 23 | var queryController = new QueryController(queryView, model, qidoProxy, rsService, uriProxy, delowProxy); 24 | var viewer = new WadoViewer($(".dicomWeb-js-viewer"), uriProxy); 25 | this.initAuthentication(); 26 | queryView.instanceViewRequest.on(function (args) { 27 | $('.nav-tabs a[href="#_ViewerView"]').tab('show'); 28 | viewer.loadInstance(args.InstanceParams); 29 | }); 30 | $("#SelectedTransferSyntax").change(function () { 31 | var loadedInstance = viewer.loadedInstance(); 32 | if (null != loadedInstance) { 33 | viewer.loadInstance(loadedInstance, $("#SelectedTransferSyntax").val()); 34 | } 35 | }); 36 | new StoreView($("#_StoreView")[0]); 37 | //window.onerror = function (message, url, lineNumber) { 38 | // //save error and send to server for example. 39 | // alert(message + "\n" + url + "\n" + lineNumber); 40 | // return true; 41 | //}; 42 | $("#serverList").change(function () { 43 | DICOMwebJS.ServerConfiguration.BaseServerUrl = $("#serverList").val(); 44 | }); 45 | }; 46 | //public initViewer() { 47 | // // base function to get elements 48 | // dwv.gui.getElement = dwv.gui.base.getElement; 49 | // dwv.gui.displayProgress = function (percent) { }; 50 | // // create the dwv app 51 | // var viewer = new dwv.App(); 52 | // // initialise with the id of the container div 53 | // viewer.init({ 54 | // "containerDivId": "dwv", 55 | // "tools": ["WindowLevel"], // or try "ZoomAndPan" 56 | // }); 57 | // return viewer; 58 | //} 59 | app.prototype.initAuthentication = function () { 60 | var token = this.getAuthenticationToken(); 61 | if (token) { 62 | DICOMwebJS.ServerConfiguration.IncludeAuthorizationHeader = true; 63 | DICOMwebJS.ServerConfiguration.SecurityToken = "Bearer " + token; 64 | } 65 | }; 66 | app.prototype.getAuthenticationToken = function () { 67 | var name = this.__AUTHENTICATION_COOKIE; 68 | //http://stackoverflow.com/questions/14573223/set-cookie-and-get-cookie-with-javascript 69 | //function readCookie(name) { 70 | var nameEQ = name + "="; 71 | var ca = document.cookie.split(';'); 72 | for (var i = 0; i < ca.length; i++) { 73 | var c = ca[i]; 74 | while (c.charAt(0) == ' ') 75 | c = c.substring(1, c.length); 76 | if (c.indexOf(nameEQ) == 0) 77 | return c.substring(nameEQ.length, c.length); 78 | } 79 | return null; 80 | //} 81 | }; 82 | return app; 83 | }()); 84 | $(document).on('change', '.btn-file :file', function () { 85 | var input = $(this), numFiles = input.get(0).files ? input.get(0).files.length : 1, label = input.val().replace(/\\/g, '/').replace(/.*\//, ''); 86 | input.trigger('fileselect', [numFiles, label]); 87 | }); 88 | $(document).ready(function () { 89 | $('.btn-file :file').on('fileselect', function (event, numFiles, label) { 90 | var input = $(this).parents('.input-group').find(':text'), log = numFiles > 1 ? numFiles + ' files selected' : label; 91 | if (input.length) { 92 | input.val(log); 93 | } 94 | else { 95 | if (log) 96 | alert(log); 97 | } 98 | }); 99 | }); 100 | //# sourceMappingURL=demo.js.map -------------------------------------------------------------------------------- /Demo/JSLib/demo.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"demo.js","sourceRoot":"","sources":["demo.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,GAAG;IACb,IAAI,GAAG,EAAE,CAAC;AACb,CAAC,CAAC;AAIF;IAIG;QAFQ,4BAAuB,GAAU,kBAAkB,CAAA;QAGxD,IAAI,CAAC,IAAI,EAAE,CAAC;IACf,CAAC;IAEO,kBAAI,GAAZ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AE,UAAU,KAAK,EAAE,QAAQ,EAAE,KAAK;QAEnE,IAAI,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,EACtD,GAAG,GAAG,QAAQ,GAAG,CAAC,GAAG,QAAQ,GAAG,iBAAiB,GAAG,KAAK,CAAC;QAE7D,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;YAChB,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAClB,CAAC;QAAC,IAAI,CAAC,CAAC;YACL,EAAE,CAAC,CAAC,GAAG,CAAC;gBAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACvB,CAAC;IAEJ,CAAC,CAAC,CAAC;AACN,CAAC,CAAC,CAAC"} -------------------------------------------------------------------------------- /Demo/Models/AppSettings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Linq; 5 | using System.Web; 6 | 7 | namespace DICOMwebJS.Demo.Models 8 | { 9 | public class AppSettings 10 | { 11 | private static AppSettings _current = new AppSettings ( ) ; 12 | 13 | public AppSettings ( ) 14 | { 15 | 16 | ServerUrl = ConfigurationManager.AppSettings["app:serverUrl"]; 17 | OhifViewerUrl = ConfigurationManager.AppSettings["app:ohifViewer"]; 18 | MaxUpload = -1 ; 19 | SupportAnonymizer = true; 20 | 21 | var maxUploadValue = ConfigurationManager.AppSettings["app:maxUpload"]; 22 | var supportAnonymizerValue = ConfigurationManager.AppSettings["app:supportAnonymizer"]; 23 | 24 | 25 | if ( !string.IsNullOrEmpty (maxUploadValue)) 26 | { 27 | MaxUpload = int.Parse (maxUploadValue); 28 | } 29 | 30 | if ( !string.IsNullOrEmpty ( supportAnonymizerValue)) 31 | { 32 | SupportAnonymizer = bool.Parse ( supportAnonymizerValue) ; 33 | } 34 | } 35 | 36 | public static AppSettings Current 37 | { 38 | get 39 | { 40 | return _current ; 41 | } 42 | 43 | set 44 | { 45 | _current = value ; 46 | } 47 | } 48 | 49 | public string ServerUrl { get; set; } 50 | 51 | public string OhifViewerUrl { get; set; } 52 | 53 | public bool SupportAnonymizer { get; set; } 54 | 55 | public int MaxUpload { get; set; } 56 | } 57 | } -------------------------------------------------------------------------------- /Demo/Models/MimeTypes.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | 6 | namespace DICOMwebJS.Demo.Models 7 | { 8 | static class MimeTypes 9 | { 10 | public static string DICOM = "application/dicom"; 11 | public static string xmlDicom = "application/dicom+xml"; 12 | public static string Jpeg = "image/jpeg"; 13 | public static string WebP = "image/webp"; 14 | public static string Json = "application/dicom+json"; 15 | public static string UncompressedData = "application/octet-stream"; 16 | public static string PlainText = "text/plain"; 17 | public static string MultipartRelated = "multipart/related"; 18 | } 19 | } -------------------------------------------------------------------------------- /Demo/Models/ServersViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | 7 | namespace DICOMwebJS.Demo.Models 8 | { 9 | public class ServersViewModel : List 10 | { 11 | public ServersViewModel ( ) 12 | {} 13 | 14 | public ServersViewModel ( IEnumerable> servers ) 15 | { 16 | AddRange ( servers.Select ( n=> new SelectListItem ( ) { Text = n.Key, Value = n.Value } ) ) ; 17 | 18 | if ( Count > 0 ) { this[0].Selected = true ; } 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /Demo/Models/ToolbarViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Web; 6 | 7 | namespace DICOMwebJS.Demo.Models 8 | { 9 | public class ToolbarFactory 10 | { 11 | private static ToolbarViewModel _defaultInstanceDetails = InstanceToolbarBuilder.Build ( ) ; 12 | 13 | public static ToolbarViewModel DefaultInstanceDetails 14 | { 15 | get 16 | { 17 | return _defaultInstanceDetails ; 18 | } 19 | } 20 | 21 | private static class InstanceToolbarBuilder 22 | { 23 | private static ToolbarViewModel _instance = null ; 24 | 25 | public static ToolbarViewModel Build ( ) 26 | { 27 | 28 | if ( null == _instance ) 29 | { 30 | _instance = new ToolbarViewModel ( ) ; 31 | 32 | ToolbarGroup framesGroup = new ToolbarGroup ( ) { Name="WADO-RS-Frames*" }; 33 | ToolbarGroup WadoUriGroup = new ToolbarGroup ( ) { Name="WADO-URI" }; 34 | 35 | 36 | framesGroup.Add ( new ToolbarInput ( "frame list (e.g. 1,4,6)", "text", "data-rs-frames-input" )) ; 37 | framesGroup.Add ( new ToolbarLink ( "Uncompressed", "data-rs-frames", MimeTypes.UncompressedData )) ; 38 | 39 | WadoUriGroup.Add ( new ToolbarInput ( "single frame number (optional)", "text", "data-uri-frame-input" )) ; 40 | WadoUriGroup.Add ( new ToolbarLink ( "DICOM", "data-uri-instance", MimeTypes.DICOM )) ; 41 | 42 | _instance.Add ( framesGroup ) ; 43 | _instance.Add (WadoUriGroup ) ; 44 | } 45 | 46 | return _instance ; 47 | } 48 | } 49 | } 50 | 51 | public class ToolbarViewModel : List 52 | { 53 | } 54 | 55 | public interface IToolbarItem 56 | { 57 | IHtmlString Render ( ) ; 58 | } 59 | 60 | public class ToolbarLink : IToolbarItem 61 | { 62 | public ToolbarLink ( string text, string dataAttribute, string dataArgs ) 63 | { 64 | Text = text ; 65 | DataAttribute = dataAttribute ; 66 | DataArgs = dataArgs ; 67 | } 68 | 69 | public string Text { get; set; } 70 | public string DataAttribute { get; set; } 71 | public string DataArgs { get; set; } 72 | 73 | public IHtmlString Render ( ) 74 | { 75 | 76 | return new HtmlString ( string.Format ( LinkHtmlFormat, DataAttribute, DataArgs, Text ) ) ; 77 | } 78 | 79 | private static string LinkHtmlFormat = "{2}" ; 80 | } 81 | 82 | public class ToolbarInput : IToolbarItem 83 | { 84 | public ToolbarInput ( string text, string inputType, string dataAttribute ) 85 | { 86 | Text = text ; 87 | InputType = inputType ; 88 | DataAttribute = dataAttribute ; 89 | } 90 | 91 | public string Text { get; set; } 92 | public string InputType { get; set; } 93 | public string DataAttribute { get; set; } 94 | 95 | 96 | public IHtmlString Render ( ) 97 | { 98 | return new HtmlString ( "") ; 99 | } 100 | } 101 | 102 | public class ToolbarGroup : List 103 | { 104 | public string Name { get; set; } 105 | } 106 | } -------------------------------------------------------------------------------- /Demo/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("DICOMwebJS Demo")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("DICOMcloud")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("09f73e83-0ef1-4e7b-895f-f87fe964a6ee")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Revision and Build Numbers 33 | // by using the '*' as shown below: 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /Demo/Properties/PublishProfiles/DICOMwebDemo.pubxml: -------------------------------------------------------------------------------- 1 |  2 | 6 | 7 | 8 | MSDeploy 9 | AzureWebSite 10 | Debug 11 | Any CPU 12 | http://dicomwebdemo.azurewebsites.net 13 | True 14 | False 15 | dicomwebdemo.scm.azurewebsites.net:443 16 | DICOMwebDemo 17 | 18 | False 19 | WMSVC 20 | True 21 | $DICOMwebDemo 22 | <_SavePWD>True 23 | <_DestinationType>AzureWebSite 24 | False 25 | 26 | -------------------------------------------------------------------------------- /Demo/Properties/PublishProfiles/dicomwebdemo-dev - Web Deploy.pubxml: -------------------------------------------------------------------------------- 1 |  2 | 6 | 7 | 8 | MSDeploy 9 | AzureWebSite 10 | Release 11 | Any CPU 12 | http://dicomwebdemo-dev.azurewebsites.net 13 | True 14 | False 15 | dicomwebdemo-dev.scm.azurewebsites.net:443 16 | dicomwebdemo-dev 17 | 18 | True 19 | WMSVC 20 | True 21 | $dicomwebdemo-dev 22 | <_SavePWD>True 23 | <_DestinationType>AzureWebSite 24 | 25 | -------------------------------------------------------------------------------- /Demo/Scripts/_references.js: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | /// 4 | /// 5 | /// 6 | /// 7 | /// 8 | /// 9 | /// 10 | /// 11 | /// 12 | /// 13 | /// 14 | /// 15 | /// 16 | /// 17 | /// 18 | /// 19 | /// 20 | -------------------------------------------------------------------------------- /Demo/Scripts/typings/bootstrap/bootstrap.d.ts: -------------------------------------------------------------------------------- 1 | // Type definitions for Bootstrap 3.3.5 2 | // Project: http://twitter.github.com/bootstrap/ 3 | // Definitions by: Boris Yankov 4 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped 5 | 6 | 7 | /// 8 | 9 | interface ModalOptions { 10 | backdrop?: boolean|string; 11 | keyboard?: boolean; 12 | show?: boolean; 13 | remote?: string; 14 | } 15 | 16 | interface ModalOptionsBackdropString { 17 | backdrop?: string; // for "static" 18 | keyboard?: boolean; 19 | show?: boolean; 20 | remote?: string; 21 | } 22 | 23 | interface ScrollSpyOptions { 24 | offset?: number; 25 | target?: string; 26 | } 27 | 28 | interface TooltipOptions { 29 | animation?: boolean; 30 | html?: boolean; 31 | placement?: string | Function; 32 | selector?: string; 33 | title?: string | Function; 34 | trigger?: string; 35 | template?: string; 36 | delay?: number | Object; 37 | container?: string | boolean; 38 | viewport?: string | Function | Object; 39 | } 40 | 41 | interface PopoverOptions { 42 | animation?: boolean; 43 | html?: boolean; 44 | placement?: string | Function; 45 | selector?: string; 46 | trigger?: string; 47 | title?: string | Function; 48 | template?: string; 49 | content?: any; 50 | delay?: number | Object; 51 | container?: string | boolean; 52 | viewport?: string | Function | Object; 53 | } 54 | 55 | interface CollapseOptions { 56 | parent?: any; 57 | toggle?: boolean; 58 | } 59 | 60 | interface CarouselOptions { 61 | interval?: number; 62 | pause?: string; 63 | wrap?: boolean; 64 | keybord?: boolean; 65 | } 66 | 67 | interface TypeaheadOptions { 68 | source?: any; 69 | items?: number; 70 | minLength?: number; 71 | matcher?: (item: any) => boolean; 72 | sorter?: (items: any[]) => any[]; 73 | updater?: (item: any) => any; 74 | highlighter?: (item: any) => string; 75 | } 76 | 77 | interface AffixOptions { 78 | offset?: number | Function | Object; 79 | target?: any; 80 | } 81 | 82 | interface JQuery { 83 | modal(options?: ModalOptions): JQuery; 84 | modal(options?: ModalOptionsBackdropString): JQuery; 85 | modal(command: string): JQuery; 86 | 87 | dropdown(): JQuery; 88 | dropdown(command: string): JQuery; 89 | 90 | scrollspy(command: string): JQuery; 91 | scrollspy(options?: ScrollSpyOptions): JQuery; 92 | 93 | tab(): JQuery; 94 | tab(command: string): JQuery; 95 | 96 | tooltip(options?: TooltipOptions): JQuery; 97 | tooltip(command: string): JQuery; 98 | 99 | popover(options?: PopoverOptions): JQuery; 100 | popover(command: string): JQuery; 101 | 102 | alert(): JQuery; 103 | alert(command: string): JQuery; 104 | 105 | button(): JQuery; 106 | button(command: string): JQuery; 107 | 108 | collapse(options?: CollapseOptions): JQuery; 109 | collapse(command: string): JQuery; 110 | 111 | carousel(options?: CarouselOptions): JQuery; 112 | carousel(command: string): JQuery; 113 | 114 | typeahead(options?: TypeaheadOptions): JQuery; 115 | 116 | affix(options?: AffixOptions): JQuery; 117 | } 118 | 119 | declare module "bootstrap" { 120 | } 121 | -------------------------------------------------------------------------------- /Demo/Scripts/typings/libs/html.js: -------------------------------------------------------------------------------- 1 | //# sourceMappingURL=html.js.map -------------------------------------------------------------------------------- /Demo/Scripts/typings/libs/html.ts: -------------------------------------------------------------------------------- 1 | interface Window { 2 | webkitURL: any; 3 | } 4 | 5 | interface HTMLElement { 6 | download: any; 7 | } 8 | 9 | interface Element { 10 | select: any; 11 | } 12 | 13 | declare var TextDecoder: { new (label?: string, options?: TextDecoderOptions): TextDecoder; prototype: TextDecoder; }; 14 | -------------------------------------------------------------------------------- /Demo/Scripts/typings/libs/viewers.d.ts: -------------------------------------------------------------------------------- 1 | interface DWV{ 2 | gui: any; 3 | App: any; 4 | } 5 | 6 | 7 | interface Cornerstone 8 | { 9 | enable(element: Element, options: any): any; 10 | resize(element: Element, fit: Boolean): any; 11 | loadAndCacheImage(imageId: string): JQueryPromise<{}>; 12 | getDefaultViewportForImage(element: any, image: any); 13 | displayImage(element: any, image: any, viewport: any); 14 | getViewport: any; 15 | } 16 | 17 | interface CornerstoneTools 18 | { 19 | mouseInput: any; 20 | mouseWheelInput: any; 21 | wwwc: any; // ww/wc is the default tool for left mouse button 22 | pan: any; // pan is the default tool for middle mouse button 23 | zoom: any; // zoom is the default tool for right mouse button 24 | zoomWheel: any; // zoom is the default tool for middle mouse wheel 25 | wwwcTouchDrag: any; 26 | addStackStateManager: any; 27 | addToolState: any; 28 | removeToolState: any; 29 | getToolState: any; 30 | clearToolState: any; 31 | stackScroll: any; 32 | stackScrollWheel: any; 33 | 34 | scrollIndicator: any; 35 | } 36 | 37 | interface CornerstoneWADOImageLoader 38 | { 39 | configure(options: any); 40 | webWorkerManager: any; 41 | external: any; 42 | } 43 | 44 | declare var dwv: DWV; 45 | 46 | declare var cornerstone: Cornerstone; 47 | declare var cornerstoneTools: CornerstoneTools; 48 | declare var cornerstoneWADOImageLoader: CornerstoneWADOImageLoader; 49 | declare var uids: Object; 50 | 51 | 52 | -------------------------------------------------------------------------------- /Demo/Views/Demo/Index.cshtml: -------------------------------------------------------------------------------- 1 | @using DICOMwebJS.Demo.Models 2 | 3 | @model List 4 | 5 | 6 | @{ 7 | ViewBag.Title = "DICOMwebJS Demo"; 8 | } 9 | 10 | @section navbar_Header_Content 11 | { 12 |
  • 13 |
    14 | @Html.Label( "serverList", "Server List:", new {@style="display:inline-block;padding-top:15px;color:white"}) 15 | @Html.DropDownList( "serverList", Model, new{@class = "form-control", @style = "width:auto;display:inline-block"} ) 16 |
    17 |
  • 18 | } 19 | 30 | 31 |
    32 |
    33 | 37 |
    38 | @Html.Partial("_QueryFieldsView") 39 |
    40 |
    41 | @Html.Partial("_StudyView") 42 |
    43 |
    44 |
    45 | @Html.Partial("_StoreView") 46 |
    47 |
    48 | @Html.Partial("_cornerstoneViewer" ); 49 | 50 |
    51 |
    52 | 53 | 54 | 55 | @Html.Partial("_AlertDlg") 56 | @Html.Partial("_ImageViewer") 57 | 58 | @section styles 59 | { 60 | @Styles.Render("~/Content/dicomweb-js" ) 61 | } 62 | 63 | @section scripts 64 | { 65 | 66 | 67 | @if (!string.IsNullOrWhiteSpace(@AppSettings.Current.OhifViewerUrl)) 68 | { 69 | 72 | } 73 | 74 | @if (ViewBag.maxUpload != null) 75 | { 76 | 77 | } 78 | 79 | 80 | } 81 | -------------------------------------------------------------------------------- /Demo/Views/Demo/_AlertDlg.cshtml: -------------------------------------------------------------------------------- 1 |  21 | -------------------------------------------------------------------------------- /Demo/Views/Demo/_ImageViewer.cshtml: -------------------------------------------------------------------------------- 1 |  32 | -------------------------------------------------------------------------------- /Demo/Views/Demo/_InstanceItem.cshtml: -------------------------------------------------------------------------------- 1 | 
    2 |
    3 |
    4 | Instance Number: 5 | 6 |
    7 | @*
    8 | SOP Instance UI: 9 | 10 |
    *@ 11 |
    12 | 13 | 37 | 38 |
    -------------------------------------------------------------------------------- /Demo/Views/Demo/_ItemDetailsToolbar.cshtml: -------------------------------------------------------------------------------- 1 | @using DICOMwebJS.Demo.Models 2 | 3 | 4 | @foreach(var toolbarGroup in ToolbarFactory.DefaultInstanceDetails) 5 | { 6 |
    7 | @toolbarGroup.Name 8 | @foreach (var toolbarItem in toolbarGroup.OfType()) 9 | { 10 | @toolbarItem.Render() 11 | } 12 | 13 | @foreach (var toolbarItem in toolbarGroup.OfType()) 14 | { 15 | @toolbarItem.Render() 16 | } 17 | 18 |
    19 | } 20 | -------------------------------------------------------------------------------- /Demo/Views/Demo/_QueryFieldsView.cshtml: -------------------------------------------------------------------------------- 1 |  2 |
    3 |
    4 | 5 | 6 |
    7 |
    8 | 9 | 10 |
    11 |
    12 | 13 | 14 |
    15 |
    16 | 17 | 18 |
    19 | 20 | 21 |
    22 | 23 | -------------------------------------------------------------------------------- /Demo/Views/Demo/_SeriesItem.cshtml: -------------------------------------------------------------------------------- 1 | 
    2 |
    3 |
    4 | Series #: 5 | 6 |
    7 |
    8 |
    9 | Modality: 10 | 11 |
    12 |
    13 | Series Date: 14 | 15 |
    16 |
    17 | Series Description: 18 | 19 |
    20 |
    21 | 22 | 45 |
    46 | 47 | -------------------------------------------------------------------------------- /Demo/Views/Demo/_StoreAnonymizer.cshtml: -------------------------------------------------------------------------------- 1 | 
    2 |
    1. Anonymize
    3 | 4 |
    5 |
    6 |

    7 | By default, the DICOMcloud server will anonymize all DICOM datasets with default values for: 8 |

      9 |
    1. Patient ID (0010,0020): "Dcloud.Anonymized"
    2. 10 |
    3. Patient Name (0010,0010) "Dcloud^Anonymized"
    4. 11 |
    12 |

    13 |

    14 | In order to change these values with your own, you must use a unique Patient ID that 15 | doesn't already exists on the server with your preffered Patient Name 16 |

    17 |
    18 |
    19 | 27 |
    28 |
    29 |
    30 | -------------------------------------------------------------------------------- /Demo/Views/Demo/_StoreResult.cshtml: -------------------------------------------------------------------------------- 1 | 
    2 | 3 |
    4 |
    5 | 100% Complete 6 |
    7 |
    8 |
    9 | 15 | 16 | @Html.Partial("_CopyImageUrl") 17 | 18 |
    19 |
    20 |
    21 |
    -------------------------------------------------------------------------------- /Demo/Views/Demo/_StoreView.cshtml: -------------------------------------------------------------------------------- 1 | @using DICOMwebJS.Demo.Models 2 | 3 | @{ 4 | var numberCount = "1."; 5 | if(AppSettings.Current.SupportAnonymizer) 6 | { 7 | @Html.Partial("_StoreAnonymizer") 8 | 9 | numberCount = "2." ; 10 | } 11 | 12 |
    13 |
    @numberCount Store
    14 |
    15 |

    16 | Browse and upload your DICOM files to store them on the DICOMcloud WADO server using the STOW–RS service then use the “Query & Retrieve” tab to search for your studies, 17 | series and instances, and retrieve them on the client using the QIDO-RS, WADO-RS and WADI-URI services 18 |

    19 | 20 |
    21 | 22 | 23 | Browse… 24 | 25 | 26 | 27 | 28 | 29 | 30 |
    31 | @if (AppSettings.Current.MaxUpload > 0) 32 | { 33 |

    *You can upload up to @AppSettings.Current.MaxUpload DICOM files at one time

    34 | } 35 |
    36 | @Html.Partial("_StoreResult") 37 |
    38 |
    39 |
    40 |
    41 | if(AppSettings.Current.SupportAnonymizer) 42 | { 43 |
    44 |

    45 | DICOM files will be anonymized by the DICOMcloud server according to the DICOM confidentiality Basic Profile with the following options: 46 |

      47 |
    1. 48 | Retain Patient Characteristics Option (e.g. Ethnic Group, Patient’s Age, Patient’s Sex, Size, Weight…) 49 |
    2. 50 |
    3. 51 | Retain UIDs (e.g. Study Instance UID, Series Instance UID, SOP Instance UID…) 52 |
    4. 53 |
    5. 54 | Retain Longitudinal Temporal information with Full Dates Options (e.g. Study Date/Time, Series Date/Time…) 55 |
    6. 56 |
    57 |

    58 |

    59 | For more information about the DICOM confidentiality Basic Profile, you can refer to the DICOM spec 60 | "Attribute Confidentiality Profiles" 61 |

    62 | 63 |
    Note: Information that is burned into the image pixel data will NOT be removed.
    64 |
    Stored files might be deleted at any time without notice
    65 |
    66 | } 67 | } -------------------------------------------------------------------------------- /Demo/Views/Demo/_StudyItem.cshtml: -------------------------------------------------------------------------------- 1 | 
    2 |
    3 |
    4 | 5 | () 6 |
    7 |
    8 |
    9 | Date: 10 | 11 |
    12 |
    13 | Description: 14 | 15 |
    16 |
    17 | Study ID: 18 | 19 |
    20 |
    21 | Accession #: 22 | 23 |
    24 |
    25 | 26 |
    27 | 28 | @{ 29 | var serverUrl = System.Configuration.ConfigurationManager.AppSettings["app:ohifViewer"]; 30 | var showViewer = !string.IsNullOrWhiteSpace(serverUrl); 31 | 32 | if (showViewer) 33 | { 34 |
    35 | 38 |
    39 | } 40 | else 41 | { 42 |
    43 | 47 | 51 |
    52 | } 53 |
    54 | 55 |
    56 |
    57 | 59 | 72 |
    73 | } 74 |
    75 |
    -------------------------------------------------------------------------------- /Demo/Views/Demo/_StudyView.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 |
    4 |
    5 | 15 | 16 |
    17 | 36 |
    37 |
    38 |
    39 | 40 |
    41 | 49 |
    50 |
    51 |
    52 |
    53 | 54 |
    55 | 63 | 64 |
    65 |
    66 |
    67 |
    68 |
    69 | 70 |
    71 |
    72 |

    Instance Details

    73 |
    74 | @Html.Partial("_ItemDetailsToolbar") 75 |
    76 |
    77 | 78 | 81 | 85 |
    86 |
    -------------------------------------------------------------------------------- /Demo/Views/Demo/_Toolbar.cshtml: -------------------------------------------------------------------------------- 1 | @*@using DICOMwebJS.Demo.Models 2 | 3 | 4 | @model ToolbarViewModel 5 | 6 | *@ -------------------------------------------------------------------------------- /Demo/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @model System.Web.Mvc.HandleErrorInfo 2 | 3 | @{ 4 | ViewBag.Title = "Error"; 5 | } 6 | 7 |

    Error.

    8 |

    An error occurred while processing your request.

    9 | 10 | -------------------------------------------------------------------------------- /Demo/Views/Shared/_CopyImageUrl.cshtml: -------------------------------------------------------------------------------- 1 | 
    2 | Image URL: 3 | 4 | 9 | 10 | 11 | 13 | 14 |
    15 | -------------------------------------------------------------------------------- /Demo/Views/Shared/_Layout.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | @ViewBag.Title - DICOMwebJS 7 | @Styles.Render("~/Content/css") 8 | @Scripts.Render("~/bundles/modernizr") 9 | @RenderSection("styles", required: false) 10 | 11 | 12 | 30 |
    31 | @RenderBody() 32 |
    33 |
    34 |

    © @DateTime.Now.Year - DICOMwebJS

    35 |
    36 |
    37 | 38 | @Html.Partial("_Scripts") 39 | @RenderSection("scripts", required: false) 40 | 41 | 42 | -------------------------------------------------------------------------------- /Demo/Views/Shared/_Scripts.cshtml: -------------------------------------------------------------------------------- 1 | @Scripts.Render("~/bundles/jquery") 2 | @Scripts.Render("~/bundles/bootstrap") 3 | 4 | @*@Scripts.Render("~/bundles/dwv" )*@ 5 | @*@Scripts.Render("~/bundles/cornerstornViewer" )*@ 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | @Scripts.Render("~/bundles/dicomweb") 14 | @Scripts.Render("~/bundles/app") -------------------------------------------------------------------------------- /Demo/Views/Web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 |
    7 |
    8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /Demo/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/_Layout.cshtml"; 3 | } 4 | -------------------------------------------------------------------------------- /Demo/Web.Debug.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /Demo/Web.Release.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Demo/Web.config: -------------------------------------------------------------------------------- 1 |  2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /Demo/deploy.cmd: -------------------------------------------------------------------------------- 1 | @if "%SCM_TRACE_LEVEL%" NEQ "4" @echo off 2 | 3 | :: ---------------------- 4 | :: KUDU Deployment Script 5 | :: Version: 1.0.15 6 | :: ---------------------- 7 | 8 | :: Prerequisites 9 | :: ------------- 10 | 11 | :: Verify node.js installed 12 | where node 2>nul >nul 13 | IF %ERRORLEVEL% NEQ 0 ( 14 | echo Missing node.js executable, please install node.js, if already installed make sure it can be reached from current environment. 15 | goto error 16 | ) 17 | 18 | :: Setup 19 | :: ----- 20 | 21 | setlocal enabledelayedexpansion 22 | 23 | SET ARTIFACTS=%~dp0%..\artifacts 24 | 25 | IF NOT DEFINED DEPLOYMENT_SOURCE ( 26 | SET DEPLOYMENT_SOURCE=%~dp0%. 27 | ) 28 | 29 | IF NOT DEFINED DEPLOYMENT_TARGET ( 30 | SET DEPLOYMENT_TARGET=%ARTIFACTS%\wwwroot 31 | ) 32 | 33 | IF NOT DEFINED NEXT_MANIFEST_PATH ( 34 | SET NEXT_MANIFEST_PATH=%ARTIFACTS%\manifest 35 | 36 | IF NOT DEFINED PREVIOUS_MANIFEST_PATH ( 37 | SET PREVIOUS_MANIFEST_PATH=%ARTIFACTS%\manifest 38 | ) 39 | ) 40 | 41 | IF NOT DEFINED KUDU_SYNC_CMD ( 42 | :: Install kudu sync 43 | echo Installing Kudu Sync 44 | call npm install kudusync -g --silent 45 | IF !ERRORLEVEL! NEQ 0 goto error 46 | 47 | :: Locally just running "kuduSync" would also work 48 | SET KUDU_SYNC_CMD=%appdata%\npm\kuduSync.cmd 49 | ) 50 | IF NOT DEFINED DEPLOYMENT_TEMP ( 51 | SET DEPLOYMENT_TEMP=%temp%\___deployTemp%random% 52 | SET CLEAN_LOCAL_DEPLOYMENT_TEMP=true 53 | ) 54 | 55 | IF DEFINED CLEAN_LOCAL_DEPLOYMENT_TEMP ( 56 | IF EXIST "%DEPLOYMENT_TEMP%" rd /s /q "%DEPLOYMENT_TEMP%" 57 | mkdir "%DEPLOYMENT_TEMP%" 58 | ) 59 | 60 | IF DEFINED MSBUILD_PATH goto MsbuildPathDefined 61 | SET MSBUILD_PATH=%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe 62 | :MsbuildPathDefined 63 | 64 | :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 65 | :: Deployment 66 | :: ---------- 67 | 68 | echo Handling .NET Web Application deployment. 69 | 70 | :: 1. Restore NuGet packages 71 | IF /I "Demo.sln" NEQ "" ( 72 | call :ExecuteCmd nuget restore "%DEPLOYMENT_SOURCE%\Demo.sln" 73 | IF !ERRORLEVEL! NEQ 0 goto error 74 | ) 75 | 76 | :: 2. Build to the temporary path 77 | IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" ( 78 | call :ExecuteCmd "%MSBUILD_PATH%" "%DEPLOYMENT_SOURCE%\Demo\Demo.csproj" /nologo /verbosity:m /t:Build /t:pipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="%DEPLOYMENT_TEMP%";AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release;UseSharedCompilation=false /p:SolutionDir="%DEPLOYMENT_SOURCE%\.\\" %SCM_BUILD_ARGS% 79 | ) ELSE ( 80 | call :ExecuteCmd "%MSBUILD_PATH%" "%DEPLOYMENT_SOURCE%\Demo\Demo.csproj" /nologo /verbosity:m /t:Build /p:AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release;UseSharedCompilation=false /p:SolutionDir="%DEPLOYMENT_SOURCE%\.\\" %SCM_BUILD_ARGS% 81 | ) 82 | 83 | IF !ERRORLEVEL! NEQ 0 goto error 84 | 85 | :: 3. KuduSync 86 | IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" ( 87 | call :ExecuteCmd "%KUDU_SYNC_CMD%" -v 50 -f "%DEPLOYMENT_TEMP%" -t "%DEPLOYMENT_TARGET%" -n "%NEXT_MANIFEST_PATH%" -p "%PREVIOUS_MANIFEST_PATH%" -i ".git;.hg;.deployment;deploy.cmd" 88 | IF !ERRORLEVEL! NEQ 0 goto error 89 | ) 90 | 91 | :: 4. Install Bower packages 92 | IF EXIST "%DEPLOYMENT_TARGET%\bower.json" ( 93 | pushd "%DEPLOYMENT_TARGET%" 94 | call bower install 95 | IF !ERRORLEVEL! NEQ 0 goto error 96 | popd 97 | ) 98 | :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 99 | goto end 100 | 101 | :: Execute command routine that will echo out when error 102 | :ExecuteCmd 103 | setlocal 104 | set _CMD_=%* 105 | call %_CMD_% 106 | if "%ERRORLEVEL%" NEQ "0" echo Failed exitCode=%ERRORLEVEL%, command=%_CMD_% 107 | exit /b %ERRORLEVEL% 108 | 109 | :error 110 | endlocal 111 | echo An error has occurred during web site deployment. 112 | call :exitSetErrorLevel 113 | call :exitFromFunction 2>nul 114 | 115 | :exitSetErrorLevel 116 | exit /b 1 117 | 118 | :exitFromFunction 119 | () 120 | 121 | :end 122 | endlocal 123 | echo Finished successfully. 124 | -------------------------------------------------------------------------------- /Demo/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DICOMcloud/DICOMweb-js/d6d4f117ac95ad6666cb9391e616bcb899962487/Demo/favicon.ico -------------------------------------------------------------------------------- /Demo/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DICOMcloud/DICOMweb-js/d6d4f117ac95ad6666cb9391e616bcb899962487/Demo/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /Demo/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DICOMcloud/DICOMweb-js/d6d4f117ac95ad6666cb9391e616bcb899962487/Demo/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /Demo/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DICOMcloud/DICOMweb-js/d6d4f117ac95ad6666cb9391e616bcb899962487/Demo/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /Demo/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DICOMcloud/DICOMweb-js/d6d4f117ac95ad6666cb9391e616bcb899962487/Demo/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /Demo/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | [![Join the chat at https://gitter.im/DICOMcloud/Lobby](https://badges.gitter.im/DICOMcloud/Lobby.svg)](https://gitter.im/DICOMcloud/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) 3 | 4 | # DICOMweb-JS 5 | DICOMweb-JS is an open source JS client for consuming DICOM Web Services - part 13 with a ASP.NET MVC demo that uses the [Cornerstone viewer](https://github.com/chafey/cornerstone) and [cornerstoneWADOImageLoader](https://github.com/chafey/cornerstoneWADOImageLoader) 6 | 7 | The code provide a basic library for sending DICOM Web requests and parsing JSON and multipart reposnses in (DIOCM, XML, Buld data...) . 8 | 9 | ## Demo Code 10 | The demo uses the library to connect to a DICOM Web server and initiate qido-rs for querying (studies, series and object instances), wado-RS for retrieving (study, series, object instance) and stow-rs for storing DICOM format images. 11 | 12 | Check the [demo page here](http://dicomweb.azurewebsites.net/) 13 | 14 | ## DICOM Server 15 | 16 | [Source code on Github](https://github.com/DICOMcloud/DICOMcloud) 17 | 18 | You can check the [web server API here](https://dicomcloud.azurewebsites.net/) 19 | 20 | ## Building the code 21 | This is an ASP.NET demo so you will need Visual Studio to build the code, you can download the VS2015 community edition or VS code. 22 | The JavaScript libraries are also built using Visual Studio and TypeScript. 23 | 24 | Or you can use the dist folder to include the compiled JS files in your project. 25 | 26 | 27 | ## About 28 | - Author: [DICOM-webjs Contributors](https://github.com/DICOMcloud/DICOMweb-js/graphs/contributors) 29 | - License: [MIT License](http://opensource.org/licenses/MIT) 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /Resources/Build/DICOMweb-js.bat: -------------------------------------------------------------------------------- 1 | nuget pack ../Build\demo\DICOMwebJS.Demo.csproj -OutputDirectory ../../dist\NuGet\ -IncludeReferencedProjects -tool -build -verbosity detailed -------------------------------------------------------------------------------- /Resources/Build/DICOMwebJS.Demo.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.26430.16 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DICOMwebJS.Demo", "demo\DICOMwebJS.Demo.csproj", "{C046A984-3DFF-4598-8624-6EA106668B26}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {C046A984-3DFF-4598-8624-6EA106668B26}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {C046A984-3DFF-4598-8624-6EA106668B26}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {C046A984-3DFF-4598-8624-6EA106668B26}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {C046A984-3DFF-4598-8624-6EA106668B26}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /Resources/Build/NuGet.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DICOMcloud/DICOMweb-js/d6d4f117ac95ad6666cb9391e616bcb899962487/Resources/Build/NuGet.exe -------------------------------------------------------------------------------- /Resources/Build/demo/DICOMwebJS.Demo.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $id$ 5 | $version$ 6 | $title$ 7 | $author$ 8 | $author$ 9 | https://raw.githubusercontent.com/DICOMcloud/DICOMweb-js/master/license.txt 10 | https://github.com/DICOMcloud/DICOMweb-js 11 | 12 | false 13 | $description$ 14 | 15 | $copyright$ 16 | DICOM DICOMweb DICOM-viewer quido-rs wado-uri wado-rs stow-rs azure cornerstone 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Resources/Build/demo/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("DICOMweb-JS demo")] 9 | [assembly: AssemblyDescription("DICOMweb-JS demo")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyTrademark("")] 12 | [assembly: AssemblyCulture("")] 13 | 14 | // Setting ComVisible to false makes the types in this assembly not visible 15 | // to COM components. If you need to access a type in this assembly from 16 | // COM, set the ComVisible attribute to true on that type. 17 | [assembly: ComVisible(false)] 18 | 19 | // The following GUID is for the ID of the typelib if this project is exposed to COM 20 | [assembly: Guid("c046a984-3dff-4598-8624-6ea106668b26")] -------------------------------------------------------------------------------- /Resources/Build/demo/Properties/PublishProfiles/FolderProfile.pubxml: -------------------------------------------------------------------------------- 1 |  2 | 6 | 7 | 8 | FileSystem 9 | FileSystem 10 | Release 11 | Any CPU 12 | 13 | True 14 | False 15 | bin\Release\PublishOutput 16 | False 17 | 18 | -------------------------------------------------------------------------------- /Resources/Build/demo/Scripts/typings/bootstrap/index.d.ts: -------------------------------------------------------------------------------- 1 | // Type definitions for Bootstrap 3.3.5 2 | // Project: http://twitter.github.com/bootstrap/ 3 | // Definitions by: Boris Yankov 4 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped 5 | 6 | 7 | 8 | interface ModalOptions { 9 | backdrop?: boolean|string; 10 | keyboard?: boolean; 11 | show?: boolean; 12 | remote?: string; 13 | } 14 | 15 | interface ModalOptionsBackdropString { 16 | backdrop?: string; // for "static" 17 | keyboard?: boolean; 18 | show?: boolean; 19 | remote?: string; 20 | } 21 | 22 | interface ScrollSpyOptions { 23 | offset?: number; 24 | target?: string; 25 | } 26 | 27 | interface TooltipOptions { 28 | animation?: boolean; 29 | html?: boolean; 30 | placement?: string | Function; 31 | selector?: string; 32 | title?: string | Function; 33 | trigger?: string; 34 | template?: string; 35 | delay?: number | Object; 36 | container?: string | boolean; 37 | viewport?: string | Function | Object; 38 | } 39 | 40 | interface PopoverOptions { 41 | animation?: boolean; 42 | html?: boolean; 43 | placement?: string | Function; 44 | selector?: string; 45 | trigger?: string; 46 | title?: string | Function; 47 | template?: string; 48 | content?: any; 49 | delay?: number | Object; 50 | container?: string | boolean; 51 | viewport?: string | Function | Object; 52 | } 53 | 54 | interface CollapseOptions { 55 | parent?: any; 56 | toggle?: boolean; 57 | } 58 | 59 | interface CarouselOptions { 60 | interval?: number; 61 | pause?: string; 62 | wrap?: boolean; 63 | keybord?: boolean; 64 | } 65 | 66 | interface TypeaheadOptions { 67 | source?: any; 68 | items?: number; 69 | minLength?: number; 70 | matcher?: (item: any) => boolean; 71 | sorter?: (items: any[]) => any[]; 72 | updater?: (item: any) => any; 73 | highlighter?: (item: any) => string; 74 | } 75 | 76 | interface AffixOptions { 77 | offset?: number | Function | Object; 78 | target?: any; 79 | } 80 | 81 | interface TransitionEventNames { 82 | end: string; 83 | } 84 | 85 | interface JQuery { 86 | modal(options?: ModalOptions): JQuery; 87 | modal(options?: ModalOptionsBackdropString): JQuery; 88 | modal(command: string): JQuery; 89 | 90 | dropdown(): JQuery; 91 | dropdown(command: string): JQuery; 92 | 93 | scrollspy(command: string): JQuery; 94 | scrollspy(options?: ScrollSpyOptions): JQuery; 95 | 96 | tab(): JQuery; 97 | tab(command: string): JQuery; 98 | 99 | tooltip(options?: TooltipOptions): JQuery; 100 | tooltip(command: string): JQuery; 101 | 102 | popover(options?: PopoverOptions): JQuery; 103 | popover(command: string): JQuery; 104 | 105 | alert(): JQuery; 106 | alert(command: string): JQuery; 107 | 108 | button(): JQuery; 109 | button(command: string): JQuery; 110 | 111 | collapse(options?: CollapseOptions): JQuery; 112 | collapse(command: string): JQuery; 113 | 114 | carousel(options?: CarouselOptions): JQuery; 115 | carousel(command: string): JQuery; 116 | 117 | typeahead(options?: TypeaheadOptions): JQuery; 118 | 119 | affix(options?: AffixOptions): JQuery; 120 | 121 | emulateTransitionEnd(duration: number): JQuery; 122 | } 123 | 124 | interface JQuerySupport { 125 | transition: boolean | TransitionEventNames; 126 | } 127 | 128 | declare module "bootstrap" { 129 | } 130 | -------------------------------------------------------------------------------- /Resources/Build/demo/Web.Debug.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | -------------------------------------------------------------------------------- /Resources/Build/demo/Web.Release.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 30 | 31 | -------------------------------------------------------------------------------- /Resources/Build/demo/Web.config: -------------------------------------------------------------------------------- 1 |  2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /Resources/Build/demo/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DICOMcloud/DICOMweb-js/d6d4f117ac95ad6666cb9391e616bcb899962487/Resources/Build/demo/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /Resources/Build/demo/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DICOMcloud/DICOMweb-js/d6d4f117ac95ad6666cb9391e616bcb899962487/Resources/Build/demo/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /Resources/Build/demo/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DICOMcloud/DICOMweb-js/d6d4f117ac95ad6666cb9391e616bcb899962487/Resources/Build/demo/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /Resources/Build/demo/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DICOMcloud/DICOMweb-js/d6d4f117ac95ad6666cb9391e616bcb899962487/Resources/Build/demo/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /Resources/Build/demo/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /Resources/Version/AssemblyInfo.Version.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection ; 2 | 3 | [assembly: AssemblyCopyright("Copyright © 2017" )] 4 | [assembly: AssemblyProduct("DICOMweb-JS")] 5 | [assembly: AssemblyCompany("DICOMcloud")] 6 | // Version information for an assembly consists of the following four values: 7 | // 8 | // Major Version 9 | // Minor Version 10 | // Build Number 11 | // Revision 12 | // 13 | [assembly: AssemblyVersion("0.5.*")] 14 | [assembly: AssemblyInformationalVersion("0.5.3-beta")] -------------------------------------------------------------------------------- /Resources/Version/AssemblyInfo.Version.tt: -------------------------------------------------------------------------------- 1 | using System.Reflection ; 2 | 3 | [assembly: AssemblyCopyright("Copyright © <#=System.DateTime.Now.Year.ToString ( )#>" )] 4 | [assembly: AssemblyProduct("DICOMweb-JS")] 5 | [assembly: AssemblyCompany("DICOMcloud")] 6 | // Version information for an assembly consists of the following four values: 7 | // 8 | // Major Version 9 | // Minor Version 10 | // Build Number 11 | // Revision 12 | // 13 | [assembly: AssemblyVersion("0.5.*")] 14 | [assembly: AssemblyInformationalVersion("0.5.3-beta")] -------------------------------------------------------------------------------- /license.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017 DICOMweb-js 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | --------------------------------------------------------------------------------