{"id":13634543,"url":"https://github.com/webnamics/cornerstoneFileImageLoader","last_synced_at":"2025-04-18T23:32:14.764Z","repository":{"id":36220354,"uuid":"221478220","full_name":"webnamics/cornerstoneFileImageLoader","owner":"webnamics","description":"A Cornerstone Image Loader for images (PNG, JPG) using the HTML5 File API or from ArrayBuffer","archived":false,"fork":false,"pushed_at":"2022-12-30T19:35:31.000Z","size":1238,"stargazers_count":7,"open_issues_count":26,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-04T13:06:11.379Z","etag":null,"topics":["cornerstone","cornerstone-image-loader","javascript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/webnamics.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-13T14:29:12.000Z","updated_at":"2024-06-07T08:55:09.000Z","dependencies_parsed_at":"2023-01-16T23:32:00.857Z","dependency_job_id":null,"html_url":"https://github.com/webnamics/cornerstoneFileImageLoader","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webnamics%2FcornerstoneFileImageLoader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webnamics%2FcornerstoneFileImageLoader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webnamics%2FcornerstoneFileImageLoader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webnamics%2FcornerstoneFileImageLoader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webnamics","download_url":"https://codeload.github.com/webnamics/cornerstoneFileImageLoader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223746990,"owners_count":17195810,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cornerstone","cornerstone-image-loader","javascript"],"created_at":"2024-08-02T00:00:25.351Z","updated_at":"2024-11-09T04:30:45.832Z","avatar_url":"https://github.com/webnamics.png","language":"JavaScript","readme":"cornerstone File Image Loader\n=============================\n\nA [cornerstone](https://github.com/cornerstonejs/cornerstone) Image Loader for images (JPG, PNG) using the HTML5 File API or from ArrayBuffer.  \n\nUsing the File API presents in HTML5 or ArrayBuffer data is possible open local image such as JPEG and PNG in Cornerstone library.\n\nIt's also possible to build a new image from a previously loaded Cornerstone image with a custom pixel data.\n\nLive Examples\n---------------\n\nView the [Universal Dicom Viewer](https://webnamics.github.io/u-dicom-viewer/) built on cornerstone.\n\nInstall\n-------\n\nVia [NPM](https://www.npmjs.com/):\n\n\u003e npm install cornerstone-file-image-loader\n\n\nUsage\n-----\n\nSimply include the cornerstoneFileImageLoader.js in your HTML file after you load cornerstone.js and then set the cornerstone instance as an external module for cornerstoneFileImageLoader:\n\n````javascript\ncornerstoneFileImageLoader.external.cornerstone = cornerstone;\n````\n\nThis will let cornerstoneFileImageLoader register itself with cornerstone to load imageId's that have the imagefile schemes. \n\nTo display an image, first add a HTML5 file object to cornerstoneFileImageLoader then pass the image as the imageId parameter to a cornerstone loadImage():\n\n````javascript\nconst imageId = cornerstoneFileImageLoader.fileManager.add(file);\ncornerstone.loadImage(imageId).then(function(image) {\n\tcornerstone.displayImage(element, image);\n\t...\n}\n````\n\nOr if previously the JPG or PNG data has loaded in a ArrayBuffer:\n\n````javascript\nconst imageId = cornerstoneFileImageLoader.fileManager.addBuffer(data);\ncornerstone.loadImage(imageId).then(function(image) {\n\tcornerstone.displayImage(element, image);\n\t...\n}\n````\n\nTo build a new image from loaded Cornerstone Image and a custom pixel data:\n\n````javascript\nconst customObj = {\n\trows: rows,\t\t\t\t// rows in PixelData\n\tcolumns: columns, \t\t// columns in pixelData\n\tpixelData: pixelData,\t// custom pixel data\n\timage: loadedImage,\t\t// loaded Cornerstone Image\n}\nconst imageId = cornerstoneFileImageLoader.fileManager.addCustom(customObj);\ncornerstone.loadImage(imageId).then(function(image) {\n\tcornerstone.displayImage(element, image);\n\t...\n}\n````\n\nBuild System\n============\n\nThis project uses webpack to build the software.\n\nPre-requisites:\n---------------\n\nNodeJs - [click to visit web site for installation instructions](http://nodejs.org).\n\nCommon Tasks\n------------\n\nUpdate dependencies (after each pull):\n\u003e npm install\n\nRunning the build:\n\u003e npm start\n\nAutomatically running the build and unit tests after each source change:\n\u003e npm run watch\n\nWhy is this a separate library from cornerstone?\n================================================\n\nCornerstone was designed to support loading of any kind of image regardless of its container,\ncompression algorithm, encoding or transport.  This is one of many possible image loaders\nthat can provide the image pixel data to cornerstone to display\n\nCopyright\n=========\nCopyright 2019 Luigi Orso [webnamics@gmail.com](mailto:webnamics@gmail.com)\n\n","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebnamics%2FcornerstoneFileImageLoader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebnamics%2FcornerstoneFileImageLoader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebnamics%2FcornerstoneFileImageLoader/lists"}