Compare commits

..
Author SHA1 Message Date
dannyrb 9ab81de690 chore(release): publish %s [skip ci]
- @ohif/extension-cornerstone@0.0.39-alpha.6
 - @ohif/extension-dicom-html@0.0.4-alpha.6
 - @ohif/extension-dicom-microscopy@0.0.9-alpha.6
 - @ohif/extension-dicom-pdf@0.0.8-alpha.6
 - @ohif/extension-vtk@0.1.4-alpha.6
 - @ohif/core@0.11.1-alpha.6
 - @ohif/i18n@0.2.3-alpha.6
 - @ohif/ui@0.2.18-alpha.6
 - @ohif/viewer@0.0.22-alpha.7
2019-08-07 23:06:32 -04:00
dannyrb 946dcc38b4 chore(release): publish %s [skip ci]
- @ohif/extension-cornerstone@0.0.39-alpha.5
 - @ohif/extension-dicom-html@0.0.4-alpha.5
 - @ohif/extension-dicom-microscopy@0.0.9-alpha.5
 - @ohif/extension-dicom-pdf@0.0.8-alpha.5
 - @ohif/extension-vtk@0.1.4-alpha.5
 - @ohif/core@0.11.1-alpha.5
 - @ohif/i18n@0.2.3-alpha.5
 - @ohif/ui@0.2.18-alpha.5
 - @ohif/viewer@0.0.22-alpha.6
2019-08-07 23:04:24 -04:00
dannyrb 1771bca366 Simplify build 2019-08-07 23:04:00 -04:00
dannyrb b8045caeea chore(release): publish %s [skip ci]
- @ohif/extension-cornerstone@0.0.39-alpha.4
 - @ohif/extension-dicom-html@0.0.4-alpha.4
 - @ohif/extension-dicom-microscopy@0.0.9-alpha.4
 - @ohif/extension-dicom-pdf@0.0.8-alpha.4
 - @ohif/extension-vtk@0.1.4-alpha.4
 - @ohif/core@0.11.1-alpha.4
 - @ohif/i18n@0.2.3-alpha.4
 - @ohif/ui@0.2.18-alpha.4
 - @ohif/viewer@0.0.22-alpha.5
2019-08-07 23:01:54 -04:00
dannyrb c322df482d chore(release): publish %s [skip ci]
- @ohif/extension-cornerstone@0.0.39-alpha.3
 - @ohif/extension-dicom-html@0.0.4-alpha.3
 - @ohif/extension-dicom-microscopy@0.0.9-alpha.3
 - @ohif/extension-dicom-pdf@0.0.8-alpha.3
 - @ohif/extension-vtk@0.1.4-alpha.3
 - @ohif/core@0.11.1-alpha.3
 - @ohif/i18n@0.2.3-alpha.3
 - @ohif/ui@0.2.18-alpha.3
 - @ohif/viewer@0.0.22-alpha.4
2019-08-07 23:00:03 -04:00
dannyrb 5d0b80b801 Publish with canary tag 2019-08-07 22:54:02 -04:00
dannyrb 002488dc8a fix eslint issues caused by eslint 6 and our react-app config 2019-08-07 22:49:40 -04:00
dannyrb a6c0be0797 chore(release): publish %s [skip ci]
- @ohif/extension-cornerstone@0.0.39-alpha.2
 - @ohif/extension-dicom-html@0.0.4-alpha.2
 - @ohif/extension-dicom-microscopy@0.0.9-alpha.2
 - @ohif/extension-dicom-pdf@0.0.8-alpha.2
 - @ohif/extension-vtk@0.1.4-alpha.2
 - @ohif/core@0.11.1-alpha.2
 - @ohif/i18n@0.2.3-alpha.2
 - @ohif/ui@0.2.18-alpha.2
 - @ohif/viewer@0.0.22-alpha.3
2019-08-07 16:25:22 -04:00
dannyrb f421d16e85 catch changes 2019-08-07 16:09:59 -04:00
dannyrb a5baa9228c Fix build scripts 2019-08-07 16:06:44 -04:00
dannyrb 23372fbfbd Update package.jsons 2019-08-07 16:05:24 -04:00
dannyrb d9d9aa1728 test lerna publish 2019-08-07 15:50:20 -04:00
dannyrb b1657ac1ef chore(release): publish %s [skip ci]
- @ohif/viewer@0.0.22-alpha.2
2019-08-07 15:47:58 -04:00
dannyrb ea45681d00 Add global prettier config 2019-08-07 15:22:39 -04:00
dannyrb a97bd302f7 test version bump 2019-08-07 15:22:26 -04:00
dannyrb e1542f50f8 chore(release): publish %s [skip ci]
- @ohif/extension-cornerstone@0.0.39-alpha.1
 - @ohif/extension-dicom-html@0.0.4-alpha.1
 - @ohif/extension-dicom-microscopy@0.0.9-alpha.1
 - @ohif/extension-dicom-pdf@0.0.8-alpha.1
 - @ohif/extension-vtk@0.1.4-alpha.1
 - @ohif/core@0.11.1-alpha.1
 - @ohif/i18n@0.2.3-alpha.1
 - @ohif/ui@0.2.18-alpha.1
 - @ohif/viewer@0.0.22-alpha.1
2019-08-07 00:32:04 -04:00
dannyrb abdbe9a608 Safer publish command 2019-08-07 00:24:27 -04:00
dannyrb 755da173ea ohif-core --> @ohif/core 2019-08-06 23:56:44 -04:00
dannyrb 8c5bd55f88 Remove unused/duplicate config files for projects/packages 2019-08-06 23:48:43 -04:00
dannyrb e98611fc24 Redux testkit dep 2019-08-06 23:21:19 -04:00
dannyrb fa0aa7f68e bump @ohif/core versions 2019-08-06 15:48:33 -04:00
dannyrb 30902bc048 Fix @ohif/ui versions 2019-08-06 15:37:44 -04:00
dannyrb 4b532183af Reduce duplicate code in @ohif/core 2019-08-06 15:03:43 -04:00
dannyrb 58b3727a2e Clean up ui and i18n config 2019-08-06 14:41:13 -04:00
dannyrb d48e29d1bb Update UI project's docs 2019-08-06 14:31:01 -04:00
dannyrb e47dcf27fc Clean duplicate code in UI project 2019-08-06 14:22:44 -04:00
dannyrb 60f48fbdc0 Tidy up project links 2019-08-06 13:58:43 -04:00
dannyrb 9a5372766c Clean up UI to set webpack scripts 2019-08-05 23:34:02 -04:00
dannyrb e0cf337222 Remove old scripts 2019-08-05 23:28:12 -04:00
dannyrb 7db3bde95a Shift build command; satisfy default PWA build 2019-08-05 23:26:28 -04:00
dannyrb b081e73297 Support for dev and dev:* commands 2019-08-05 23:15:07 -04:00
dannyrb ce72d8bb15 Clean up primary readme 2019-08-05 22:32:36 -04:00
110 changed files with 1506 additions and 19230 deletions

No files matched your search

View File
File renamed without changes.
+8
View File
@@ -0,0 +1,8 @@
{
"trailingComma": "es5",
"printWidth": 80,
"proseWrap": "always",
"tabWidth": 2,
"semi": true,
"singleQuote": true
}
+14
View File
@@ -0,0 +1,14 @@
#!/bin/bash
# https://github.com/shelljs/shelljs
# https://github.com/shelljs/shelljs#exclude-options
PROJECT=$1
if [ -z "$PROJECT" ]
then
# Default
npx lerna run dev:viewer
else
eval "npx lerna run dev:$PROJECT"
fi
read -p 'Press [Enter] key to continue...'
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2018 Open Health Imaging Foundation
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+193 -73
View File
@@ -1,38 +1,139 @@
# OHIF Medical Imaging Platform <!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<div align="center">
<h1>OHIF Medical Imaging Viewer</h1>
<p><strong>The OHIF Viewer</strong> is a zero-footprint medical image viewer provided by the <a href="http://ohif.org/">Open Health Imaging Foundation (OHIF)</a>. It is a configurable and extensible progressive web application with out-of-the-box support for image archives which support <a href="https://www.dicomstandard.org/dicomweb/">DICOMweb</a>.</p>
</div>
<div align="center">
<a href="https://docs.ohif.org/"><strong>Read The Docs</strong></a> |
<a href="https://github.com/OHIF/Viewers/tree/master/docs/latest">Edit the docs</a>
</div>
<div align="center">
<a href="https://docs.ohif.org/demo">Demo</a> |
<a href="https://ohif.canny.io/">Roadmap</a> |
<a href="https://react.ohif.org/">Component Library</a>
</div>
<hr />
[![NPM version][npm-version-image]][npm-url]
[![NPM downloads][npm-downloads-image]][npm-url]
[![Pulls][docker-pulls-img]][docker-image-url]
[![MIT License][license-image]][license-url]
[![lerna][lerna-image]][lerna-url]
[![Netlify Status][netlify-image]][netlify-url] [![Netlify Status][netlify-image]][netlify-url]
[![CircleCI][circleci-image]][circleci-url]
[![codecov][codecov-image]][codecov-url]
[![All Contributors](https://img.shields.io/badge/all_contributors-10-orange.svg?style=flat-square)](#contributors)
## The Problem ## What?
... The OHIF Medical Imaging Viewer is for viewing medical images. It can retrieve and load images from most sources and formats; render sets in 2D, 3D, and reconstructed representations; allows for the manipulation, annotation, and serialization of observations; supports internationalization, OpenID Connect, offline use, hotkeys, and many more features.
Almost everything offers some degree of customization and configuration. If it doesn't support something you need, we accept pull requests and have an ever improving Extension System.
## Why Choose Us ## Why Choose Us
... ### Community & Experience
## Quick Start The OHIF Viewer is a collaborative effort that has served as the basis for many active, production, and FDA Cleared medical imaging viewers. It benefits from our extensive community's collective experience, and from the sponsored contributions of individuals, research groups, and commercial organizations.
### Built to Adapt
... ...
### Support
...
## Quick Start Deployment
> This is only one of many ways to configure and deploy the OHIF Viewer. To learn more about your options, and how to choose the best one for your requirements, check out [our deployment recipes and documentation](https://docs.ohif.org/deployment/).
The fastest and easiest way to get started is to include the OHIF Viewer with a script tag. In practice, this is as simple as:
- Including the following dependencies with script tags:
- [React](https://unpkg.com/react@16/umd/react.production.min.js)
- [React Dom](https://unpkg.com/react-dom@16/umd/react-dom.production.min.js)
- The [OHIF Viewer](https://unpkg.com/ohif-viewer@0.19.5/dist/index.umd.js)
- Have an element with an ID of `root` on the page
- Configure the OHIF Viewer at `window.config`:
```js
window.config = {
routerBasename: "/",
servers: {
dicomWeb: [
{
name: "DCM4CHEE",
qidoRoot: "https://server.dcmjs.org/dcm4chee-arc/aets/DCM4CHEE/rs",
wadoRoot: "https://server.dcmjs.org/dcm4chee-arc/aets/DCM4CHEE/rs",
qidoSupportsIncludeField: true,
imageRendering: "wadors",
thumbnailRendering: "wadors"
}
]
}
};
```
- Install the viewer: `window.OHIFStandaloneViewer.installViewer(window.config);`
This exact setup is demonstrated in this [CodeSandbox](https://codesandbox.io/s/ohif-viewer-script-tag-usage-c4u4t) and in our [Embedding The Viewer](https://docs.ohif.org/deployment/recipes/embedded-viewer.html) deployment recipe.
## Developing
### Requirements
- [Yarn 1.17.3+](https://yarnpkg.com/en/docs/install)
- [Node 8+](https://nodejs.org/en/)
- Yarn Workspaces should be enabled on your machine:
- `yarn config set workspaces-experimental true`
### Getting Started
1. [Fork this repository][how-to-fork]
2. [Clone your forked repository][how-to-clone]
- `git clone https://github.com/YOUR-USERNAME/Viewers.git`
3. Navigate to the cloned project's directory
4. Add this repo as a `remote` named `upstream`
- `git remote add upstream https://github.com/OHIF/Viewers.git`
5. `yarn install` to restore dependencies and link projects
#### To Develop
_From this repository's root directory:_
```bash
# Enable Yarn Workspaces
yarn config set workspaces-experimental true
# Restore dependencies
yarn install
```
## Commands ## Commands
### Global These commands are available from the root directory. Each project directory also supports a number of commands that can be found in their respective `README.md` and `project.json` files.
| Commands | | | | Yarn Commands | Description |
| --------------- | --- | ----------------------------------------------------- | | -------------------- | ------------------------------------------------------------- |
| `build:package` | | Builds commonjs bundles for all projects | | **Develop** | |
| `test:unit` | | Jest multi-project test runner; overall coverage | | `dev` or `start` | Default development experience for Viewer |
| `test:unit:ci` | | Runs tests in parallel. Reports coverage per project. | | `dev:<package-name>` | Replace with `core`, `ui`, `i18n`, `cornerstone`, `vtk`, etc. |
| `test:unit` | Jest multi-project test runner; overall coverage |
| **Deploy** | |
| `build`* | Builds production output for our PWA Viewer |
| `build:package`* | Builds commonjs bundles for all projects |
### Local
| Commands | | | \* - For more information on our different builds, check out our [Deploy Docs][deployment-docs]
| -------------- | --- | ------------------------------------------------- |
| `test:unit` | | Runs tests while watching for changes |
| `test:unit:ci` | | Runs tests, collects coverage, reports to codecov |
## Developing ## Projects
The OHIF Medical Image Viewing Platform is maintained as a The OHIF Medical Image Viewing Platform is maintained as a
[`monorepo`][monorepo]. This means that this repository, instead of containing a [`monorepo`][monorepo]. This means that this repository, instead of containing a
@@ -62,72 +163,56 @@ you'll see the following:
``` ```
Want to better understand why and how we've structured this repository? Read Want to better understand why and how we've structured this repository? Read
more about it in our [Architecture Documentation](#todo). more about it in our [Architecture Documentation][ohif-architecture].
### Requirements ### Platform
- [Yarn 1.17.3+](https://yarnpkg.com/en/docs/install) These projects comprise the
- [Node 8+](https://nodejs.org/en/)
- Yarn Workspaces should be enabled on your machine:
- `yarn config set workspaces-experimental true`
### Getting Started | Name | Description | Links |
| ------------------------------- | ----------- | ----- |
| [@ohif/core][platform-core] | | NPM |
| [@ohif/i18n][platform-i18n] | | NPM |
| [@ohif/viewer][platform-viewer] | | NPM |
| [@ohif/ui][platform-ui] | | NPM |
1. [Fork this repository][how-to-fork] ### Extensions
2. [Clone your forked repository][how-to-clone]
- `git clone https://github.com/YOUR-USERNAME/Viewers.git`
3. Navigate to the cloned project's directory
4. Add this repo as a `remote` named `upstream`
- `git remote add upstream https://github.com/OHIF/Viewers.git`
5. `yarn install` to restore dependencies and link projects
#### To Develop This is a list of Extensions maintained by the OHIF Core team. It's possible to customize and configure these extensions, and you can even create your own. You can [read more about extensions here][ohif-extensions].
```bash | Name | Description | Links |
# Force install | -------------------------------------------------------------- | ----------- | ----- |
yarn install --force | [@ohif/extension-cornestone][extension-cornerstone] | | NPM |
| [@ohif/extension-dicom-html][extension-dicom-html] | | NPM |
| [@ohif/extension-dicom-microscopy][extension-dicom-microscopy] | | NPM |
| [@ohif/extension-dicom-pdf][extension-dicom-pdf] | | NPM |
| [@ohif/extension-vtk][extension-vtk] | | NPM |
# Link ## Acknowledgments
# Redundent with yarn workspaces
npx lerna bootstrap
```
```bash To acknowledge the OHIF Viewer in an academic publication, please cite
# Link for local dev
cd ./extensions/my-package
npx lerna add @ohif/my-package --scope=@ohif/my-package-consumer
```
```bash > _LesionTracker: Extensible Open-Source Zero-Footprint Web Viewer for Cancer
# Add shared dev dependency for workspace > Imaging Research and Clinical Trials_
yarn add --dev -W package-name >
``` > Trinity Urban, Erik Ziegler, Rob Lewis, Chris Hafey, Cheryl Sadow, Annick D.
> Van den Abbeele and Gordon J. Harris
>
> _Cancer Research_, November 1 2017 (77) (21) e119-e122 DOI:
> [10.1158/0008-5472.CAN-17-0334](https://www.doi.org/10.1158/0008-5472.CAN-17-0334)
// module vs main vs jsnext:main vs browser **Note:** If you use or find this repository helpful, please take the time to
https://babeljs.io/blog/2018/06/26/on-consuming-and-publishing-es2015+-packages star this repository on Github. This is an easy way for us to assess adoption
and it can help us obtain future funding for the project.
Webpack: https://webpack.js.org/configuration/resolve/ This work is supported primarily by the National Institutes of Health, National
Cancer Institute, Informatics Technology for Cancer Research (ITCR) program,
under a
[grant to Dr. Gordon Harris at Massachusetts General Hospital (U24 CA199460)](https://projectreporter.nih.gov/project_info_description.cfm?aid=8971104).
UMD builds go through ## License
- index.umd.js MIT © [OHIF](https://github.com/OHIF)
- Extensions passed in via window config
PWA builds go through
- index.js
- Extensions specified in file or by window config
> The module property should point to a script that utilizes ES2015 module
> syntax but no other syntax features that aren't yet supported by browsers or
> node. This enables webpack to parse the module syntax itself, allowing for
> lighter bundles via tree shaking if users are only consuming certain parts of
> the library.
## Notes
Lerna requires `GH_TOKEN` for GitHub authentication token
`git remote update` 1st call, need to verify host key
<!-- <!--
Links Links
@@ -139,10 +224,45 @@ Lerna requires `GH_TOKEN` for GitHub authentication token
[lerna-url]: https://lerna.js.org/ [lerna-url]: https://lerna.js.org/
[netlify-image]: https://api.netlify.com/api/v1/badges/a5d369ab-18a6-41c3-bcde-83805205ac7f/deploy-status [netlify-image]: https://api.netlify.com/api/v1/badges/a5d369ab-18a6-41c3-bcde-83805205ac7f/deploy-status
[netlify-url]: https://app.netlify.com/sites/ohif/deploys [netlify-url]: https://app.netlify.com/sites/ohif/deploys
[all-contributors-image]: https://img.shields.io/badge/all_contributors-0-orange.svg?style=flat-square
[contributing-url]: https://github.com/OHIF/Viewers/blob/react/CONTRIBUTING.md
[circleci-image]: https://circleci.com/gh/OHIF/Viewers.svg?style=svg
[circleci-url]: https://circleci.com/gh/OHIF/Viewers
[codecov-image]: https://codecov.io/gh/OHIF/Viewers/branch/react/graph/badge.svg
[codecov-url]: https://codecov.io/gh/OHIF/Viewers/branch/react
[prettier-image]: https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square
[prettier-url]: https://github.com/prettier/prettier
[semantic-image]: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg
[semantic-url]: https://github.com/semantic-release/semantic-release
<!-- ROW -->
[npm-url]: https://npmjs.org/package/ohif-viewer
[npm-downloads-image]: https://img.shields.io/npm/dm/ohif-viewer.svg?style=flat-square
[npm-version-image]: https://img.shields.io/npm/v/ohif-viewer.svg?style=flat-square
[docker-pulls-img]: https://img.shields.io/docker/pulls/ohif/viewer.svg?style=flat-square
[docker-image-url]: https://hub.docker.com/r/ohif/viewer
[license-image]: https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square
[license-url]: LICENSE
<!-- Links --> <!-- Links -->
[monorepo]: https://en.wikipedia.org/wiki/Monorepo [monorepo]: https://en.wikipedia.org/wiki/Monorepo
[how-to-fork]: https://help.github.com/en/articles/fork-a-repo [how-to-fork]: https://help.github.com/en/articles/fork-a-repo
[how-to-clone]: https://help.github.com/en/articles/fork-a-repo#step-2-create-a-local-clone-of-your-fork [how-to-clone]: https://help.github.com/en/articles/fork-a-repo#step-2-create-a-local-clone-of-your-fork
[ohif-architecture]: https://docs.ohif.org/advanced/architecture.html
[ohif-extensions]: https://docs.ohif.org/advanced/architecture.html
[deployment-docs]: https://docs.ohif.org/deployment/
[react-url]: https://reactjs.org/
[pwa-url]: https://developers.google.com/web/progressive-web-apps/
[ohif-viewer-url]: https://www.npmjs.com/package/ohif-viewer
[configuration-url]: https://docs.ohif.org/essentials/configuration.html
[extensions-url]: https://docs.ohif.org/advanced/extensions.html
<!-- Platform -->
[platform-core]: platform/core/README.md
[platform-i18n]: platform/i18n/README.md
[platform-ui]: platform/ui/README.md
[platform-viewer]: platform/viewer/README.md
<!-- Extensions -->
[extension-cornerstone]: extensions/cornerstone/README.md
[extension-dicom-html]: extensions/dicom-html/README.md
[extension-dicom-microscopy]: extensions/dicom-microscopy/README.md
[extension-dicom-pdf]: extensions/dicom-pdf/README.md
[extension-vtk]: extensions/vtk/README.md
<!-- prettier-ignore-end --> <!-- prettier-ignore-end -->
+3 -3
View File
@@ -197,9 +197,9 @@ would like included at startup.
_app.js_ _app.js_
```js ```js
import { createStore, combineReducers } from 'redux'; import { createStore, combineReducers } from "redux";
import OHIF from 'ohif-core'; import OHIF from "@ohif/core";
import OHIFCornerstoneExtension from 'ohif-cornerstone-extension'; import OHIFCornerstoneExtension from "ohif-cornerstone-extension";
const combined = combineReducers(OHIF.redux.reducers); const combined = combineReducers(OHIF.redux.reducers);
const store = createStore(combined); const store = createStore(combined);
-9
View File
@@ -1,9 +0,0 @@
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
-16
View File
@@ -1,16 +0,0 @@
{
"extends": [
"react-app",
"eslint:recommended",
"plugin:react/recommended"
],
"parser": "babel-eslint",
"env": {
"jest": true
},
"settings": {
"react": {
"version": "detect",
},
},
}
-26
View File
@@ -1,26 +0,0 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.
# dependencies
node_modules
# builds
build
dist
.rpt2_cache
# misc
.DS_Store
.env
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.idea
yalc.lock
.yalc
-4
View File
@@ -1,4 +0,0 @@
language: node_js
node_js:
- 9
- 8
+46 -2
View File
@@ -1,7 +1,51 @@
# Change Log # Change Log
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file. See
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.0.39-alpha.6](https://github.com/OHIF/Viewers/compare/@ohif/extension-cornerstone@0.0.39-alpha.5...@ohif/extension-cornerstone@0.0.39-alpha.6) (2019-08-08)
**Note:** Version bump only for package @ohif/extension-cornerstone
# Change Log
All notable changes to this project will be documented in this file. See
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.0.39-alpha.5](https://github.com/OHIF/Viewers/compare/@ohif/extension-cornerstone@0.0.39-alpha.4...@ohif/extension-cornerstone@0.0.39-alpha.5) (2019-08-08)
**Note:** Version bump only for package @ohif/extension-cornerstone
# Change Log
All notable changes to this project will be documented in this file. See
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.0.39-alpha.4](https://github.com/OHIF/Viewers/compare/@ohif/extension-cornerstone@0.0.39-alpha.3...@ohif/extension-cornerstone@0.0.39-alpha.4) (2019-08-08)
**Note:** Version bump only for package @ohif/extension-cornerstone
# Change Log
All notable changes to this project will be documented in this file. See
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.0.39-alpha.3](https://github.com/OHIF/Viewers/compare/@ohif/extension-cornerstone@0.0.39-alpha.2...@ohif/extension-cornerstone@0.0.39-alpha.3) (2019-08-08)
**Note:** Version bump only for package @ohif/extension-cornerstone
# Change Log
All notable changes to this project will be documented in this file. See
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.0.39-alpha.2](https://github.com/OHIF/Viewers/compare/@ohif/extension-cornerstone@0.0.39-alpha.1...@ohif/extension-cornerstone@0.0.39-alpha.2) (2019-08-07)
**Note:** Version bump only for package @ohif/extension-cornerstone
## [0.0.39-alpha.1](https://github.com/OHIF/Viewers/compare/@ohif/extension-cornerstone@0.0.39-alpha.0...@ohif/extension-cornerstone@0.0.39-alpha.1) (2019-08-07)
**Note:** Version bump only for package @ohif/extension-cornerstone
## 0.0.39-alpha.0 (2019-08-05) ## 0.0.39-alpha.0 (2019-08-05)
+8 -10
View File
@@ -1,6 +1,6 @@
{ {
"name": "@ohif/extension-cornerstone", "name": "@ohif/extension-cornerstone",
"version": "0.0.39-alpha.0", "version": "0.0.39-alpha.6",
"description": "OHIF extension for Cornerstone", "description": "OHIF extension for Cornerstone",
"author": "OHIF", "author": "OHIF",
"license": "MIT", "license": "MIT",
@@ -19,14 +19,15 @@
"access": "public" "access": "public"
}, },
"scripts": { "scripts": {
"build": "rollup -c", "build": "webpack --config config/webpack.prod.js -d",
"lerna:build": "webpack --config config/webpack.prod.js -w -d", "build:package": "yarn run build",
"prepublishOnly": "yarn run build", "prepublishOnly": "yarn run build",
"start": "rollup -c -w" "dev": "webpack --config config/webpack.prod.js -w -d",
"start": "yarn run dev"
}, },
"peerDependencies": { "peerDependencies": {
"@ohif/core": "^0.6.0", "@ohif/core": "^0.11.1-alpha.0",
"@ohif/ui": "^0.6.0", "@ohif/ui": "^0.2.18-alpha.0",
"cornerstone-core": "^2.2.8", "cornerstone-core": "^2.2.8",
"cornerstone-math": "^0.1.8", "cornerstone-math": "^0.1.8",
"cornerstone-tools": "^3.1.0", "cornerstone-tools": "^3.1.0",
@@ -47,8 +48,5 @@
"lodash.throttle": "^4.1.1", "lodash.throttle": "^4.1.1",
"react-cornerstone-viewport": "0.1.30" "react-cornerstone-viewport": "0.1.30"
}, },
"devDependencies": { "gitHead": "a5baa9228c0eda0df880136bde4420d78e6f8706"
"gh-pages": "^2.0.1",
"lodash.clonedeep": "^4.5.0"
}
} }
-68
View File
@@ -1,68 +0,0 @@
import babel from 'rollup-plugin-babel'
import commonjs from 'rollup-plugin-commonjs'
import external from 'rollup-plugin-peer-deps-external'
import postcss from 'rollup-plugin-postcss'
import resolve from 'rollup-plugin-node-resolve'
import url from 'rollup-plugin-url'
import pkg from './package.json'
// Deal with https://github.com/rollup/rollup-plugin-commonjs/issues/297
import builtins from 'rollup-plugin-node-builtins';
const globals = {
'react': 'React',
'react-dom': 'ReactDOM',
'react-redux': 'ReactRedux',
'react-resize-detector': 'ReactResizeDetector',
'react-viewerbase': 'reactViewerbase',
'prop-types': 'PropTypes',
'cornerstone-core': 'cornerstone',
'cornerstone-wado-image-loader': 'cornerstoneWADOImageLoader',
'cornerstone-math': 'cornerstoneMath',
'cornerstone-tools': 'cornerstoneTools',
'dcmjs': 'dcmjs',
'dicom-parser': 'dicomParser',
'ohif-core': 'OHIF',
'hammerjs': 'Hammer'
};
export default {
input: 'src/index.js',
output: [
{
file: pkg.main,
format: 'umd',
name: 'ohif-cornerstone-extension',
sourcemap: true,
globals
},
{
file: pkg.module,
format: 'es',
sourcemap: true,
globals
}
],
plugins: [
builtins(),
external(),
postcss({
modules: false
}),
url(),
babel({
exclude: 'node_modules/**',
externalHelpers: true,
runtimeHelpers: true
}),
resolve(),
commonjs({
include: 'node_modules/**',
namedExports: {
'node_modules/react-is/index.js': [
'isValidElementType'
]
}
})
],
external: Object.keys(pkg.peerDependencies || {}),
}
@@ -1,7 +1,7 @@
import CornerstoneViewport from 'react-cornerstone-viewport'; import CornerstoneViewport from "react-cornerstone-viewport";
import OHIF from 'ohif-core'; import OHIF from "@ohif/core";
import { connect } from 'react-redux'; import { connect } from "react-redux";
import throttle from 'lodash.throttle'; import throttle from "lodash.throttle";
const { setViewportActive, setViewportSpecificData } = OHIF.redux.actions; const { setViewportActive, setViewportSpecificData } = OHIF.redux.actions;
@@ -37,7 +37,7 @@ const mapStateToProps = (state, ownProps) => {
enableStackPrefetch: isActive, enableStackPrefetch: isActive,
//stack: viewportSpecificData.stack, //stack: viewportSpecificData.stack,
cineToolData: viewportSpecificData.cine, cineToolData: viewportSpecificData.cine,
viewport: viewportSpecificData.viewport, viewport: viewportSpecificData.viewport
}; };
}; };
@@ -64,8 +64,8 @@ const mapDispatchToProps = (dispatch, ownProps) => {
dispatch( dispatch(
setViewportSpecificData(viewportIndex, { setViewportSpecificData(viewportIndex, {
// TODO: Hack to make sure our plugin info is available from the outset // TODO: Hack to make sure our plugin info is available from the outset
plugin: 'cornerstone', plugin: "cornerstone",
dom: enabledElement, dom: enabledElement
}) })
); );
}, },
@@ -74,18 +74,18 @@ const mapDispatchToProps = (dispatch, ownProps) => {
const { const {
onAdded, onAdded,
onRemoved, onRemoved,
onModified, onModified
} = OHIF.measurements.MeasurementHandlers; } = OHIF.measurements.MeasurementHandlers;
const actions = { const actions = {
added: onAdded, added: onAdded,
removed: onRemoved, removed: onRemoved,
modified: throttle(event => { modified: throttle(event => {
return onModified(event); return onModified(event);
}, 300), }, 300)
}; };
return actions[action](event); return actions[action](event);
}, }
}; };
}; };
@@ -1,10 +1,10 @@
import React, { Component } from 'react'; import React, { Component } from "react";
import ConnectedCornerstoneViewport from './ConnectedCornerstoneViewport'; import ConnectedCornerstoneViewport from "./ConnectedCornerstoneViewport";
import OHIF from 'ohif-core'; import OHIF from "@ohif/core";
import PropTypes from 'prop-types'; import PropTypes from "prop-types";
import cornerstone from 'cornerstone-core'; import cornerstone from "cornerstone-core";
import handleSegmentationStorage from './handleSegmentationStorage.js'; import handleSegmentationStorage from "./handleSegmentationStorage.js";
const { StackManager } = OHIF.utils; const { StackManager } = OHIF.utils;
@@ -18,7 +18,7 @@ cornerstone.metaData.addProvider(
StackManager.setMetadataProvider(metadataProvider); StackManager.setMetadataProvider(metadataProvider);
const SOP_CLASSES = { const SOP_CLASSES = {
SEGMENTATION_STORAGE: '1.2.840.10008.5.1.4.1.1.66.4', SEGMENTATION_STORAGE: "1.2.840.10008.5.1.4.1.1.66.4"
}; };
const specialCaseHandlers = {}; const specialCaseHandlers = {};
@@ -28,11 +28,11 @@ specialCaseHandlers[
class OHIFCornerstoneViewport extends Component { class OHIFCornerstoneViewport extends Component {
state = { state = {
viewportData: null, viewportData: null
}; };
static defaultProps = { static defaultProps = {
customProps: {}, customProps: {}
}; };
static propTypes = { static propTypes = {
@@ -40,17 +40,17 @@ class OHIFCornerstoneViewport extends Component {
displaySet: PropTypes.object, displaySet: PropTypes.object,
viewportIndex: PropTypes.number, viewportIndex: PropTypes.number,
children: PropTypes.node, children: PropTypes.node,
customProps: PropTypes.object, customProps: PropTypes.object
}; };
static id = 'OHIFCornerstoneViewport'; static id = "OHIFCornerstoneViewport";
static init() { static init() {
console.log('OHIFCornerstoneViewport init()'); console.log("OHIFCornerstoneViewport init()");
} }
static destroy() { static destroy() {
console.log('OHIFCornerstoneViewport destroy()'); console.log("OHIFCornerstoneViewport destroy()");
StackManager.clearStacks(); StackManager.clearStacks();
} }
@@ -72,15 +72,15 @@ class OHIFCornerstoneViewport extends Component {
frameIndex = 0 frameIndex = 0
) { ) {
if (!studies || !studies.length) { if (!studies || !studies.length) {
throw new Error('Studies not provided.'); throw new Error("Studies not provided.");
} }
if (!studyInstanceUid) { if (!studyInstanceUid) {
throw new Error('StudyInstanceUID not provided.'); throw new Error("StudyInstanceUID not provided.");
} }
if (!displaySetInstanceUid) { if (!displaySetInstanceUid) {
throw new Error('StudyInstanceUID not provided.'); throw new Error("StudyInstanceUID not provided.");
} }
// Create shortcut to displaySet // Create shortcut to displaySet
@@ -89,7 +89,7 @@ class OHIFCornerstoneViewport extends Component {
); );
if (!study) { if (!study) {
throw new Error('Study not found.'); throw new Error("Study not found.");
} }
const displaySet = study.displaySets.find(set => { const displaySet = study.displaySets.find(set => {
@@ -97,7 +97,7 @@ class OHIFCornerstoneViewport extends Component {
}); });
if (!displaySet) { if (!displaySet) {
throw new Error('Display Set not found.'); throw new Error("Display Set not found.");
} }
// Get stack from Stack Manager // Get stack from Stack Manager
@@ -110,7 +110,7 @@ class OHIFCornerstoneViewport extends Component {
if (sopInstanceUid) { if (sopInstanceUid) {
const index = stack.imageIds.findIndex(imageId => { const index = stack.imageIds.findIndex(imageId => {
const sopCommonModule = cornerstone.metaData.get( const sopCommonModule = cornerstone.metaData.get(
'sopCommonModule', "sopCommonModule",
imageId imageId
); );
if (!sopCommonModule) { if (!sopCommonModule) {
@@ -124,7 +124,7 @@ class OHIFCornerstoneViewport extends Component {
stack.currentImageIdIndex = index; stack.currentImageIdIndex = index;
} else { } else {
console.warn( console.warn(
'SOPInstanceUID provided was not found in specified DisplaySet' "SOPInstanceUID provided was not found in specified DisplaySet"
); );
} }
} }
@@ -183,7 +183,7 @@ class OHIFCornerstoneViewport extends Component {
viewportData = { viewportData = {
studyInstanceUid, studyInstanceUid,
displaySetInstanceUid, displaySetInstanceUid,
stack, stack
}; };
break; break;
@@ -199,12 +199,12 @@ class OHIFCornerstoneViewport extends Component {
displaySetInstanceUid, displaySetInstanceUid,
sopClassUids, sopClassUids,
sopInstanceUid, sopInstanceUid,
frameIndex, frameIndex
} = displaySet; } = displaySet;
if (sopClassUids && sopClassUids.length > 1) { if (sopClassUids && sopClassUids.length > 1) {
console.warn( console.warn(
'More than one SOPClassUid in the same series is not yet supported.' "More than one SOPClassUid in the same series is not yet supported."
); );
} }
@@ -219,7 +219,7 @@ class OHIFCornerstoneViewport extends Component {
frameIndex frameIndex
).then(viewportData => { ).then(viewportData => {
this.setState({ this.setState({
viewportData, viewportData
}); });
}); });
} }
@@ -250,7 +250,7 @@ class OHIFCornerstoneViewport extends Component {
childrenWithProps = this.props.children.map((child, index) => { childrenWithProps = this.props.children.map((child, index) => {
return React.cloneElement(child, { return React.cloneElement(child, {
viewportIndex: this.props.viewportIndex, viewportIndex: this.props.viewportIndex,
key: index, key: index
}); });
}); });
} }
@@ -1,8 +1,8 @@
import * as dcmjs from 'dcmjs'; import * as dcmjs from "dcmjs";
import OHIF from 'ohif-core'; import OHIF from "@ohif/core";
import cornerstone from 'cornerstone-core'; import cornerstone from "cornerstone-core";
import cornerstoneTools from 'cornerstone-tools'; import cornerstoneTools from "cornerstone-tools";
const { StackManager } = OHIF.utils; const { StackManager } = OHIF.utils;
@@ -56,7 +56,7 @@ function retrieveDicomData(wadoUri) {
// TODO: Authorization header depends on the server. If we ever have multiple servers // TODO: Authorization header depends on the server. If we ever have multiple servers
// we will need to figure out how / when to pass this information in. // we will need to figure out how / when to pass this information in.
return fetch(wadoUri, { return fetch(wadoUri, {
headers: OHIF.DICOMWeb.getAuthorizationHeader(), headers: OHIF.DICOMWeb.getAuthorizationHeader()
}).then(response => response.arrayBuffer()); }).then(response => response.arrayBuffer());
} }
@@ -91,7 +91,7 @@ async function handleSegmentationStorage(
if (displaySets.length > 1) { if (displaySets.length > 1) {
console.warn( console.warn(
'More than one display set with the same seriesInstanceUid. This is not supported yet...' "More than one display set with the same seriesInstanceUid. This is not supported yet..."
); );
} }
@@ -100,7 +100,7 @@ async function handleSegmentationStorage(
const results = parseSeg(arrayBuffer, imageIds); const results = parseSeg(arrayBuffer, imageIds);
if (!results) { if (!results) {
throw new Error('Fractional segmentations are not supported'); throw new Error("Fractional segmentations are not supported");
} }
const { segMetadata, toolState } = results; const { segMetadata, toolState } = results;
@@ -123,7 +123,7 @@ async function handleSegmentationStorage(
return { return {
studyInstanceUid, studyInstanceUid,
displaySetInstanceUid, displaySetInstanceUid,
stack, stack
}; };
} }
-9
View File
@@ -1,9 +0,0 @@
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
-16
View File
@@ -1,16 +0,0 @@
{
"extends": [
"react-app",
"eslint:recommended",
"plugin:react/recommended"
],
"parser": "babel-eslint",
"env": {
"jest": true
},
"settings": {
"react": {
"version": "detect",
},
},
}
-23
View File
@@ -1,23 +0,0 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.
# dependencies
node_modules
# builds
build
dist
.rpt2_cache
# misc
.DS_Store
.env
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.idea
-4
View File
@@ -1,4 +0,0 @@
language: node_js
node_js:
- 9
- 8
+46 -2
View File
@@ -1,7 +1,51 @@
# Change Log # Change Log
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file. See
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.0.4-alpha.6](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-html@0.0.4-alpha.5...@ohif/extension-dicom-html@0.0.4-alpha.6) (2019-08-08)
**Note:** Version bump only for package @ohif/extension-dicom-html
# Change Log
All notable changes to this project will be documented in this file. See
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.0.4-alpha.5](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-html@0.0.4-alpha.4...@ohif/extension-dicom-html@0.0.4-alpha.5) (2019-08-08)
**Note:** Version bump only for package @ohif/extension-dicom-html
# Change Log
All notable changes to this project will be documented in this file. See
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.0.4-alpha.4](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-html@0.0.4-alpha.3...@ohif/extension-dicom-html@0.0.4-alpha.4) (2019-08-08)
**Note:** Version bump only for package @ohif/extension-dicom-html
# Change Log
All notable changes to this project will be documented in this file. See
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.0.4-alpha.3](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-html@0.0.4-alpha.2...@ohif/extension-dicom-html@0.0.4-alpha.3) (2019-08-08)
**Note:** Version bump only for package @ohif/extension-dicom-html
# Change Log
All notable changes to this project will be documented in this file. See
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.0.4-alpha.2](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-html@0.0.4-alpha.1...@ohif/extension-dicom-html@0.0.4-alpha.2) (2019-08-07)
**Note:** Version bump only for package @ohif/extension-dicom-html
## [0.0.4-alpha.1](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-html@0.0.4-alpha.0...@ohif/extension-dicom-html@0.0.4-alpha.1) (2019-08-07)
**Note:** Version bump only for package @ohif/extension-dicom-html
## 0.0.4-alpha.0 (2019-08-05) ## 0.0.4-alpha.0 (2019-08-05)
+1
View File
@@ -0,0 +1 @@
# @ohif/extension-dicom-html
+1
View File
@@ -0,0 +1 @@
:root{--text-color-primary:#fff}.DicomHtmlViewport{padding:20px;overflow-y:scroll;width:100%;height:100%;color:#fff;color:var(--text-color-primary)}
+11 -11
View File
@@ -1,6 +1,6 @@
{ {
"name": "@ohif/extension-dicom-html", "name": "@ohif/extension-dicom-html",
"version": "0.0.4-alpha.0", "version": "0.0.4-alpha.6",
"description": "OHIF extension for rendering structured reports to HTML", "description": "OHIF extension for rendering structured reports to HTML",
"author": "OHIF", "author": "OHIF",
"license": "MIT", "license": "MIT",
@@ -12,12 +12,14 @@
"npm": ">=5" "npm": ">=5"
}, },
"scripts": { "scripts": {
"lerna:build": "webpack --config config/webpack.prod.js -w -d", "dev": "webpack --config config/webpack.prod.js -w -d",
"prepublishOnly": "npm run build", "build": "webpack --config config/webpack.prod.js -d",
"start": "rollup -c -w" "build:package": "yarn run build",
"prepublishOnly": "yarn run build",
"start": "yarn run dev"
}, },
"peerDependencies": { "peerDependencies": {
"@ohif/core": "^0.6.0", "@ohif/core": "^0.11.1-alpha.0",
"dcmjs": "^0.3.3", "dcmjs": "^0.3.3",
"prop-types": "^15.6.2", "prop-types": "^15.6.2",
"react": "^15.0.0 || ^16.0.0", "react": "^15.0.0 || ^16.0.0",
@@ -26,14 +28,12 @@
"dependencies": { "dependencies": {
"@babel/runtime": "^7.2.0" "@babel/runtime": "^7.2.0"
}, },
"devDependencies": {
"gh-pages": "^2.0.1",
"lodash.clonedeep": "^4.5.0"
},
"files": [ "files": [
"dist" "dist",
"README.md"
], ],
"publishConfig": { "publishConfig": {
"access": "public" "access": "public"
} },
"gitHead": "a5baa9228c0eda0df880136bde4420d78e6f8706"
} }
-55
View File
@@ -1,55 +0,0 @@
import babel from 'rollup-plugin-babel'
import commonjs from 'rollup-plugin-commonjs'
import external from 'rollup-plugin-peer-deps-external'
import postcss from 'rollup-plugin-postcss'
import resolve from 'rollup-plugin-node-resolve'
import url from 'rollup-plugin-url'
import svgr from '@svgr/rollup'
import pkg from './package.json'
// Deal with https://github.com/rollup/rollup-plugin-commonjs/issues/297
import builtins from 'rollup-plugin-node-builtins';
const globals = {
'react': 'React',
'react-dom': 'ReactDOM',
'prop-types': 'PropTypes',
'ohif-core': 'OHIF',
'dcmjs': 'dcmjs'
};
export default {
input: 'src/index.js',
output: [
{
file: pkg.main,
format: 'umd',
name: 'ohif-dicom-pdf-extension',
sourcemap: true,
globals
},
{
file: pkg.module,
format: 'es',
sourcemap: true,
globals
}
],
plugins: [
builtins(),
external(),
postcss({
modules: false
}),
url(),
svgr(),
babel({
exclude: 'node_modules/**',
plugins: [ '@babel/external-helpers' ],
externalHelpers: true,
runtimeHelpers: true
}),
resolve(),
commonjs()
],
external: Object.keys(pkg.peerDependencies || {}),
}
@@ -1,14 +1,14 @@
import { MODULE_TYPES, utils } from 'ohif-core'; import { MODULE_TYPES, utils } from "@ohif/core";
// TODO: Should probably use dcmjs for this // TODO: Should probably use dcmjs for this
const SOP_CLASS_UIDS = { const SOP_CLASS_UIDS = {
BASIC_TEXT_SR: '1.2.840.10008.5.1.4.1.1.88.11', BASIC_TEXT_SR: "1.2.840.10008.5.1.4.1.1.88.11",
ENHANCED_SR: '1.2.840.10008.5.1.4.1.1.88.22', ENHANCED_SR: "1.2.840.10008.5.1.4.1.1.88.22",
COMPREHENSIVE_SR: '1.2.840.10008.5.1.4.1.1.88.33', COMPREHENSIVE_SR: "1.2.840.10008.5.1.4.1.1.88.33",
PROCEDURE_LOG_STORAGE: '1.2.840.10008.5.1.4.1.1.88.40', PROCEDURE_LOG_STORAGE: "1.2.840.10008.5.1.4.1.1.88.40",
MAMMOGRAPHY_CAD_SR: '1.2.840.10008.5.1.4.1.1.88.50', MAMMOGRAPHY_CAD_SR: "1.2.840.10008.5.1.4.1.1.88.50",
CHEST_CAD_SR: '1.2.840.10008.5.1.4.1.1.88.65', CHEST_CAD_SR: "1.2.840.10008.5.1.4.1.1.88.65",
X_RAY_RADIATION_DOSE_SR: '1.2.840.10008.5.1.4.1.1.88.67' X_RAY_RADIATION_DOSE_SR: "1.2.840.10008.5.1.4.1.1.88.67"
}; };
const sopClassUids = Object.values(SOP_CLASS_UIDS); const sopClassUids = Object.values(SOP_CLASS_UIDS);
@@ -16,14 +16,14 @@ const sopClassUids = Object.values(SOP_CLASS_UIDS);
// TODO: Handle the case where there is more than one SOP Class Handler for the // TODO: Handle the case where there is more than one SOP Class Handler for the
// same SOP Class // same SOP Class
const OHIFDicomHtmlSopClassHandler = { const OHIFDicomHtmlSopClassHandler = {
id: 'OHIFDicomHtmlSopClassHandler', id: "OHIFDicomHtmlSopClassHandler",
type: MODULE_TYPES.SOP_CLASS_HANDLER, type: MODULE_TYPES.SOP_CLASS_HANDLER,
sopClassUids, sopClassUids,
getDisplaySetFromSeries(series, study, dicomWebClient, authorizationHeaders) { getDisplaySetFromSeries(series, study, dicomWebClient, authorizationHeaders) {
const instance = series.getFirstInstance(); const instance = series.getFirstInstance();
return { return {
plugin: 'html', plugin: "html",
displaySetInstanceUid: utils.guid(), displaySetInstanceUid: utils.guid(),
wadoRoot: study.getData().wadoRoot, wadoRoot: study.getData().wadoRoot,
wadoUri: instance.getData().wadouri, wadoUri: instance.getData().wadouri,
File diff suppressed because it is too large. Load diff
@@ -1,9 +0,0 @@
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
-23
View File
@@ -1,23 +0,0 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.
# dependencies
node_modules
# builds
build
dist
.rpt2_cache
# misc
.DS_Store
.env
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.idea
-4
View File
@@ -1,4 +0,0 @@
language: node_js
node_js:
- 9
- 8
+46 -2
View File
@@ -1,7 +1,51 @@
# Change Log # Change Log
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file. See
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.0.9-alpha.6](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-microscopy@0.0.9-alpha.5...@ohif/extension-dicom-microscopy@0.0.9-alpha.6) (2019-08-08)
**Note:** Version bump only for package @ohif/extension-dicom-microscopy
# Change Log
All notable changes to this project will be documented in this file. See
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.0.9-alpha.5](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-microscopy@0.0.9-alpha.4...@ohif/extension-dicom-microscopy@0.0.9-alpha.5) (2019-08-08)
**Note:** Version bump only for package @ohif/extension-dicom-microscopy
# Change Log
All notable changes to this project will be documented in this file. See
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.0.9-alpha.4](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-microscopy@0.0.9-alpha.3...@ohif/extension-dicom-microscopy@0.0.9-alpha.4) (2019-08-08)
**Note:** Version bump only for package @ohif/extension-dicom-microscopy
# Change Log
All notable changes to this project will be documented in this file. See
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.0.9-alpha.3](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-microscopy@0.0.9-alpha.2...@ohif/extension-dicom-microscopy@0.0.9-alpha.3) (2019-08-08)
**Note:** Version bump only for package @ohif/extension-dicom-microscopy
# Change Log
All notable changes to this project will be documented in this file. See
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.0.9-alpha.2](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-microscopy@0.0.9-alpha.1...@ohif/extension-dicom-microscopy@0.0.9-alpha.2) (2019-08-07)
**Note:** Version bump only for package @ohif/extension-dicom-microscopy
## [0.0.9-alpha.1](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-microscopy@0.0.9-alpha.0...@ohif/extension-dicom-microscopy@0.0.9-alpha.1) (2019-08-07)
**Note:** Version bump only for package @ohif/extension-dicom-microscopy
## 0.0.9-alpha.0 (2019-08-05) ## 0.0.9-alpha.0 (2019-08-05)
+17 -16
View File
@@ -1,38 +1,39 @@
{ {
"name": "@ohif/extension-dicom-microscopy", "name": "@ohif/extension-dicom-microscopy",
"version": "0.0.9-alpha.0", "version": "0.0.9-alpha.6",
"description": "OHIF extension for Dicom Microscopy", "description": "OHIF extension for Dicom Microscopy",
"author": "OHIF", "author": "OHIF",
"license": "MIT", "license": "MIT",
"repository": "OHIF/Viewers", "repository": "OHIF/Viewers",
"main": "dist/index.umd.js", "main": "dist/index.umd.js",
"module": "src/index.js", "module": "src/index.js",
"publishConfig": {
"access": "public"
},
"engines": { "engines": {
"node": ">=8", "node": ">=8",
"npm": ">=5" "npm": ">=5"
}, },
"scripts": { "scripts": {
"lerna:build": "webpack --config config/webpack.prod.js -w -d", "build": "webpack --config config/webpack.prod.js -d",
"prepublishOnly": "npm run build", "build:package": "yarn run build",
"start": "rollup -c -w" "prepublishOnly": "yarn run build",
}, "dev": "webpack --config config/webpack.prod.js -w -d",
"peerDependencies": { "start": "yarn run dev"
"@ohif/core": "^0.6.0",
"react": "^15.0.0 || ^16.0.0",
"react-dom": "^15.0.0 || ^16.0.0"
},
"devDependencies": {
"gh-pages": "^2.0.1"
}, },
"files": [ "files": [
"dist" "dist",
"README.md"
], ],
"publishConfig": { "peerDependencies": {
"access": "public" "@ohif/core": "^0.11.1-alpha.0",
"react": "^15.0.0 || ^16.0.0",
"react-dom": "^15.0.0 || ^16.0.0"
}, },
"dependencies": { "dependencies": {
"@babel/runtime": "^7.2.0", "@babel/runtime": "^7.2.0",
"classnames": "^2.2.6", "classnames": "^2.2.6",
"dicom-microscopy-viewer": "^0.4.3" "dicom-microscopy-viewer": "^0.4.3"
} },
"gitHead": "a5baa9228c0eda0df880136bde4420d78e6f8706"
} }
@@ -1,60 +0,0 @@
import babel from 'rollup-plugin-babel';
import commonjs from 'rollup-plugin-commonjs';
import external from 'rollup-plugin-peer-deps-external';
import postcss from 'rollup-plugin-postcss';
import resolve from 'rollup-plugin-node-resolve';
import url from 'rollup-plugin-url';
import pkg from './package.json';
// Deal with https://github.com/rollup/rollup-plugin-commonjs/issues/297
import builtins from 'rollup-plugin-node-builtins';
const globals = {
react: 'React',
'react-dom': 'ReactDOM',
'ohif-core': 'OHIF'
};
export default {
input: 'src/index.js',
output: [
{
file: pkg.main,
format: 'umd',
name: 'ohif-dicom-microscopy-extension',
sourcemap: true,
globals
},
{
file: pkg.module,
format: 'es',
sourcemap: true,
globals
}
],
plugins: [
builtins(),
external(),
postcss({
modules: false
}),
url(),
babel({
exclude: 'node_modules/**',
plugins: ['@babel/external-helpers'],
externalHelpers: true,
runtimeHelpers: true
}),
resolve(),
commonjs({
namedExports: {
'node_modules/dicom-microscopy-viewer/build/dicom-microscopy-viewer.js': [
'api'
],
'.yalc/dicom-microscopy-viewer/build/dicom-microscopy-viewer.js': [
'api'
]
}
})
],
external: Object.keys(pkg.peerDependencies || {})
};
@@ -1,13 +1,13 @@
import OHIF from 'ohif-core'; import OHIF from "@ohif/core";
const { utils } = OHIF; const { utils } = OHIF;
const SOP_CLASS_UIDS = { const SOP_CLASS_UIDS = {
VL_WHOLE_SLIDE_MICROSCOPY_IMAGE_STORAGE: '1.2.840.10008.5.1.4.1.1.77.1.6', VL_WHOLE_SLIDE_MICROSCOPY_IMAGE_STORAGE: "1.2.840.10008.5.1.4.1.1.77.1.6"
}; };
const DicomMicroscopySopClassHandler = { const DicomMicroscopySopClassHandler = {
id: 'DicomMicroscopySopClassHandlerPlugin', id: "DicomMicroscopySopClassHandlerPlugin",
sopClassUids: [SOP_CLASS_UIDS.VL_WHOLE_SLIDE_MICROSCOPY_IMAGE_STORAGE], sopClassUids: [SOP_CLASS_UIDS.VL_WHOLE_SLIDE_MICROSCOPY_IMAGE_STORAGE],
getDisplaySetFromSeries(series, study, dicomWebClient) { getDisplaySetFromSeries(series, study, dicomWebClient) {
const instance = series.getFirstInstance(); const instance = series.getFirstInstance();
@@ -15,14 +15,14 @@ const DicomMicroscopySopClassHandler = {
// Note: We are passing the dicomweb client into each viewport! // Note: We are passing the dicomweb client into each viewport!
return { return {
plugin: 'microscopy', plugin: "microscopy",
displaySetInstanceUid: utils.guid(), displaySetInstanceUid: utils.guid(),
dicomWebClient, dicomWebClient,
sopInstanceUid: instance.getSOPInstanceUID(), sopInstanceUid: instance.getSOPInstanceUID(),
seriesInstanceUid: series.getSeriesInstanceUID(), seriesInstanceUid: series.getSeriesInstanceUID(),
studyInstanceUid: study.getStudyInstanceUID(), studyInstanceUid: study.getStudyInstanceUID()
}; };
}, }
}; };
export default DicomMicroscopySopClassHandler; export default DicomMicroscopySopClassHandler;
File diff suppressed because it is too large. Load diff
-9
View File
@@ -1,9 +0,0 @@
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
-4
View File
@@ -1,4 +0,0 @@
language: node_js
node_js:
- 9
- 8
+46 -2
View File
@@ -1,7 +1,51 @@
# Change Log # Change Log
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file. See
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.0.8-alpha.6](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-pdf@0.0.8-alpha.5...@ohif/extension-dicom-pdf@0.0.8-alpha.6) (2019-08-08)
**Note:** Version bump only for package @ohif/extension-dicom-pdf
# Change Log
All notable changes to this project will be documented in this file. See
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.0.8-alpha.5](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-pdf@0.0.8-alpha.4...@ohif/extension-dicom-pdf@0.0.8-alpha.5) (2019-08-08)
**Note:** Version bump only for package @ohif/extension-dicom-pdf
# Change Log
All notable changes to this project will be documented in this file. See
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.0.8-alpha.4](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-pdf@0.0.8-alpha.3...@ohif/extension-dicom-pdf@0.0.8-alpha.4) (2019-08-08)
**Note:** Version bump only for package @ohif/extension-dicom-pdf
# Change Log
All notable changes to this project will be documented in this file. See
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.0.8-alpha.3](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-pdf@0.0.8-alpha.2...@ohif/extension-dicom-pdf@0.0.8-alpha.3) (2019-08-08)
**Note:** Version bump only for package @ohif/extension-dicom-pdf
# Change Log
All notable changes to this project will be documented in this file. See
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.0.8-alpha.2](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-pdf@0.0.8-alpha.1...@ohif/extension-dicom-pdf@0.0.8-alpha.2) (2019-08-07)
**Note:** Version bump only for package @ohif/extension-dicom-pdf
## [0.0.8-alpha.1](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-pdf@0.0.8-alpha.0...@ohif/extension-dicom-pdf@0.0.8-alpha.1) (2019-08-07)
**Note:** Version bump only for package @ohif/extension-dicom-pdf
## 0.0.8-alpha.0 (2019-08-05) ## 0.0.8-alpha.0 (2019-08-05)
+1
View File
@@ -0,0 +1 @@
# @ohif/extension-dicom-pdf
+14 -14
View File
@@ -1,23 +1,32 @@
{ {
"name": "@ohif/extension-dicom-pdf", "name": "@ohif/extension-dicom-pdf",
"version": "0.0.8-alpha.0", "version": "0.0.8-alpha.6",
"description": "OHIF extension for Dicom PDF", "description": "OHIF extension for Dicom PDF",
"author": "OHIF", "author": "OHIF",
"license": "MIT", "license": "MIT",
"repository": "OHIF/Viewers", "repository": "OHIF/Viewers",
"main": "dist/index.umd.js", "main": "dist/index.umd.js",
"module": "src/index.js", "module": "src/index.js",
"publishConfig": {
"access": "public"
},
"engines": { "engines": {
"node": ">=8", "node": ">=8",
"npm": ">=5" "npm": ">=5"
}, },
"files": [
"dist",
"README.md"
],
"scripts": { "scripts": {
"lerna:build": "webpack --config config/webpack.prod.js -w -d", "dev": "webpack --config config/webpack.prod.js -w -d",
"build": "webpack --config config/webpack.prod.js -d",
"build:package": "yarn run build",
"prepublishOnly": "yarn run build", "prepublishOnly": "yarn run build",
"start": "rollup -c -w" "start": "yarn run dev"
}, },
"peerDependencies": { "peerDependencies": {
"@ohif/core": "^0.6.0", "@ohif/core": "^0.11.1-alpha.0",
"dicom-parser": "^1.8.3", "dicom-parser": "^1.8.3",
"prop-types": "^15.6.2", "prop-types": "^15.6.2",
"react": "^15.0.0 || ^16.0.0", "react": "^15.0.0 || ^16.0.0",
@@ -28,14 +37,5 @@
"classnames": "^2.2.6", "classnames": "^2.2.6",
"lodash.isequal": "^4.5.0" "lodash.isequal": "^4.5.0"
}, },
"devDependencies": { "gitHead": "a5baa9228c0eda0df880136bde4420d78e6f8706"
"gh-pages": "^2.0.1",
"lodash.clonedeep": "^4.5.0"
},
"files": [
"dist"
],
"publishConfig": {
"access": "public"
}
} }
-55
View File
@@ -1,55 +0,0 @@
import babel from 'rollup-plugin-babel'
import commonjs from 'rollup-plugin-commonjs'
import external from 'rollup-plugin-peer-deps-external'
import postcss from 'rollup-plugin-postcss'
import resolve from 'rollup-plugin-node-resolve'
import url from 'rollup-plugin-url'
import svgr from '@svgr/rollup'
import pkg from './package.json'
// Deal with https://github.com/rollup/rollup-plugin-commonjs/issues/297
import builtins from 'rollup-plugin-node-builtins';
const globals = {
'react': 'React',
'react-dom': 'ReactDOM',
'prop-types': 'PropTypes',
'ohif-core': 'OHIF',
'dicom-parser': 'dicomParser'
};
export default {
input: 'src/index.js',
output: [
{
file: pkg.main,
format: 'umd',
name: 'ohif-dicom-pdf-extension',
sourcemap: true,
globals
},
{
file: pkg.module,
format: 'es',
sourcemap: true,
globals
}
],
plugins: [
builtins(),
external(),
postcss({
modules: false
}),
url(),
svgr(),
babel({
exclude: 'node_modules/**',
plugins: [ '@babel/external-helpers' ],
externalHelpers: true,
runtimeHelpers: true
}),
resolve(),
commonjs()
],
external: Object.keys(pkg.peerDependencies || {}),
}
@@ -1,19 +1,19 @@
import { MODULE_TYPES, utils } from 'ohif-core'; import { MODULE_TYPES, utils } from "@ohif/core";
// TODO: Should probably use dcmjs for this // TODO: Should probably use dcmjs for this
const SOP_CLASS_UIDS = { const SOP_CLASS_UIDS = {
ENCAPSULATED_PDF: '1.2.840.10008.5.1.4.1.1.104.1' ENCAPSULATED_PDF: "1.2.840.10008.5.1.4.1.1.104.1"
}; };
const OHIFDicomPDFSopClassHandler = { const OHIFDicomPDFSopClassHandler = {
id: 'OHIFDicomPDFSopClassHandlerPlugin', id: "OHIFDicomPDFSopClassHandlerPlugin",
type: MODULE_TYPES.SOP_CLASS_HANDLER, type: MODULE_TYPES.SOP_CLASS_HANDLER,
sopClassUids: [SOP_CLASS_UIDS.ENCAPSULATED_PDF], sopClassUids: [SOP_CLASS_UIDS.ENCAPSULATED_PDF],
getDisplaySetFromSeries(series, study, dicomWebClient, authorizationHeaders) { getDisplaySetFromSeries(series, study, dicomWebClient, authorizationHeaders) {
const instance = series.getFirstInstance(); const instance = series.getFirstInstance();
return { return {
plugin: 'pdf', plugin: "pdf",
displaySetInstanceUid: utils.guid(), displaySetInstanceUid: utils.guid(),
wadoRoot: study.getData().wadoRoot, wadoRoot: study.getData().wadoRoot,
wadoUri: instance.getData().wadouri, wadoUri: instance.getData().wadouri,
@@ -1,8 +1,8 @@
import React, { Component } from 'react'; import React, { Component } from "react";
import PropTypes from 'prop-types'; import PropTypes from "prop-types";
import OHIF from 'ohif-core'; import OHIF from "@ohif/core";
import OHIFComponentPlugin from './OHIFComponentPlugin.js'; import OHIFComponentPlugin from "./OHIFComponentPlugin.js";
import DicomPDFViewport from './DicomPDFViewport'; import DicomPDFViewport from "./DicomPDFViewport";
const { DICOMWeb } = OHIF; const { DICOMWeb } = OHIF;
@@ -18,25 +18,41 @@ class OHIFDicomPDFViewport extends Component {
error: null error: null
}; };
static id = 'DicomPDFViewportPDF'; static id = "DicomPDFViewportPDF";
static init() { static init() {
console.log('DicomPDFViewport init()'); console.log("DicomPDFViewport init()");
} }
static destroy() { static destroy() {
console.log('DicomPDFViewport destroy()'); console.log("DicomPDFViewport destroy()");
} }
componentDidMount() { componentDidMount() {
const { displaySet } = this.props.viewportData; const { displaySet } = this.props.viewportData;
const { studyInstanceUid, seriesInstanceUid, sopInstanceUid, wadoRoot, wadoUri, authorizationHeaders} = displaySet; const {
studyInstanceUid,
seriesInstanceUid,
sopInstanceUid,
wadoRoot,
wadoUri,
authorizationHeaders
} = displaySet;
this.retrieveDicomData(studyInstanceUid, seriesInstanceUid, sopInstanceUid, wadoRoot, wadoUri, authorizationHeaders).then(byteArray => { this.retrieveDicomData(
studyInstanceUid,
seriesInstanceUid,
sopInstanceUid,
wadoRoot,
wadoUri,
authorizationHeaders
).then(
byteArray => {
this.setState({ this.setState({
byteArray byteArray
}); });
}, error => { },
error => {
this.setState({ this.setState({
error error
}); });
@@ -46,14 +62,23 @@ class OHIFDicomPDFViewport extends Component {
); );
} }
retrieveDicomData(studyInstanceUid, seriesInstanceUid, sopInstanceUid, wadoRoot, wadoUri, authorizationHeaders) { retrieveDicomData(
studyInstanceUid,
seriesInstanceUid,
sopInstanceUid,
wadoRoot,
wadoUri,
authorizationHeaders
) {
// TODO: Passing in a lot of data we aren't using // TODO: Passing in a lot of data we aren't using
// TODO: Authorization header depends on the server. If we ever have multiple servers // TODO: Authorization header depends on the server. If we ever have multiple servers
// we will need to figure out how / when to pass this information in. // we will need to figure out how / when to pass this information in.
return fetch(wadoUri, { return fetch(wadoUri, {
headers: authorizationHeaders headers: authorizationHeaders
}).then(response => response.arrayBuffer()).then(arraybuffer => { })
.then(response => response.arrayBuffer())
.then(arraybuffer => {
return new Uint8Array(arraybuffer); return new Uint8Array(arraybuffer);
}); });
} }
+46 -2
View File
@@ -1,7 +1,51 @@
# Change Log # Change Log
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file. See
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.1.4-alpha.6](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@0.1.4-alpha.5...@ohif/extension-vtk@0.1.4-alpha.6) (2019-08-08)
**Note:** Version bump only for package @ohif/extension-vtk
# Change Log
All notable changes to this project will be documented in this file. See
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.1.4-alpha.5](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@0.1.4-alpha.4...@ohif/extension-vtk@0.1.4-alpha.5) (2019-08-08)
**Note:** Version bump only for package @ohif/extension-vtk
# Change Log
All notable changes to this project will be documented in this file. See
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.1.4-alpha.4](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@0.1.4-alpha.3...@ohif/extension-vtk@0.1.4-alpha.4) (2019-08-08)
**Note:** Version bump only for package @ohif/extension-vtk
# Change Log
All notable changes to this project will be documented in this file. See
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.1.4-alpha.3](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@0.1.4-alpha.2...@ohif/extension-vtk@0.1.4-alpha.3) (2019-08-08)
**Note:** Version bump only for package @ohif/extension-vtk
# Change Log
All notable changes to this project will be documented in this file. See
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.1.4-alpha.2](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@0.1.4-alpha.1...@ohif/extension-vtk@0.1.4-alpha.2) (2019-08-07)
**Note:** Version bump only for package @ohif/extension-vtk
## [0.1.4-alpha.1](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@0.1.4-alpha.0...@ohif/extension-vtk@0.1.4-alpha.1) (2019-08-07)
**Note:** Version bump only for package @ohif/extension-vtk
## 0.1.4-alpha.0 (2019-08-05) ## 0.1.4-alpha.0 (2019-08-05)
+14 -10
View File
@@ -1,6 +1,6 @@
{ {
"name": "@ohif/extension-vtk", "name": "@ohif/extension-vtk",
"version": "0.1.4-alpha.0", "version": "0.1.4-alpha.6",
"description": "OHIF extension for VTK.js", "description": "OHIF extension for VTK.js",
"author": "OHIF", "author": "OHIF",
"license": "MIT", "license": "MIT",
@@ -8,18 +8,24 @@
"main": "dist/index.umd.js", "main": "dist/index.umd.js",
"module": "src/index.js", "module": "src/index.js",
"sideEffects": true, "sideEffects": true,
"publishConfig": {
"access": "public"
},
"engines": { "engines": {
"node": ">=8", "node": ">=8",
"npm": ">=5" "npm": ">=5"
}, },
"scripts": { "scripts": {
"build": "webpack --progress --colors --mode production", "build": "webpack --progress --colors --mode production",
"lerna:build": "webpack --watch --progress --colors --mode development" "build:package": "yarn run build",
"prepublishOnly": "yarn run build",
"dev": "webpack --watch --progress --colors --mode development",
"start": "yarn run dev"
}, },
"peerDependencies": { "peerDependencies": {
"@ohif/core": "^0.6.0", "@ohif/core": "^0.11.1-alpha.0",
"@ohif/i18n": "0.2.2", "@ohif/i18n": "^0.2.3",
"@ohif/ui": "^0.15.1", "@ohif/ui": "^0.2.18-alpha.0",
"cornerstone-core": "^2.2.8", "cornerstone-core": "^2.2.8",
"cornerstone-wado-image-loader": "^2.2.3", "cornerstone-wado-image-loader": "^2.2.3",
"dcmjs": "^0.4.7", "dcmjs": "^0.4.7",
@@ -40,8 +46,8 @@
"vtk.js": "^8.11.0" "vtk.js": "^8.11.0"
}, },
"devDependencies": { "devDependencies": {
"@ohif/core": "^0.7.0", "@ohif/core": "^0.11.1-alpha.6",
"@ohif/ui": "^0.15.1", "@ohif/ui": "^0.2.18-alpha.6",
"cornerstone-tools": "^3.13.0", "cornerstone-tools": "^3.13.0",
"cornerstone-wado-image-loader": "^2.2.3", "cornerstone-wado-image-loader": "^2.2.3",
"dcmjs": "^0.4.7", "dcmjs": "^0.4.7",
@@ -57,7 +63,5 @@
"dist", "dist",
"README.md" "README.md"
], ],
"publishConfig": { "gitHead": "a5baa9228c0eda0df880136bde4420d78e6f8706"
"access": "public"
}
} }
-78
View File
@@ -1,78 +0,0 @@
import babel from 'rollup-plugin-babel';
import builtins from 'rollup-plugin-node-builtins';
import commonjs from 'rollup-plugin-commonjs';
import external from 'rollup-plugin-peer-deps-external';
import pkg from './package.json';
import postcss from 'rollup-plugin-postcss';
import resolve from 'rollup-plugin-node-resolve';
import url from 'rollup-plugin-url';
import copy from 'rollup-plugin-copy';
// Deal with https://github.com/rollup/rollup-plugin-commonjs/issues/297
// const globals = {
// react: 'React',
// 'react-dom': 'ReactDOM',
// 'react-redux': 'ReactRedux',
// 'react-resize-detector': 'ReactResizeDetector',
// 'react-viewerbase': 'reactViewerbase',
// 'prop-types': 'PropTypes',
// 'cornerstone-core': 'cornerstone',
// 'cornerstone-wado-image-loader': 'cornerstoneWADOImageLoader',
// 'cornerstone-math': 'cornerstoneMath',
// 'cornerstone-tools': 'cornerstoneTools',
// dcmjs: 'dcmjs',
// 'dicom-parser': 'dicomParser',
// 'ohif-core': 'OHIF',
// hammerjs: 'Hammer',
// '@ohif/i18n': 'i18n',
// };
export default {
input: 'src/index.js',
output: [
{
file: pkg.main,
format: 'umd',
name: 'ohif-vtk-extension',
sourcemap: true,
// globals,
},
{
file: pkg.module,
format: 'es',
sourcemap: true,
// globals,
},
],
plugins: [
builtins(),
external(),
postcss({
modules: false,
}),
url(),
babel({
exclude: 'node_modules/**',
externalHelpers: true,
runtimeHelpers: true,
}),
copy({
targets: ['src/locales'],
outputFolder: 'dist',
}),
resolve(),
commonjs({
include: ['node_modules/**'],
namedExports: {
'node_modules/react-vtkjs-viewport/dist/index.js': [
'getImageData',
'loadImageData',
'VTKViewport',
'VTKMPRViewport',
],
},
}),
],
external: Object.keys(pkg.peerDependencies || {}),
};
+7 -7
View File
@@ -1,6 +1,6 @@
import OHIF from 'ohif-core'; import OHIF from "@ohif/core";
import { View2D } from 'react-vtkjs-viewport'; import { View2D } from "react-vtkjs-viewport";
import { connect } from 'react-redux'; import { connect } from "react-redux";
const { setViewportActive, setViewportSpecificData } = OHIF.redux.actions; const { setViewportActive, setViewportSpecificData } = OHIF.redux.actions;
@@ -24,7 +24,7 @@ const mapStateToProps = (state, ownProps) => {
// Hopefully this doesn't break anything under the hood for this one // Hopefully this doesn't break anything under the hood for this one
// activeTool: activeButton && activeButton.command, // activeTool: activeButton && activeButton.command,
...dataFromStore, ...dataFromStore,
enableStackPrefetch: isActive, enableStackPrefetch: isActive
}; };
}; };
@@ -38,7 +38,7 @@ const mapDispatchToProps = (dispatch, ownProps) => {
setViewportSpecificData: data => { setViewportSpecificData: data => {
dispatch(setViewportSpecificData(viewportIndex, data)); dispatch(setViewportSpecificData(viewportIndex, data));
}, }
}; };
}; };
@@ -63,10 +63,10 @@ const mergeProps = (propsFromState, propsFromDispatch, ownProps) => {
// Store the API details for later // Store the API details for later
//setViewportSpecificData({ vtkApi: api }); //setViewportSpecificData({ vtkApi: api });
if (afterCreation && typeof afterCreation === 'function') { if (afterCreation && typeof afterCreation === "function") {
afterCreation(api); afterCreation(api);
} }
}, }
}; };
return props; return props;
}; };
+29 -29
View File
@@ -1,16 +1,16 @@
import React, { Component } from 'react'; import React, { Component } from "react";
import { getImageData, loadImageData } from 'react-vtkjs-viewport'; import { getImageData, loadImageData } from "react-vtkjs-viewport";
import ConnectedVTKViewport from './ConnectedVTKViewport'; import ConnectedVTKViewport from "./ConnectedVTKViewport";
import LoadingIndicator from './LoadingIndicator.js'; import LoadingIndicator from "./LoadingIndicator.js";
import OHIF from 'ohif-core'; import OHIF from "@ohif/core";
import PropTypes from 'prop-types'; import PropTypes from "prop-types";
import cornerstone from 'cornerstone-core'; import cornerstone from "cornerstone-core";
import handleSegmentationStorage from './handleSegmentationStorage.js'; import handleSegmentationStorage from "./handleSegmentationStorage.js";
import vtkDataArray from 'vtk.js/Sources/Common/Core/DataArray'; import vtkDataArray from "vtk.js/Sources/Common/Core/DataArray";
import vtkImageData from 'vtk.js/Sources/Common/DataModel/ImageData'; import vtkImageData from "vtk.js/Sources/Common/DataModel/ImageData";
import vtkVolume from 'vtk.js/Sources/Rendering/Core/Volume'; import vtkVolume from "vtk.js/Sources/Rendering/Core/Volume";
import vtkVolumeMapper from 'vtk.js/Sources/Rendering/Core/VolumeMapper'; import vtkVolumeMapper from "vtk.js/Sources/Rendering/Core/VolumeMapper";
const { StackManager } = OHIF.utils; const { StackManager } = OHIF.utils;
@@ -24,7 +24,7 @@ cornerstone.metaData.addProvider(
StackManager.setMetadataProvider(metadataProvider); StackManager.setMetadataProvider(metadataProvider);
const SOP_CLASSES = { const SOP_CLASSES = {
SEGMENTATION_STORAGE: '1.2.840.10008.5.1.4.1.1.66.4', SEGMENTATION_STORAGE: "1.2.840.10008.5.1.4.1.1.66.4"
}; };
const specialCaseHandlers = {}; const specialCaseHandlers = {};
@@ -42,7 +42,7 @@ const volumeCache = {};
*/ */
function createLabelMapImageData(backgroundImageData) { function createLabelMapImageData(backgroundImageData) {
const labelMapData = vtkImageData.newInstance( const labelMapData = vtkImageData.newInstance(
backgroundImageData.get('spacing', 'origin', 'direction') backgroundImageData.get("spacing", "origin", "direction")
); );
labelMapData.setDimensions(backgroundImageData.getDimensions()); labelMapData.setDimensions(backgroundImageData.getDimensions());
labelMapData.computeTransforms(); labelMapData.computeTransforms();
@@ -50,7 +50,7 @@ function createLabelMapImageData(backgroundImageData) {
const values = new Uint8Array(backgroundImageData.getNumberOfPoints()); const values = new Uint8Array(backgroundImageData.getNumberOfPoints());
const dataArray = vtkDataArray.newInstance({ const dataArray = vtkDataArray.newInstance({
numberOfComponents: 1, // labelmap with single component numberOfComponents: 1, // labelmap with single component
values, values
}); });
labelMapData.getPointData().setScalars(dataArray); labelMapData.getPointData().setScalars(dataArray);
@@ -61,24 +61,24 @@ class OHIFVTKViewport extends Component {
state = { state = {
volumes: null, volumes: null,
paintFilterLabelMapImageData: null, paintFilterLabelMapImageData: null,
paintFilterBackgroundImageData: null, paintFilterBackgroundImageData: null
}; };
static propTypes = { static propTypes = {
studies: PropTypes.object, studies: PropTypes.object,
displaySet: PropTypes.object, displaySet: PropTypes.object,
viewportIndex: PropTypes.number, viewportIndex: PropTypes.number,
children: PropTypes.node, children: PropTypes.node
}; };
static id = 'OHIFVTKViewport'; static id = "OHIFVTKViewport";
static init() { static init() {
console.log('OHIFVTKViewport init()'); console.log("OHIFVTKViewport init()");
} }
static destroy() { static destroy() {
console.log('OHIFVTKViewport destroy()'); console.log("OHIFVTKViewport destroy()");
StackManager.clearStacks(); StackManager.clearStacks();
} }
@@ -109,7 +109,7 @@ class OHIFVTKViewport extends Component {
} else if (sopInstanceUid) { } else if (sopInstanceUid) {
const index = stack.imageIds.findIndex(imageId => { const index = stack.imageIds.findIndex(imageId => {
const sopCommonModule = cornerstone.metaData.get( const sopCommonModule = cornerstone.metaData.get(
'sopCommonModule', "sopCommonModule",
imageId imageId
); );
if (!sopCommonModule) { if (!sopCommonModule) {
@@ -151,7 +151,7 @@ class OHIFVTKViewport extends Component {
switch (sopClassUid) { switch (sopClassUid) {
case SOP_CLASSES.SEGMENTATION_STORAGE: case SOP_CLASSES.SEGMENTATION_STORAGE:
throw new Error('Not yet implemented'); throw new Error("Not yet implemented");
const data = handleSegmentationStorage( const data = handleSegmentationStorage(
stack.imageIds, stack.imageIds,
@@ -164,7 +164,7 @@ class OHIFVTKViewport extends Component {
return loadImageData(imageDataObject).then(() => { return loadImageData(imageDataObject).then(() => {
return { return {
data: imageDataObject.vtkImageData, data: imageDataObject.vtkImageData,
labelmap: labelmapDataObject, labelmap: labelmapDataObject
}; };
}); });
default: default:
@@ -172,7 +172,7 @@ class OHIFVTKViewport extends Component {
return loadImageData(imageDataObject).then(() => { return loadImageData(imageDataObject).then(() => {
return { return {
data: imageDataObject.vtkImageData, data: imageDataObject.vtkImageData
}; };
}); });
} }
@@ -201,12 +201,12 @@ class OHIFVTKViewport extends Component {
displaySetInstanceUid, displaySetInstanceUid,
sopClassUids, sopClassUids,
sopInstanceUid, sopInstanceUid,
frameIndex, frameIndex
} = displaySet; } = displaySet;
if (sopClassUids.length > 1) { if (sopClassUids.length > 1) {
console.warn( console.warn(
'More than one SOPClassUid in the same series is not yet supported.' "More than one SOPClassUid in the same series is not yet supported."
); );
} }
@@ -230,7 +230,7 @@ class OHIFVTKViewport extends Component {
this.setState({ this.setState({
volumes: [volumeActor], volumes: [volumeActor],
paintFilterBackgroundImageData: data, paintFilterBackgroundImageData: data,
paintFilterLabelMapImageData: labelmap, paintFilterLabelMapImageData: labelmap
}); });
} }
@@ -260,12 +260,12 @@ class OHIFVTKViewport extends Component {
childrenWithProps = this.props.children.map((child, index) => { childrenWithProps = this.props.children.map((child, index) => {
return React.cloneElement(child, { return React.cloneElement(child, {
viewportIndex: this.props.viewportIndex, viewportIndex: this.props.viewportIndex,
key: index, key: index
}); });
}); });
} }
const style = { width: '100%', height: '100%', position: 'relative' }; const style = { width: "100%", height: "100%", position: "relative" };
return ( return (
<> <>
@@ -1,7 +1,7 @@
import * as dcmjs from 'dcmjs'; import * as dcmjs from "dcmjs";
import OHIF from 'ohif-core'; import OHIF from "@ohif/core";
import { api } from 'dicomweb-client'; import { api } from "dicomweb-client";
const { StackManager } = OHIF.utils; const { StackManager } = OHIF.utils;
@@ -57,14 +57,14 @@ function retrieveDicomData(
) { ) {
const config = { const config = {
url: wadoRoot, url: wadoRoot,
headers: DICOMWeb.getAuthorizationHeader(), headers: DICOMWeb.getAuthorizationHeader()
}; };
const dicomWeb = new api.DICOMwebClient(config); const dicomWeb = new api.DICOMwebClient(config);
const options = { const options = {
studyInstanceUID, studyInstanceUID,
seriesInstanceUID, seriesInstanceUID,
sopInstanceUID, sopInstanceUID
}; };
return dicomWeb.retrieveInstance(options); return dicomWeb.retrieveInstance(options);
@@ -117,7 +117,7 @@ async function handleSegmentationStorage(
if (displaySets.length > 1) { if (displaySets.length > 1) {
console.warn( console.warn(
'More than one display set with the same seriesInstanceUid. This is not supported yet...' "More than one display set with the same seriesInstanceUid. This is not supported yet..."
); );
} }
@@ -125,7 +125,7 @@ async function handleSegmentationStorage(
const imageIds = referenceDisplaySet.images.map(image => image.getImageId()); const imageIds = referenceDisplaySet.images.map(image => image.getImageId());
if (!results) { if (!results) {
throw new Error('Fractional segmentations are not supported'); throw new Error("Fractional segmentations are not supported");
} }
const cachedStack = StackManager.findOrCreateStack( const cachedStack = StackManager.findOrCreateStack(
@@ -137,13 +137,13 @@ async function handleSegmentationStorage(
return { return {
referenceDataObject, referenceDataObject,
labelmapDataObject, labelmapDataObject
}; };
return { return {
studyInstanceUid, studyInstanceUid,
displaySetInstanceUid, displaySetInstanceUid,
stack, stack
}; };
} }
@@ -1,4 +1,4 @@
import { redux } from 'ohif-core'; import { redux } from "@ohif/core";
const { setViewportLayoutAndData } = redux.actions; const { setViewportLayoutAndData } = redux.actions;
+42 -42
View File
@@ -1,26 +1,26 @@
const path = require('path'); const path = require("path");
const webpack = require('webpack'); const webpack = require("webpack");
const autoprefixer = require('autoprefixer'); const autoprefixer = require("autoprefixer");
// const vtkHtmlRules = require('vtk.js/Utilities/config/dependency.js').webpack // const vtkHtmlRules = require('vtk.js/Utilities/config/dependency.js').webpack
// .core.rules; // .core.rules;
// Optional if you want to load *.css and *.module.css files // Optional if you want to load *.css and *.module.css files
// var cssRules = require('vtk.js/Utilities/config/dependency.js').webpack.css.rules; // var cssRules = require('vtk.js/Utilities/config/dependency.js').webpack.css.rules;
const SRC_DIR = path.join(__dirname, './src'); const SRC_DIR = path.join(__dirname, "./src");
const OUTPUT_DIR = path.join(__dirname, './dist'); const OUTPUT_DIR = path.join(__dirname, "./dist");
module.exports = { module.exports = {
mode: 'development', mode: "development",
entry: { entry: {
app: `${SRC_DIR}/index.js`, app: `${SRC_DIR}/index.js`
}, },
context: SRC_DIR, context: SRC_DIR,
// ~~~ MODE // ~~~ MODE
output: { output: {
path: OUTPUT_DIR, path: OUTPUT_DIR,
library: 'ohifVtkExtension', library: "ohifVtkExtension",
libraryTarget: 'umd', libraryTarget: "umd",
filename: 'index.umd.js', filename: "index.umd.js",
auxiliaryComment: 'Text VTK Extension Comment', auxiliaryComment: "Text VTK Extension Comment"
}, },
stats: { stats: {
colors: true, colors: true,
@@ -31,43 +31,43 @@ module.exports = {
chunkModules: true, chunkModules: true,
modules: true, modules: true,
children: true, children: true,
warnings: true, warnings: true
}, },
optimization: { optimization: {
minimize: false, minimize: false,
sideEffects: true, sideEffects: true
}, },
// ~~~ END MODE // ~~~ END MODE
resolve: { resolve: {
modules: [ modules: [
path.resolve(__dirname, 'node_modules'), path.resolve(__dirname, "node_modules"),
path.resolve(__dirname, '../../node_modules'), path.resolve(__dirname, "../../node_modules"),
SRC_DIR, SRC_DIR
], ],
extensions: ['.js', '.jsx', '.json', '*'], extensions: [".js", ".jsx", ".json", "*"],
symlinks: true, symlinks: true
}, },
module: { module: {
rules: [ rules: [
{ {
test: /\.(js|jsx)$/, test: /\.(js|jsx)$/,
exclude: [/node_modules/], exclude: [/node_modules/],
loader: 'babel-loader', loader: "babel-loader",
options: { options: {
// Find babel.config.js in monorepo root // Find babel.config.js in monorepo root
// https://babeljs.io/docs/en/options#rootmode // https://babeljs.io/docs/en/options#rootmode
rootMode: 'upward', rootMode: "upward",
presets: [ presets: [
[ [
'@babel/preset-env', "@babel/preset-env",
{ {
// Do not transform ES6 modules to another format. // Do not transform ES6 modules to another format.
// Webpack will take care of that. // Webpack will take care of that.
modules: false, modules: false
}, }
], ]
], ]
}, }
}, },
/** /**
* *
@@ -76,15 +76,15 @@ module.exports = {
test: /\.css$/, test: /\.css$/,
exclude: /\.module\.css$/, exclude: /\.module\.css$/,
use: [ use: [
'style-loader', "style-loader",
'css-loader', "css-loader",
{ {
loader: 'postcss-loader', loader: "postcss-loader",
options: { options: {
plugins: () => [autoprefixer('last 2 version', 'ie >= 10')], plugins: () => [autoprefixer("last 2 version", "ie >= 10")]
}, }
}, }
], ]
}, },
/** /**
* *
@@ -92,7 +92,7 @@ module.exports = {
{ {
test: /\.glsl$/i, test: /\.glsl$/i,
include: /vtk\.js[\/\\]Sources/, include: /vtk\.js[\/\\]Sources/,
loader: 'shader-loader', loader: "shader-loader"
}, },
/** /**
* *
@@ -102,13 +102,13 @@ module.exports = {
include: /vtk\.js[\/\\]Sources/, include: /vtk\.js[\/\\]Sources/,
use: [ use: [
{ {
loader: 'worker-loader', loader: "worker-loader",
options: { inline: true, fallback: false }, options: { inline: true, fallback: false }
}, }
], ]
}, }
], ]
}, }
// externals: [ // externals: [
// { // {
// cornerstone: { // cornerstone: {
@@ -125,7 +125,7 @@ module.exports = {
// }, // },
// }, // },
// '@ohif/i18n', // '@ohif/i18n',
// 'ohif-core', // '@ohif/core',
// 'dcmjs', // 'dcmjs',
// 'react-viewerbase', // 'react-viewerbase',
// 'react', //: 'React', // 'react', //: 'React',
+1
View File
@@ -10,6 +10,7 @@
}, },
"version": { "version": {
"conventionalCommits": true, "conventionalCommits": true,
"createRelease": "github",
"yes": true, "yes": true,
"message": "chore(release): publish %s [skip ci]" "message": "chore(release): publish %s [skip ci]"
} }
+18
View File
@@ -0,0 +1,18 @@
## Notes
### Helpful Commands
These commands are less frequently used, but good to remember:
```bash
# Add shared dev dependency for workspace
yarn add --dev -W package-name
```
## TODO
- Patch status for PRs (we care about threshold only)
- Allows us to use multiproject test runner
- Flags per project for merged coverage; easier to break down coverage per project
- Remove all-contributors bot; install CLI per project and add per project commands
-
+14 -7
View File
@@ -12,13 +12,15 @@
}, },
"scripts": { "scripts": {
"cm": "npx git-cz", "cm": "npx git-cz",
"start": "lerna run lerna:start --parallel", "dev": ".scripts/dev.sh",
"build": "lerna run build:viewer",
"build:package": "lerna run build:package --parallel", "build:package": "lerna run build:package --parallel",
"test": "yarn run test:unit && yarn run test:e2e:ci",
"test:unit": "jest --collectCoverage", "test:unit": "jest --collectCoverage",
"test:unit:ci": "lerna run test:unit:ci --parallel", "test:unit:ci": "lerna run test:unit:ci --parallel",
"test:e2e:ci": "cd platform/viewer && yarn run test:e2e:ci", "test:e2e:ci": "cd platform/viewer && yarn run test:e2e:ci",
"new-version": "lerna version --conventional-commits --yes", "see-changed": "lerna changed",
"build:pwa:ci": "" "release": "npx lerna version prerelease --force-publish && lerna publish --canary --dist-tag canary"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.5.0", "@babel/core": "^7.5.0",
@@ -28,18 +30,22 @@
"@babel/plugin-transform-runtime": "^7.5.0", "@babel/plugin-transform-runtime": "^7.5.0",
"@babel/preset-env": "^7.5.0", "@babel/preset-env": "^7.5.0",
"@babel/preset-react": "^7.0.0", "@babel/preset-react": "^7.0.0",
"babel-eslint": "^10.0.2", "babel-eslint": "9.x",
"babel-loader": "^8.0.6", "babel-loader": "^8.0.6",
"babel-plugin-inline-react-svg": "1.1.0", "babel-plugin-inline-react-svg": "1.1.0",
"babel-plugin-module-resolver": "^3.2.0", "babel-plugin-module-resolver": "^3.2.0",
"copy-webpack-plugin": "^5.0.3", "copy-webpack-plugin": "^5.0.3",
"cross-env": "^5.2.0", "cross-env": "^5.2.0",
"css-loader": "^3.0.0", "css-loader": "^3.0.0",
"eslint": "^6.0.1", "eslint": "5.16.0",
"eslint-plugin-import": "^2.18.0", "eslint-config-react-app": "^4.0.1",
"eslint-plugin-flowtype": "2.x",
"eslint-plugin-import": "2.x",
"eslint-plugin-jsx-a11y": "6.x",
"eslint-plugin-node": "^9.1.0", "eslint-plugin-node": "^9.1.0",
"eslint-plugin-promise": "^4.2.1", "eslint-plugin-promise": "^4.2.1",
"eslint-plugin-react": "^7.14.2", "eslint-plugin-react": "7.x",
"eslint-plugin-react-hooks": "1.5.0",
"extract-css-chunks-webpack-plugin": "^4.5.4", "extract-css-chunks-webpack-plugin": "^4.5.4",
"html-webpack-plugin": "^3.2.0", "html-webpack-plugin": "^3.2.0",
"husky": "^3.0.0", "husky": "^3.0.0",
@@ -55,6 +61,7 @@
"react": "^16.8.6", "react": "^16.8.6",
"react-dom": "^16.8.6", "react-dom": "^16.8.6",
"react-scripts": "^3.0.1", "react-scripts": "^3.0.1",
"redux-testkit": "^1.0.6",
"shader-loader": "^1.3.1", "shader-loader": "^1.3.1",
"stylelint": "^10.1.0", "stylelint": "^10.1.0",
"stylelint-config-recommended": "^2.2.0", "stylelint-config-recommended": "^2.2.0",
-2
View File
@@ -1,2 +0,0 @@
fixes:
- "::platform/core/"
-27
View File
@@ -1,27 +0,0 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.
# dependencies
node_modules
# builds
build
dist
.rpt2_cache
coverage/
junit.xml
# misc
.DS_Store
.env
.env.local
.env.development.local
.env.test.local
.env.production.local
package-lock.json
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.idea
.yalc
yalc.lock
+46 -2
View File
@@ -1,7 +1,51 @@
# Change Log # Change Log
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file. See
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.11.1-alpha.6](https://github.com/OHIF/Viewers/compare/@ohif/core@0.11.1-alpha.5...@ohif/core@0.11.1-alpha.6) (2019-08-08)
**Note:** Version bump only for package @ohif/core
# Change Log
All notable changes to this project will be documented in this file. See
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.11.1-alpha.5](https://github.com/OHIF/Viewers/compare/@ohif/core@0.11.1-alpha.4...@ohif/core@0.11.1-alpha.5) (2019-08-08)
**Note:** Version bump only for package @ohif/core
# Change Log
All notable changes to this project will be documented in this file. See
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.11.1-alpha.4](https://github.com/OHIF/Viewers/compare/@ohif/core@0.11.1-alpha.3...@ohif/core@0.11.1-alpha.4) (2019-08-08)
**Note:** Version bump only for package @ohif/core
# Change Log
All notable changes to this project will be documented in this file. See
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.11.1-alpha.3](https://github.com/OHIF/Viewers/compare/@ohif/core@0.11.1-alpha.2...@ohif/core@0.11.1-alpha.3) (2019-08-08)
**Note:** Version bump only for package @ohif/core
# Change Log
All notable changes to this project will be documented in this file. See
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.11.1-alpha.2](https://github.com/OHIF/Viewers/compare/@ohif/core@0.11.1-alpha.1...@ohif/core@0.11.1-alpha.2) (2019-08-07)
**Note:** Version bump only for package @ohif/core
## [0.11.1-alpha.1](https://github.com/OHIF/Viewers/compare/@ohif/core@0.11.1-alpha.0...@ohif/core@0.11.1-alpha.1) (2019-08-07)
**Note:** Version bump only for package @ohif/core
## 0.11.1-alpha.0 (2019-08-05) ## 0.11.1-alpha.0 (2019-08-05)
+11 -55
View File
@@ -1,20 +1,15 @@
<!-- prettier-ignore-start --> <!-- prettier-ignore-start -->
<!-- markdownlint-disable --> <!-- markdownlint-disable -->
<div align="center"> <div align="center">
<h1>ohif-core</h1> <h1>@ohif/core</h1>
<p><strong>ohif-core</strong> is a collection of useful functions and classes for building web-based medical imaging applications. This library helps power OHIF's <a href="https://github.com/OHIF/Viewers">zero-footprint DICOM viewer</a>.</p> <p><strong>@ohif/core</strong> is a collection of useful functions and classes for building web-based medical imaging applications. This library helps power OHIF's <a href="https://github.com/OHIF/Viewers">zero-footprint DICOM viewer</a>.</p>
</div> </div>
<hr /> <hr />
[![CircleCI][circleci-image]][circleci-url]
[![codecov][codecov-image]][codecov-url]
[![All Contributors](https://img.shields.io/badge/all_contributors-6-orange.svg?style=flat-square)](#contributors)
[![code style: prettier][prettier-image]][prettier-url]
[![semantic-release][semantic-image]][semantic-url]
[![NPM version][npm-version-image]][npm-url] [![NPM version][npm-version-image]][npm-url]
[![NPM downloads][npm-downloads-image]][npm-url] [![NPM downloads][npm-downloads-image]][npm-url]
[![All Contributors](https://img.shields.io/badge/all_contributors-6-orange.svg?style=flat-square)](#contributors)
[![MIT License][license-image]][license-url] [![MIT License][license-image]][license-url]
<!-- markdownlint-enable --> <!-- markdownlint-enable -->
<!-- prettier-ignore-end --> <!-- prettier-ignore-end -->
@@ -53,10 +48,10 @@ implementation][react-viewer].
``` ```
// with npm // with npm
npm i ohif-core --save-exact npm i @ohif/core --save-exact
// with yarn // with yarn
yarn add ohif-core --exact yarn add @ohif/core --exact
``` ```
### Usage ### Usage
@@ -67,13 +62,13 @@ Usage is dependent on the feature(s) you want to leverage. The bulk of
_Example: retrieving study metadata from a server_ _Example: retrieving study metadata from a server_
```js ```js
import { studies } from 'ohif-core' import { studies } from "@ohif/core";
const studiesMetadata = await studies.retrieveStudiesMetadata( const studiesMetadata = await studies.retrieveStudiesMetadata(
server, // Object server, // Object
studyInstanceUids, // Array studyInstanceUids, // Array
seriesInstanceUids // Array (optional) seriesInstanceUids // Array (optional)
) );
``` ```
### Contributing ### Contributing
@@ -94,10 +89,10 @@ When creating tests, place the test file "next to" the file you're testing.
```js ```js
// File // File
index.js index.js;
// Test for file // Test for file
index.test.js index.test.js;
``` ```
As you add and modify code, `jest` will watch for uncommitted changes and run As you add and modify code, `jest` will watch for uncommitted changes and run
@@ -105,31 +100,6 @@ your tests, reporting the results to your terminal. Make a pull request with
your changes to `master`, and a core team member will review your work. If you your changes to `master`, and a core team member will review your work. If you
have any questions, please don't hesitate to reach out via a GitHub issue. have any questions, please don't hesitate to reach out via a GitHub issue.
## Issues
_Looking to contribute? Look for the [Good First Issue][good-first-issue]
label._
### 🐛 Bugs
Please file an issue for bugs, missing documentation, or unexpected behavior.
[**See Bugs**][bugs]
### 💡 Feature Requests
Please file an issue to suggest new features. Vote on feature requests by adding
a 👍. This helps maintainers prioritize what to work on.
[**See Feature Requests**][requests-feature]
### ❓ Questions
For questions related to using the library, please visit our support community,
or file an issue on GitHub.
[Google Group][google-group]
## Contributors ## Contributors
Thanks goes to these wonderful people Thanks goes to these wonderful people
@@ -155,27 +125,13 @@ Links:
<!-- prettier-ignore-start --> <!-- prettier-ignore-start -->
<!-- ROW --> <!-- ROW -->
[all-contributors-image]: https://img.shields.io/badge/all_contributors-0-orange.svg?style=flat-square
[contributing-url]: https://github.com/OHIF/ohif-core/blob/master/CONTRIBUTING.md
[circleci-image]: https://circleci.com/gh/OHIF/ohif-core.svg?style=svg
[circleci-url]: https://circleci.com/gh/OHIF/ohif-core
[codecov-image]: https://codecov.io/gh/OHIF/ohif-core/branch/master/graph/badge.svg
[codecov-url]: https://codecov.io/gh/OHIF/ohif-core
[prettier-image]: https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square
[prettier-url]: https://github.com/prettier/prettier
[semantic-image]: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg
[semantic-url]: https://github.com/semantic-release/semantic-release
<!-- ROW -->
[npm-url]: https://npmjs.org/package/ohif-core [npm-url]: https://npmjs.org/package/ohif-core
[npm-downloads-image]: https://img.shields.io/npm/dm/ohif-core.svg?style=flat-square [npm-downloads-image]: https://img.shields.io/npm/dm/ohif-core.svg?style=flat-square
[npm-version-image]: https://img.shields.io/npm/v/ohif-core.svg?style=flat-square [npm-version-image]: https://img.shields.io/npm/v/ohif-core.svg?style=flat-square
[all-contributors-image]: https://img.shields.io/badge/all_contributors-0-orange.svg?style=flat-square
[contributing-url]: https://github.com/OHIF/ohif-core/blob/master/CONTRIBUTING.md
[license-image]: https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square [license-image]: https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square
[license-url]: LICENSE [license-url]: LICENSE
<!-- Misc. --> <!-- Misc. -->
[react-viewer]: https://github.com/OHIF/Viewers/tree/react [react-viewer]: https://github.com/OHIF/Viewers/tree/react
<!-- Issue Boilerplate -->
[bugs]: https://github.com/OHIF/ohif-core/labels/bug
[requests-feature]: https://github.com/OHIF/ohif-core/labels/enhancement
[good-first-issue]: https://github.com/OHIF/ohif-core/labels/good%20first%20issue
[google-group]: https://groups.google.com/forum/#!forum/cornerstone-platform
<!-- prettier-ignore-end --> <!-- prettier-ignore-end -->
+12 -46
View File
@@ -1,8 +1,8 @@
{ {
"name": "@ohif/core", "name": "@ohif/core",
"version": "0.11.1-alpha.0", "version": "0.11.1-alpha.6",
"description": "Useful functions and classes for building web-based medical imaging applications", "description": "Generic business logic for web-based medical imaging applications",
"author": "OHIF Contributors", "author": "OHIF Core Team",
"license": "MIT", "license": "MIT",
"repository": "OHIF/Viewers", "repository": "OHIF/Viewers",
"main": "dist/index.umd.js", "main": "dist/index.umd.js",
@@ -16,14 +16,15 @@
"npm": ">=5" "npm": ">=5"
}, },
"scripts": { "scripts": {
"start": "yarn run dev",
"dev": "jest --watch",
"dev:core": "yarn run dev",
"test:unit": "jest --watch", "test:unit": "jest --watch",
"test:unit:ci": "jest --ci --runInBand --collectCoverage", "test:unit:ci": "jest --ci --runInBand --collectCoverage",
"build": "rollup -c", "build": "webpack --config config/webpack.prod.js -d",
"lerna:build": "webpack --config config/webpack.prod.js -w -d", "build:package": "yarn run build",
"dev": "jest --watch",
"start": "rollup -c -w",
"lint": "eslint -c .eslintrc --fix src && prettier --single-quote --write src/**/*.{js,jsx,json,css}", "lint": "eslint -c .eslintrc --fix src && prettier --single-quote --write src/**/*.{js,jsx,json,css}",
"prepublishOnly": "npm run build" "prepublishOnly": "yarn run build"
}, },
"peerDependencies": { "peerDependencies": {
"cornerstone-core": "^2.2.8", "cornerstone-core": "^2.2.8",
@@ -41,44 +42,9 @@
"mousetrap": "^1.6.3", "mousetrap": "^1.6.3",
"validate.js": "^0.12.0" "validate.js": "^0.12.0"
}, },
"devDependencies": {
"@svgr/rollup": "^4.1.0",
"babel-eslint": "10.0.1",
"babel-jest": "^24.7.1",
"commitizen": "3.1.x",
"cross-env": "^5.2.0",
"cz-conventional-changelog": "2.1.x",
"eslint": "5.13.0",
"eslint-config-prettier": "^4.3.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-node": "^8.0.0",
"eslint-plugin-prettier": "^3.1.0",
"eslint-plugin-promise": "^4.0.1",
"husky": "^1.2.1",
"jest": "^24.7.1",
"jest-junit": "^6.3.0",
"lint-staged": "^8.1.0",
"prettier": "^1.15.3",
"redux-testkit": "^1.0.6",
"rollup": "^1.1.2",
"rollup-plugin-babel": "^4.1.0",
"rollup-plugin-commonjs": "^9.2.0",
"rollup-plugin-json": "^4.0.0",
"rollup-plugin-node-resolve": "^4.0.0",
"rollup-plugin-peer-deps-external": "^2.2.0",
"rollup-plugin-postcss": "^2.0.3",
"rollup-plugin-url": "^2.1.0",
"semantic-release": "15.13.x",
"stylelint": "^9.9.0",
"stylelint-config-recommended": "^2.1.0",
"stylus": "^0.54.5"
},
"files": [ "files": [
"dist" "dist",
"README.md"
], ],
"config": { "gitHead": "a5baa9228c0eda0df880136bde4420d78e6f8706"
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
}
} }
-64
View File
@@ -1,64 +0,0 @@
import babel from 'rollup-plugin-babel'
import commonjs from 'rollup-plugin-commonjs'
import external from 'rollup-plugin-peer-deps-external'
import postcss from 'rollup-plugin-postcss'
import resolve from 'rollup-plugin-node-resolve'
import url from 'rollup-plugin-url'
import json from 'rollup-plugin-json'
import svgr from '@svgr/rollup'
import pkg from './package.json'
const globals = {
'react': 'React',
'react-dom': 'ReactDOM',
'cornerstone-core': 'cornerstone',
'cornerstone-math': 'cornerstoneMath',
'cornerstone-tools': 'cornerstoneTools',
'cornerstone-wado-image-loader': 'cornerstoneWADOImageLoader',
'dicom-parser': 'dicomParser'
};
export default {
input: 'src/index.js',
output: [
{
file: pkg.main,
format: 'umd',
name: 'OHIF',
sourcemap: true,
exports: 'named',
globals
},
{
file: pkg.module,
format: 'es',
sourcemap: true,
exports: 'named',
globals
},
],
plugins: [
external(),
postcss({
modules: false
}),
url(),
json(),
svgr(),
babel({
exclude: 'node_modules/**',
externalHelpers: false,
runtimeHelpers: true
}),
resolve(),
commonjs({
include: 'node_modules/**',
namedExports: {
'node_modules/dicomweb-client/build/dicomweb-client.js': [
'api'
]
}
}),
],
external: Object.keys(pkg.peerDependencies || {}),
}
-2
View File
@@ -1,2 +0,0 @@
fixes:
- "::platform/i18n/"
-29
View File
@@ -1,29 +0,0 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.
# dependencies
node_modules
# builds
build
dist
.rpt2_cache
# misc
.DS_Store
.env
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.idea
yalc.lock
.yalc
# Note: DO NOT include this file because it includes our API key
.locize
+46 -2
View File
@@ -1,7 +1,51 @@
# Change Log # Change Log
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file. See
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.2.3-alpha.6](https://github.com/OHIF/Viewers/compare/@ohif/i18n@0.2.3-alpha.5...@ohif/i18n@0.2.3-alpha.6) (2019-08-08)
**Note:** Version bump only for package @ohif/i18n
# Change Log
All notable changes to this project will be documented in this file. See
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.2.3-alpha.5](https://github.com/OHIF/Viewers/compare/@ohif/i18n@0.2.3-alpha.4...@ohif/i18n@0.2.3-alpha.5) (2019-08-08)
**Note:** Version bump only for package @ohif/i18n
# Change Log
All notable changes to this project will be documented in this file. See
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.2.3-alpha.4](https://github.com/OHIF/Viewers/compare/@ohif/i18n@0.2.3-alpha.3...@ohif/i18n@0.2.3-alpha.4) (2019-08-08)
**Note:** Version bump only for package @ohif/i18n
# Change Log
All notable changes to this project will be documented in this file. See
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.2.3-alpha.3](https://github.com/OHIF/Viewers/compare/@ohif/i18n@0.2.3-alpha.2...@ohif/i18n@0.2.3-alpha.3) (2019-08-08)
**Note:** Version bump only for package @ohif/i18n
# Change Log
All notable changes to this project will be documented in this file. See
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.2.3-alpha.2](https://github.com/OHIF/Viewers/compare/@ohif/i18n@0.2.3-alpha.1...@ohif/i18n@0.2.3-alpha.2) (2019-08-07)
**Note:** Version bump only for package @ohif/i18n
## [0.2.3-alpha.1](https://github.com/OHIF/Viewers/compare/@ohif/i18n@0.2.3-alpha.0...@ohif/i18n@0.2.3-alpha.1) (2019-08-07)
**Note:** Version bump only for package @ohif/i18n
## 0.2.3-alpha.0 (2019-08-05) ## 0.2.3-alpha.0 (2019-08-05)
+11 -7
View File
@@ -1,7 +1,7 @@
{ {
"name": "@ohif/i18n", "name": "@ohif/i18n",
"version": "0.2.3-alpha.0", "version": "0.2.3-alpha.6",
"description": "OHIF extension for internationalization", "description": "Internationalization library for The OHIF Viewer",
"author": "OHIF", "author": "OHIF",
"license": "MIT", "license": "MIT",
"repository": "OHIF/Viewers", "repository": "OHIF/Viewers",
@@ -12,7 +12,8 @@
"npm": ">=5" "npm": ">=5"
}, },
"files": [ "files": [
"dist" "dist",
"README.md"
], ],
"publishConfig": { "publishConfig": {
"access": "public" "access": "public"
@@ -20,9 +21,11 @@
"scripts": { "scripts": {
"test:unit": "echo 'platform/i18n: missing unit tests'", "test:unit": "echo 'platform/i18n: missing unit tests'",
"test:unit:ci": "echo 'platform/i18n: missing unit tests'", "test:unit:ci": "echo 'platform/i18n: missing unit tests'",
"build": "rollup -c", "dev": "webpack --config config/webpack.prod.js -w -d",
"lerna:build": "webpack --config config/webpack.prod.js -w -d", "dev:i18n": "yarn run dev",
"prepublishOnly": "npm run build", "prepublishOnly": "yarn run build",
"build": "webpack --config config/webpack.prod.js -d",
"build:package": "yarn run build",
"pullTranslations": "./pullTranslations.sh" "pullTranslations": "./pullTranslations.sh"
}, },
"peerDependencies": { "peerDependencies": {
@@ -45,5 +48,6 @@
"i18next-browser-languagedetector": "^3.0.1", "i18next-browser-languagedetector": "^3.0.1",
"locize-cli": "^4.8.0", "locize-cli": "^4.8.0",
"react-i18next": "^10.11.0" "react-i18next": "^10.11.0"
} },
"gitHead": "a5baa9228c0eda0df880136bde4420d78e6f8706"
} }
-67
View File
@@ -1,67 +0,0 @@
import babel from 'rollup-plugin-babel';
import commonjs from 'rollup-plugin-commonjs';
import external from 'rollup-plugin-peer-deps-external';
import postcss from 'rollup-plugin-postcss';
import resolve from 'rollup-plugin-node-resolve';
import url from 'rollup-plugin-url';
import pkg from './package.json';
// Deal with https://github.com/rollup/rollup-plugin-commonjs/issues/297
import builtins from 'rollup-plugin-node-builtins';
import json from 'rollup-plugin-json';
const globals = {
react: 'React',
'react-dom': 'ReactDOM',
'react-redux': 'ReactRedux',
'react-resize-detector': 'ReactResizeDetector',
'prop-types': 'PropTypes',
i18next: 'i18next',
'react-i18next': 'react-i18next',
'i18next-browser-languagedetector': 'LngDetector',
};
export default {
input: 'src/index.js',
output: [
{
file: pkg.main,
format: 'umd',
name: 'ohif-i18n',
sourcemap: true,
globals,
exports: 'named',
},
{
file: pkg.module,
format: 'es',
sourcemap: true,
globals,
exports: 'named',
},
],
plugins: [
builtins(),
external(),
postcss({
modules: false,
}),
json({
// ignores indent and generates the smallest code
compact: true, // Default: false
// generate a named export for every property of the JSON object
namedExports: true, // Default: true
}),
url(),
babel({
exclude: 'node_modules/**',
externalHelpers: true,
runtimeHelpers: true,
}),
resolve(),
commonjs({
include: ['node_modules/**', '.yalc/**'],
}),
],
external: Object.keys(pkg.peerDependencies || {}),
};
-85
View File
@@ -1,85 +0,0 @@
version: 2
### ABOUT
#
# This configuration powers our Circleci.io integration
#
# Note:
# Netlify works independently from this configuration to
# create pull request previews and to update `https://react.ohif.org`
###
defaults: &defaults
working_directory: ~/repo
docker:
- image: circleci/node:10.15.1
jobs:
build_and_test:
<<: *defaults
steps:
# Download and cache dependencies
- checkout
- restore_cache:
name: Restore Yarn Package Cache
keys:
# when lock file changes, use increasingly general patterns to restore cache
- yarn-packages-v1-{{ .Branch }}-{{ checksum "yarn.lock" }}
- yarn-packages-v1-{{ .Branch }}-
- yarn-packages-v1-
- run:
name: Install Dependencies
command: yarn install --frozen-lockfile
- save_cache:
name: Save Yarn Package Cache
paths:
- ~/.cache/yarn
key: yarn-packages-v1-{{ .Branch }}-{{ checksum "yarn.lock" }}
# Build & Test
- run: yarn build
- run: yarn test
# Persist :+1:
- persist_to_workspace:
root: ~/repo
paths: .
npm_publish:
<<: *defaults
steps:
- attach_workspace:
at: ~/repo
- run:
name: Avoid hosts unknown for github
command:
mkdir ~/.ssh/ && echo -e "Host github.com\n\tStrictHostKeyChecking
no\n" > ~/.ssh/config
- run:
name: Publish using Semantic Release
command: npx semantic-release
workflows:
version: 2
# PULL REQUESTS
pull_requests:
jobs:
- build_and_test:
filters:
branches:
ignore:
- master
- feature/*
- hotfix/*
# MERGE TO MASTER
cut_release:
jobs:
- build_and_test:
filters:
branches:
only: master
- npm_publish:
requires:
- build_and_test
-2
View File
@@ -1,2 +0,0 @@
fixes:
- "::platform/ui/"
-8
View File
@@ -1,8 +0,0 @@
{
"recommendations": [
"esbenp.prettier-vscode",
"sysoev.language-stylus",
"silvenon.mdx",
"dbaeumer.vscode-eslint"
]
}
-29
View File
@@ -1,29 +0,0 @@
{
"editor.rulers": [80, 120],
// ===
// Spacing
// ===
"editor.insertSpaces": true,
"editor.tabSize": 2,
"editor.trimAutoWhitespace": true,
"files.trimTrailingWhitespace": true,
"files.eol": "\n",
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
// ===
// Event Triggers
// ===
"editor.formatOnSave": true,
"eslint.autoFixOnSave": true,
"eslint.run": "onSave",
"eslint.validate": [
{ "language": "javascript", "autoFix": true },
{ "language": "javascriptreact", "autoFix": true }
],
"prettier.disableLanguages": [],
"prettier.endOfLine": "lf"
}
+46 -2
View File
@@ -1,7 +1,51 @@
# Change Log # Change Log
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file. See
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.2.18-alpha.6](https://github.com/OHIF/Viewers/compare/@ohif/ui@0.2.18-alpha.5...@ohif/ui@0.2.18-alpha.6) (2019-08-08)
**Note:** Version bump only for package @ohif/ui
# Change Log
All notable changes to this project will be documented in this file. See
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.2.18-alpha.5](https://github.com/OHIF/Viewers/compare/@ohif/ui@0.2.18-alpha.4...@ohif/ui@0.2.18-alpha.5) (2019-08-08)
**Note:** Version bump only for package @ohif/ui
# Change Log
All notable changes to this project will be documented in this file. See
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.2.18-alpha.4](https://github.com/OHIF/Viewers/compare/@ohif/ui@0.2.18-alpha.3...@ohif/ui@0.2.18-alpha.4) (2019-08-08)
**Note:** Version bump only for package @ohif/ui
# Change Log
All notable changes to this project will be documented in this file. See
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.2.18-alpha.3](https://github.com/OHIF/Viewers/compare/@ohif/ui@0.2.18-alpha.2...@ohif/ui@0.2.18-alpha.3) (2019-08-08)
**Note:** Version bump only for package @ohif/ui
# Change Log
All notable changes to this project will be documented in this file. See
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.2.18-alpha.2](https://github.com/OHIF/Viewers/compare/@ohif/ui@0.2.18-alpha.1...@ohif/ui@0.2.18-alpha.2) (2019-08-07)
**Note:** Version bump only for package @ohif/ui
## [0.2.18-alpha.1](https://github.com/OHIF/Viewers/compare/@ohif/ui@0.2.18-alpha.0...@ohif/ui@0.2.18-alpha.1) (2019-08-07)
**Note:** Version bump only for package @ohif/ui
## 0.2.18-alpha.0 (2019-08-05) ## 0.2.18-alpha.0 (2019-08-05)
+19 -58
View File
@@ -1,9 +1,9 @@
<!-- prettier-ignore-start --> <!-- prettier-ignore-start -->
<!-- markdownlint-disable --> <!-- markdownlint-disable -->
<div align="center"> <div align="center">
<h1>react-viewerbase</h1> <h1>@ohif/ui</h1>
<p><strong>React Viewerbase is a collection of components and utilities</strong> that power OHIF's <a href="https://github.com/OHIF/Viewers">zero-footprint DICOM viewer</a>.</p> <p><strong>@ohif/ui</strong> is a collection of components and utilities that power OHIF's <a href="https://github.com/OHIF/Viewers">zero-footprint DICOM viewer</a>.</p>
</div> </div>
<div align="center"> <div align="center">
@@ -14,13 +14,9 @@
<hr /> <hr />
[![CircleCI][circleci-image]][circleci-url]
[![All Contributors](https://img.shields.io/badge/all_contributors-13-orange.svg?style=flat-square)](#contributors)
[![code style: prettier][prettier-image]][prettier-url]
[![semantic-release][semantic-image]][semantic-url]
[![NPM version][npm-version-image]][npm-url] [![NPM version][npm-version-image]][npm-url]
[![NPM downloads][npm-downloads-image]][npm-url] [![NPM downloads][npm-downloads-image]][npm-url]
[![All Contributors](https://img.shields.io/badge/all_contributors-13-orange.svg?style=flat-square)](#contributors)
[![MIT License][license-image]][license-url] [![MIT License][license-image]][license-url]
<!-- markdownlint-enable --> <!-- markdownlint-enable -->
<!-- prettier-ignore-end --> <!-- prettier-ignore-end -->
@@ -44,17 +40,17 @@ For full installation instructions, be sure to check out our
```bash ```bash
// with npm // with npm
npm i react-viewerbase --save-exact npm i @ohif/ui --save-exact
// with yarn // with yarn
yarn add react-viewerbase --exact yarn add @ohif/ui --exact
``` ```
## Usage ## Usage
```jsx ```jsx
import React, { Component } from 'react'; import React, { Component } from "react";
import { LayoutButton } from 'react-viewerbase'; import { LayoutButton } from "@ohif/ui";
class Example extends Component { class Example extends Component {
constructor(props) { constructor(props) {
@@ -62,10 +58,10 @@ class Example extends Component {
this.state = { this.state = {
selectedCell: { selectedCell: {
className: 'hover', className: "hover",
col: 1, col: 1,
row: 1, row: 1
}, }
}; };
} }
@@ -80,20 +76,21 @@ class Example extends Component {
} }
``` ```
## Running Locally ## Developing Locally
_Restore dependencies after cloning:_ _Restore dependencies after cloning:_
1. `cd react-viewerbase` ```bash
2. `yarn install` # Restore workspace dependencies (from repository root)
yarn install
_Develop w/ Hot Reloading:_ # From project root
yarn run dev:ui
`yarn dev` # OR from this project's directory
yarn run dev
_Build for Production:_ ```
`yarn build`
## Contributors ✨ ## Contributors ✨
@@ -110,31 +107,6 @@ This project follows the
[all-contributors](https://github.com/all-contributors/all-contributors) [all-contributors](https://github.com/all-contributors/all-contributors)
specification. Contributions of any kind welcome! specification. Contributions of any kind welcome!
## Issues
_Looking to contribute? Look for the [Good First Issue][good-first-issue]
label._
### 🐛 Bugs
Please file an issue for bugs, missing documentation, or unexpected behavior.
[**See Bugs**][bugs]
### 💡 Feature Requests
Please file an issue to suggest new features. Vote on feature requests by adding
a 👍. This helps maintainers prioritize what to work on.
[**See Feature Requests**][requests-feature]
### ❓ Questions
For questions related to using the library, please visit our support community,
or file an issue on GitHub.
[Google Group][google-group]
## License ## License
MIT © [OHIF](https://github.com/OHIF) MIT © [OHIF](https://github.com/OHIF)
@@ -146,20 +118,9 @@ Links:
<!-- prettier-ignore-start --> <!-- prettier-ignore-start -->
[all-contributors-image]: https://img.shields.io/badge/all_contributors-0-orange.svg?style=flat-square [all-contributors-image]: https://img.shields.io/badge/all_contributors-0-orange.svg?style=flat-square
[contributing-url]: https://github.com/OHIF/react-viewerbase/blob/master/CONTRIBUTING.md [contributing-url]: https://github.com/OHIF/react-viewerbase/blob/master/CONTRIBUTING.md
[circleci-image]: https://circleci.com/gh/OHIF/react-viewerbase.svg?style=svg
[circleci-url]: https://circleci.com/gh/OHIF/react-viewerbase
[prettier-image]: https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square
[prettier-url]: https://github.com/prettier/prettier
[npm-url]: https://npmjs.org/package/react-viewerbase [npm-url]: https://npmjs.org/package/react-viewerbase
[npm-downloads-image]: https://img.shields.io/npm/dm/react-viewerbase.svg?style=flat-square [npm-downloads-image]: https://img.shields.io/npm/dm/react-viewerbase.svg?style=flat-square
[npm-version-image]: https://img.shields.io/npm/v/react-viewerbase.svg?style=flat-square [npm-version-image]: https://img.shields.io/npm/v/react-viewerbase.svg?style=flat-square
[license-image]: https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square [license-image]: https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square
[license-url]: LICENSE [license-url]: LICENSE
[semantic-image]: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg
[semantic-url]: https://github.com/semantic-release/semantic-release
<!-- -->
[bugs]: https://github.com/OHIF/react-viewerbase/labels/bug
[requests-feature]: https://github.com/OHIF/react-viewerbase/labels/enhancement
[good-first-issue]: https://github.com/OHIF/react-viewerbase/labels/good%20first%20issue
[google-group]: https://groups.google.com/forum/#!forum/cornerstone-platform
<!-- prettier-ignore-end --> <!-- prettier-ignore-end -->
+34 -72
View File
@@ -3,48 +3,44 @@
* https://www.docz.site/docs/project-configuration * https://www.docz.site/docs/project-configuration
*/ */
import { css } from 'docz-plugin-css'; import { css } from "docz-plugin-css";
export default { export default {
dest: 'example/build', dest: "example/build",
public: '/public', public: "/public",
wrapper: 'src/__docs__/wrapper', wrapper: "src/__docs__/wrapper",
indexHtml: 'src/__docs__/index.html', indexHtml: "src/__docs__/index.html",
// Limited support for importing `.styl` files // Limited support for importing `.styl` files
codeSandbox: false, codeSandbox: false,
// https://github.com/pedronauck/docz/pull/849/files // https://github.com/pedronauck/docz/pull/849/files
// Because we re-export using `index.js` files // Because we re-export using `index.js` files
notUseSpecifiers: true, notUseSpecifiers: true,
// filterComponents: files =>
// files.filter(filepath =>
// /\/[A-Z]\w*(\/index)?\.(js|jsx|ts|tsx)$/.test(filepath)
// ),
menu: [ menu: [
'Introduction', "Introduction",
'Getting Started', "Getting Started",
{ name: 'Elements', menu: ['Form / Select'] }, { name: "Elements", menu: ["Form / Select"] },
{ {
name: 'Components', name: "Components",
menu: [ menu: [
'CINE Dialog', "CINE Dialog",
'Layout Button', "Layout Button",
'Measurement Table', "Measurement Table",
'Overlay Trigger', "Overlay Trigger",
'Quick Switch', "Quick Switch",
'Rounded Button Group', "Rounded Button Group",
'Select Tree', "Select Tree",
'Simple Dialog', "Simple Dialog",
'Study Browser', "Study Browser",
'Study List', "Study List",
'Table List', "Table List",
'Toolbar Section', "Toolbar Section",
'About Modal', "About Modal",
'User Preferences Modal', "User Preferences Modal"
], ]
}, },
'Styling & Theming', "Styling & Theming",
'Translating', "Translating",
'Compatibility', "Compatibility"
], ],
// Rollup Aliases? // Rollup Aliases?
// https://github.com/pedronauck/docz/issues/373 // https://github.com/pedronauck/docz/issues/373
@@ -53,9 +49,9 @@ export default {
css(), css(),
// Stylus // Stylus
css({ css({
preprocessor: 'stylus', preprocessor: "stylus",
cssmodules: false, cssmodules: false
}), })
], ],
// `docz` uses file-loader to pull in SVGs. This kills our icons before // `docz` uses file-loader to pull in SVGs. This kills our icons before
// They can be picked up by our `babel-plugin-inline-react-svg` dependency // They can be picked up by our `babel-plugin-inline-react-svg` dependency
@@ -64,50 +60,16 @@ export default {
// How we delete our rule: // How we delete our rule:
// https://github.com/neutrinojs/webpack-chain/issues/48 // https://github.com/neutrinojs/webpack-chain/issues/48
onCreateWebpackChain: config => { onCreateWebpackChain: config => {
config.module.rules.delete('svg'); config.module.rules.delete("svg");
// config.module
// .rule('svg')
// .test(/\.(svg)(\?.*)?$/)
// .use('file-loader')
// .loader(require.resolve('file-loader'))
// .options({
// name: `static/img/[name].[ext]`,
// })
}, },
modifyBabelRc: babelrc => { modifyBabelRc: babelrc => {
const newBabelRc = { const newBabelRc = {
...babelrc, ...babelrc,
plugins: [ plugins: [
...babelrc.plugins, ...babelrc.plugins,
require.resolve('babel-plugin-inline-react-svg'), require.resolve("babel-plugin-inline-react-svg")
], ]
}; };
return newBabelRc; return newBabelRc;
}, }
}; };
/*
* Alternative ways to extend/modify underlying webpack config
*
modifyBundlerConfig: (config) => {
config.module.rules.push({
test: /\.scss$/,
use: ["style-loader", "css-loader", "sass-loader"]
})
return config
}
*
*
*
onCreateWebpackChain: config => {
config.module
.rule('css')
.test(/\.css$/)
.use('css-loader')
.loader('css-loader')
.options({ sourceMap: false,
importLoaders: 2 })
}
*/
-21
View File
@@ -1,21 +0,0 @@
# https://www.netlify.com/docs/continuous-deployment/#deploy-contexts
#
# Global settings applied to the whole site.
#
# “base” is the directory to change to before starting build. If you set base:
# that is where we will look for package.json/.nvmrc/etc, not repo root!
# “command” is your build command.
# “publish” is the directory to publish (relative to the root of your repo).
# COMMENT: NODE_VERSION in root `.nvmrc` takes priority
# COMMENT: Why we specify YARN_FLAGS: https://www.netlify.com/docs/build-gotchas/#yarn
[build.environment]
NODE_VERSION = "10.15.3"
YARN_VERSION = "1.15.2"
YARN_FLAGS = "--no-ignore-optional --pure-lockfile"
# COMMENT: This a rule for Single Page Applications
[[redirects]]
from = "/*"
to = "/index.html"
status = 200
+9 -22
View File
@@ -1,6 +1,6 @@
{ {
"name": "@ohif/ui", "name": "@ohif/ui",
"version": "0.2.18-alpha.0", "version": "0.2.18-alpha.6",
"description": "A set of React components for Medical Imaging Viewers", "description": "A set of React components for Medical Imaging Viewers",
"author": "OHIF Contributors", "author": "OHIF Contributors",
"license": "MIT", "license": "MIT",
@@ -18,20 +18,15 @@
"dist" "dist"
], ],
"scripts": { "scripts": {
"dev": "docz dev",
"docs": "docz build",
"test:unit": "jest --watch", "test:unit": "jest --watch",
"test:unit:ci": "jest --ci --runInBand --collectCoverage --passWithNoTests", "test:unit:ci": "jest --ci --runInBand --collectCoverage --passWithNoTests",
"dev": "docz dev", "build:package": "webpack --config config/webpack.prod.js -d",
"lerna:build": "webpack --config config/webpack.prod.js -w -d", "dev:ui": "yarn run dev"
"build": "rollup -c",
"start": "rollup -c -w",
"prepare": "yarn build",
"prepublishOnly": "yarn build",
"generateStaticSite": "docz build",
"contributors:add": "all-contributors add",
"contributors:generate": "all-contributors generate"
}, },
"peerDependencies": { "peerDependencies": {
"@ohif/i18n": "0.2.1", "@ohif/i18n": "^0.2.3",
"i18next": "^17.0.3", "i18next": "^17.0.3",
"react": "^16.8.6", "react": "^16.8.6",
"react-dom": "^16.8.6", "react-dom": "^16.8.6",
@@ -39,7 +34,7 @@
}, },
"dependencies": { "dependencies": {
"@babel/runtime": "7.2.0", "@babel/runtime": "7.2.0",
"@ohif/i18n": "0.2.1", "@ohif/i18n": "^0.2.3",
"classnames": "2.2.6", "classnames": "2.2.6",
"i18next": "^17.0.3", "i18next": "^17.0.3",
"i18next-browser-languagedetector": "^3.0.1", "i18next-browser-languagedetector": "^3.0.1",
@@ -56,21 +51,13 @@
}, },
"devDependencies": { "devDependencies": {
"@mdx-js/tag": "^0.20.3", "@mdx-js/tag": "^0.20.3",
"all-contributors-cli": "6.7.0",
"autoprefixer": "^9.6.0", "autoprefixer": "^9.6.0",
"commitizen": "3.0.7",
"cz-conventional-changelog": "2.1.0",
"docz": "1.2.0", "docz": "1.2.0",
"docz-core": "1.2.0", "docz-core": "1.2.0",
"docz-plugin-css": "0.11.0", "docz-plugin-css": "0.11.0",
"docz-theme-default": "1.2.0", "docz-theme-default": "1.2.0",
"lodash.clonedeep": "^4.5.0", "lodash.clonedeep": "^4.5.0",
"react-powerplug": "1.0.0", "react-powerplug": "1.0.0"
"semantic-release": "15.13.x"
}, },
"config": { "gitHead": "a5baa9228c0eda0df880136bde4420d78e6f8706"
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
}
} }
+1 -9
View File
@@ -1,9 +1 @@
module.exports = { module.exports = require("../../postcss.config.js");
// parser: "sugarss",
parser: false,
plugins: {
'postcss-import': {},
'postcss-preset-env': {},
cssnano: {},
},
};
-61
View File
@@ -1,61 +0,0 @@
import autoprefixer from 'autoprefixer';
import babel from 'rollup-plugin-babel';
import builtins from 'rollup-plugin-node-builtins';
import commonjs from 'rollup-plugin-commonjs';
import external from 'rollup-plugin-peer-deps-external';
import pkg from './package.json';
import postcss from 'rollup-plugin-postcss';
import resolve from 'rollup-plugin-node-resolve';
import url from 'rollup-plugin-url';
const globals = {
react: 'React',
'react-dom': 'ReactDOM',
'react-i18next': 'reactI18next',
'@ohif/i18n': 'i18n',
};
export default {
input: 'src/index.js',
output: [
{
file: pkg.main,
format: 'umd',
name: 'react-viewerbase',
sourcemap: true,
exports: 'named',
globals,
},
{
file: pkg.module,
format: 'es',
sourcemap: true,
globals,
},
],
plugins: [
builtins(),
external(),
postcss({
modules: false,
plugins: [autoprefixer],
}),
url(),
babel({
exclude: 'node_modules/**',
runtimeHelpers: true,
}),
resolve({
browser: true,
}),
commonjs({
// https://github.com/airbnb/react-dates/issues/1183#issuecomment-392073823
namedExports: {
'node_modules/react-dates/index.js': [
'DateRangePicker',
'isInclusivelyBeforeDay',
],
},
}),
],
};
-2
View File
@@ -1,2 +0,0 @@
fixes:
- "::platform/viewer/"
-14
View File
@@ -1,14 +0,0 @@
{
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/npm",
"@semantic-release/github",
[
"@semantic-release/exec",
{
"publishCmd": "mkdir tmp && echo ${nextRelease.version} > tmp/updated-version.txt"
}
]
]
}
+55 -2
View File
@@ -1,7 +1,60 @@
# Change Log # Change Log
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file. See
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.0.22-alpha.7](https://github.com/OHIF/Viewers/compare/@ohif/viewer@0.0.22-alpha.6...@ohif/viewer@0.0.22-alpha.7) (2019-08-08)
**Note:** Version bump only for package @ohif/viewer
# Change Log
All notable changes to this project will be documented in this file. See
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.0.22-alpha.6](https://github.com/OHIF/Viewers/compare/@ohif/viewer@0.0.22-alpha.5...@ohif/viewer@0.0.22-alpha.6) (2019-08-08)
**Note:** Version bump only for package @ohif/viewer
# Change Log
All notable changes to this project will be documented in this file. See
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.0.22-alpha.5](https://github.com/OHIF/Viewers/compare/@ohif/viewer@0.0.22-alpha.4...@ohif/viewer@0.0.22-alpha.5) (2019-08-08)
**Note:** Version bump only for package @ohif/viewer
# Change Log
All notable changes to this project will be documented in this file. See
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.0.22-alpha.4](https://github.com/OHIF/Viewers/compare/@ohif/viewer@0.0.22-alpha.3...@ohif/viewer@0.0.22-alpha.4) (2019-08-08)
**Note:** Version bump only for package @ohif/viewer
# Change Log
All notable changes to this project will be documented in this file. See
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.0.22-alpha.3](https://github.com/OHIF/Viewers/compare/@ohif/viewer@0.0.22-alpha.2...@ohif/viewer@0.0.22-alpha.3) (2019-08-07)
**Note:** Version bump only for package @ohif/viewer
# Change Log
All notable changes to this project will be documented in this file. See
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.0.22-alpha.2](https://github.com/OHIF/Viewers/compare/@ohif/viewer@0.0.22-alpha.1...@ohif/viewer@0.0.22-alpha.2) (2019-08-07)
**Note:** Version bump only for package @ohif/viewer
## [0.0.22-alpha.1](https://github.com/OHIF/Viewers/compare/@ohif/viewer@0.0.22-alpha.0...@ohif/viewer@0.0.22-alpha.1) (2019-08-07)
**Note:** Version bump only for package @ohif/viewer
## 0.0.22-alpha.0 (2019-08-05) ## 0.0.22-alpha.0 (2019-08-05)
+5 -67
View File
@@ -1,8 +1,8 @@
<!-- prettier-ignore-start --> <!-- prettier-ignore-start -->
<!-- markdownlint-disable --> <!-- markdownlint-disable -->
<div align="center"> <div align="center">
<h1>ohif-viewer</h1> <h1>@ohif/viewer</h1>
<p><strong>ohif-viewer</strong> is a zero-footprint medical image viewer provided by the <a href="http://ohif.org/">Open Health Imaging Foundation (OHIF)</a>. It is a configurable and extensible progressive web application with out-of-the-box support for image archives which support <a href="https://www.dicomstandard.org/dicomweb/">DICOMweb</a>.</p> <p><strong>@ohif/viewer</strong> is a zero-footprint medical image viewer provided by the <a href="http://ohif.org/">Open Health Imaging Foundation (OHIF)</a>. It is a configurable and extensible progressive web application with out-of-the-box support for image archives which support <a href="https://www.dicomstandard.org/dicomweb/">DICOMweb</a>.</p>
</div> </div>
@@ -19,15 +19,10 @@
<hr /> <hr />
[![CircleCI][circleci-image]][circleci-url]
[![codecov][codecov-image]][codecov-url]
[![All Contributors](https://img.shields.io/badge/all_contributors-9-orange.svg?style=flat-square)](#contributors)
[![code style: prettier][prettier-image]][prettier-url]
[![semantic-release][semantic-image]][semantic-url]
[![NPM version][npm-version-image]][npm-url] [![NPM version][npm-version-image]][npm-url]
[![NPM downloads][npm-downloads-image]][npm-url] [![NPM downloads][npm-downloads-image]][npm-url]
[![Pulls][docker-pulls-img]][docker-image-url] [![Pulls][docker-pulls-img]][docker-image-url]
[![All Contributors](https://img.shields.io/badge/all_contributors-9-orange.svg?style=flat-square)](#contributors)
[![MIT License][license-image]][license-url] [![MIT License][license-image]][license-url]
<!-- markdownlint-enable --> <!-- markdownlint-enable -->
<!-- prettier-ignore-end --> <!-- prettier-ignore-end -->
@@ -162,31 +157,6 @@ your tests, reporting the results to your terminal. Make a pull request with
your changes to `master`, and a core team member will review your work. If you your changes to `master`, and a core team member will review your work. If you
have any questions, please don't hesitate to reach out via a GitHub issue. have any questions, please don't hesitate to reach out via a GitHub issue.
## Issues
_Looking to contribute? Look for the [Good First Issue][good-first-issue]
label._
### 🐛 Bugs
Please file an issue for bugs, missing documentation, or unexpected behavior.
[**See Bugs**][bugs]
### 💡 Feature Requests
Please file an issue to suggest new features. Vote on feature requests by adding
a 👍. This helps maintainers prioritize what to work on.
[**See Feature Requests**][requests-feature]
### ❓ Questions
For questions related to using the library, please visit our support community,
or file an issue on GitHub.
[Google Group][google-group]
## Roadmap ## Roadmap
If you want to know what's planned for the very near future, If you want to know what's planned for the very near future,
@@ -232,50 +202,18 @@ specification. Contributions of any kind welcome!
MIT © [OHIF](https://github.com/OHIF) MIT © [OHIF](https://github.com/OHIF)
## Acknowledgments
To acknowledge the OHIF Viewer in an academic publication, please cite
> _LesionTracker: Extensible Open-Source Zero-Footprint Web Viewer for Cancer
> Imaging Research and Clinical Trials_
>
> Trinity Urban, Erik Ziegler, Rob Lewis, Chris Hafey, Cheryl Sadow, Annick D.
> Van den Abbeele and Gordon J. Harris
>
> _Cancer Research_, November 1 2017 (77) (21) e119-e122 DOI:
> [10.1158/0008-5472.CAN-17-0334](https://www.doi.org/10.1158/0008-5472.CAN-17-0334)
**Note:** If you use or find this repository helpful, please take the time to
star this repository on Github. This is an easy way for us to assess adoption
and it can help us obtain future funding for the project.
This work is supported primarily by the National Institutes of Health, National
Cancer Institute, Informatics Technology for Cancer Research (ITCR) program,
under a
[grant to Dr. Gordon Harris at Massachusetts General Hospital (U24 CA199460)](https://projectreporter.nih.gov/project_info_description.cfm?aid=8971104).
<!-- <!--
Links: Links:
--> -->
<!-- prettier-ignore-start --> <!-- prettier-ignore-start -->
<!-- ROW -->
[all-contributors-image]: https://img.shields.io/badge/all_contributors-0-orange.svg?style=flat-square
[contributing-url]: https://github.com/OHIF/Viewers/blob/react/CONTRIBUTING.md
[circleci-image]: https://circleci.com/gh/OHIF/Viewers.svg?style=svg
[circleci-url]: https://circleci.com/gh/OHIF/Viewers
[codecov-image]: https://codecov.io/gh/OHIF/Viewers/branch/react/graph/badge.svg
[codecov-url]: https://codecov.io/gh/OHIF/Viewers/branch/react
[prettier-image]: https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square
[prettier-url]: https://github.com/prettier/prettier
[semantic-image]: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg
[semantic-url]: https://github.com/semantic-release/semantic-release
<!-- ROW -->
[npm-url]: https://npmjs.org/package/ohif-viewer [npm-url]: https://npmjs.org/package/ohif-viewer
[npm-downloads-image]: https://img.shields.io/npm/dm/ohif-viewer.svg?style=flat-square [npm-downloads-image]: https://img.shields.io/npm/dm/ohif-viewer.svg?style=flat-square
[npm-version-image]: https://img.shields.io/npm/v/ohif-viewer.svg?style=flat-square [npm-version-image]: https://img.shields.io/npm/v/ohif-viewer.svg?style=flat-square
[docker-pulls-img]: https://img.shields.io/docker/pulls/ohif/viewer.svg?style=flat-square [docker-pulls-img]: https://img.shields.io/docker/pulls/ohif/viewer.svg?style=flat-square
[docker-image-url]: https://hub.docker.com/r/ohif/viewer [docker-image-url]: https://hub.docker.com/r/ohif/viewer
[all-contributors-image]: https://img.shields.io/badge/all_contributors-0-orange.svg?style=flat-square
[contributing-url]: https://github.com/OHIF/Viewers/blob/react/CONTRIBUTING.md
[license-image]: https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square [license-image]: https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square
[license-url]: LICENSE [license-url]: LICENSE
<!-- DOCS --> <!-- DOCS -->
+18 -20
View File
@@ -1,6 +1,6 @@
{ {
"name": "@ohif/viewer", "name": "@ohif/viewer",
"version": "0.0.22-alpha.0", "version": "0.0.22-alpha.7",
"description": "OHIF Viewer", "description": "OHIF Viewer",
"author": "OHIF Contributors", "author": "OHIF Contributors",
"license": "MIT", "license": "MIT",
@@ -16,32 +16,29 @@
}, },
"proxy": "http://localhost:8042", "proxy": "http://localhost:8042",
"scripts": { "scripts": {
"lerna:start": "cross-env NODE_ENV=development webpack-dev-server --config config/webpack.dev.js --mode development -w -d",
"build:package": "webpack --config config/webpack.prod.js",
"test:unit": "jest --watch", "test:unit": "jest --watch",
"test:unit:ci": "jest --ci --runInBand --collectCoverage", "test:unit:ci": "jest --ci --runInBand --collectCoverage",
"dev": "yarn run preBuild && react-scripts start",
"dev:debug": "react-scripts start",
"build:web": "yarn run preBuild && react-scripts --max_old_space_size=4096 build",
"build:demo:ci": "yarn run preBuild && cross-env PUBLIC_URL=/ REACT_APP_CONFIG=config/demo.js react-scripts --max_old_space_size=4096 build", "build:demo:ci": "yarn run preBuild && cross-env PUBLIC_URL=/ REACT_APP_CONFIG=config/demo.js react-scripts --max_old_space_size=4096 build",
"test:e2e:ci": "start-server-and-test start http://localhost:5000 cy:run:ci", "test:e2e:ci": "start-server-and-test start http://localhost:5000 cy:run:ci",
"start": "yarn run dev", "start": "yarn run dev",
"predeploy": "cd example && npm install && yarn run build:package", "preBuild": "yarn run copy:webworkers",
"preBuild": "yarn run version && yarn run copy:webworkers",
"orthanc:up": "docker-compose -f docker/Nginx-Orthanc/docker-compose.yml up", "orthanc:up": "docker-compose -f docker/Nginx-Orthanc/docker-compose.yml up",
"dev:orthanc": "yarn run preBuild && cross-env REACT_APP_CONFIG=config/docker_nginx-orthanc.js react-scripts start", "dev:orthanc": "yarn run preBuild && cross-env REACT_APP_CONFIG=config/docker_nginx-orthanc.js react-scripts start",
"version": "node -p -e \"'export default \\'' + require('./package.json').version + '\\';'\" > src/version.js",
"copy:webworkers": "cpx \"node_modules/cornerstone-wado-image-loader/dist/*.min.js*\" \"public\" -v", "copy:webworkers": "cpx \"node_modules/cornerstone-wado-image-loader/dist/*.min.js*\" \"public\" -v",
"cy": "cypress open", "cy": "cypress open",
"cy:run": "cypress run", "cy:run": "cypress run",
"cy:run:ci": "yarn run cy:run -- --record" "cy:run:ci": "yarn run cy:run -- --record",
"build:package": "echo 'VIEWER: No package'",
"build:viewer": "webpack --config config/webpack.prod.js",
"dev:viewer": "cross-env NODE_ENV=development webpack-dev-server --config config/webpack.dev.js --mode development -w -d"
}, },
"resolutions": { "resolutions": {
"browserslist": "4.6.2", "browserslist": "4.6.2",
"caniuse-lite": "1.0.30000974" "caniuse-lite": "1.0.30000974"
}, },
"files": [ "files": [
"dist" "dist",
"README.md"
], ],
"config": { "config": {
"commitizen": { "commitizen": {
@@ -54,14 +51,14 @@
}, },
"dependencies": { "dependencies": {
"@babel/runtime": "^7.4.5", "@babel/runtime": "^7.4.5",
"@ohif/core": "^0.11.1-alpha.0", "@ohif/core": "^0.11.1-alpha.6",
"@ohif/extension-cornerstone": "^0.0.39-alpha.0", "@ohif/extension-cornerstone": "^0.0.39-alpha.6",
"@ohif/extension-dicom-html": "^0.0.4-alpha.0", "@ohif/extension-dicom-html": "^0.0.4-alpha.6",
"@ohif/extension-dicom-microscopy": "^0.0.9-alpha.0", "@ohif/extension-dicom-microscopy": "^0.0.9-alpha.6",
"@ohif/extension-dicom-pdf": "^0.0.8-alpha.0", "@ohif/extension-dicom-pdf": "^0.0.8-alpha.6",
"@ohif/extension-vtk": "^0.1.4-alpha.0", "@ohif/extension-vtk": "^0.1.4-alpha.6",
"@ohif/i18n": "^0.2.3-alpha.0", "@ohif/i18n": "^0.2.3-alpha.6",
"@ohif/ui": "0.15.3", "@ohif/ui": "^0.2.18-alpha.6",
"@tanem/react-nprogress": "^1.1.25", "@tanem/react-nprogress": "^1.1.25",
"classnames": "^2.2.6", "classnames": "^2.2.6",
"cornerstone-core": "^2.2.8", "cornerstone-core": "^2.2.8",
@@ -103,5 +100,6 @@
"lodash.clonedeep": "4.5.0", "lodash.clonedeep": "4.5.0",
"semantic-release": "15.13.x", "semantic-release": "15.13.x",
"start-server-and-test": "^1.9.1" "start-server-and-test": "^1.9.1"
} },
"gitHead": "a5baa9228c0eda0df880136bde4420d78e6f8706"
} }
+1 -9
View File
@@ -1,9 +1 @@
module.exports = { module.exports = require("../../postcss.config.js");
// parser: "sugarss",
parser: false,
plugins: {
'postcss-import': {},
'postcss-preset-env': {},
cssnano: {},
},
};
+29 -29
View File
@@ -1,46 +1,46 @@
import './config'; import "./config";
// Polyfills // Polyfills
import 'core-js/features/array/flat'; import "core-js/features/array/flat";
import 'core-js/stable'; import "core-js/stable";
import 'regenerator-runtime/runtime'; import "regenerator-runtime/runtime";
import { import {
CommandsManager, CommandsManager,
ExtensionManager, ExtensionManager,
HotkeysManager, HotkeysManager,
utils, utils
} from 'ohif-core'; } from "@ohif/core";
import React, { Component } from 'react'; import React, { Component } from "react";
import { import {
getUserManagerForOpenIdConnectClient, getUserManagerForOpenIdConnectClient,
initWebWorkers, initWebWorkers
} from './utils/index.js'; } from "./utils/index.js";
import { I18nextProvider } from 'react-i18next'; import { I18nextProvider } from "react-i18next";
import initCornerstoneTools from './initCornerstoneTools.js'; import initCornerstoneTools from "./initCornerstoneTools.js";
// ~~ EXTENSIONS // ~~ EXTENSIONS
import { GenericViewerCommands, MeasurementsPanel } from './appExtensions'; import { GenericViewerCommands, MeasurementsPanel } from "./appExtensions";
import OHIFCornerstoneExtension from '@ohif/extension-cornerstone'; import OHIFCornerstoneExtension from "@ohif/extension-cornerstone";
import OHIFStandaloneViewer from './OHIFStandaloneViewer'; import OHIFStandaloneViewer from "./OHIFStandaloneViewer";
import { OidcProvider } from 'redux-oidc'; import { OidcProvider } from "redux-oidc";
import PropTypes from 'prop-types'; import PropTypes from "prop-types";
import { Provider } from 'react-redux'; import { Provider } from "react-redux";
import { BrowserRouter as Router } from 'react-router-dom'; import { BrowserRouter as Router } from "react-router-dom";
import WhiteLabellingContext from './WhiteLabellingContext'; import WhiteLabellingContext from "./WhiteLabellingContext";
import { getActiveContexts } from './store/layout/selectors.js'; import { getActiveContexts } from "./store/layout/selectors.js";
import i18n from '@ohif/i18n'; import i18n from "@ohif/i18n";
import setupTools from './setupTools.js'; import setupTools from "./setupTools.js";
import store from './store'; import store from "./store";
// ~~~~ APP SETUP // ~~~~ APP SETUP
initCornerstoneTools({ initCornerstoneTools({
globalToolSyncEnabled: true, globalToolSyncEnabled: true
}); });
const commandsManagerConfig = { const commandsManagerConfig = {
getAppState: () => store.getState(), getAppState: () => store.getState(),
getActiveContexts: () => getActiveContexts(store.getState()), getActiveContexts: () => getActiveContexts(store.getState())
}; };
const commandsManager = new CommandsManager(commandsManagerConfig); const commandsManager = new CommandsManager(commandsManagerConfig);
@@ -64,15 +64,15 @@ class App extends Component {
whiteLabelling: PropTypes.object, whiteLabelling: PropTypes.object,
extensions: PropTypes.arrayOf( extensions: PropTypes.arrayOf(
PropTypes.shape({ PropTypes.shape({
id: PropTypes.string.isRequired, id: PropTypes.string.isRequired
}) })
), )
}; };
static defaultProps = { static defaultProps = {
whiteLabelling: {}, whiteLabelling: {},
oidc: [], oidc: [],
extensions: [], extensions: []
}; };
constructor(props) { constructor(props) {
@@ -137,7 +137,7 @@ function _initExtensions(extensions) {
const defaultExtensions = [ const defaultExtensions = [
GenericViewerCommands, GenericViewerCommands,
MeasurementsPanel, MeasurementsPanel,
OHIFCornerstoneExtension, OHIFCornerstoneExtension
]; ];
const mergedExtensions = defaultExtensions.concat(extensions); const mergedExtensions = defaultExtensions.concat(extensions);
extensionManager.registerExtensions(mergedExtensions); extensionManager.registerExtensions(mergedExtensions);
@@ -1,5 +1,5 @@
import { redux } from 'ohif-core'; import { redux } from "@ohif/core";
import store from './../../store'; import store from "./../../store";
const { setViewportActive } = redux.actions; const { setViewportActive } = redux.actions;
const actions = { const actions = {
@@ -16,24 +16,24 @@ const actions = {
newIndex = newIndex < 0 ? maxIndex : newIndex; newIndex = newIndex < 0 ? maxIndex : newIndex;
store.dispatch(setViewportActive(newIndex)); store.dispatch(setViewportActive(newIndex));
}, }
}; };
const definitions = { const definitions = {
// Next/Previous active viewport // Next/Previous active viewport
incrementActiveViewport: { incrementActiveViewport: {
commandFn: actions.updateActiveViewport, commandFn: actions.updateActiveViewport,
storeContexts: ['viewports'], storeContexts: ["viewports"],
options: { direction: 1 }, options: { direction: 1 }
}, },
decrementActiveViewport: { decrementActiveViewport: {
commandFn: actions.updateActiveViewport, commandFn: actions.updateActiveViewport,
storeContexts: ['viewports'], storeContexts: ["viewports"],
options: { direction: -1 }, options: { direction: -1 }
}, }
}; };
export default { export default {
definitions, definitions,
defaultContext: 'VIEWER', defaultContext: "VIEWER"
}; };
@@ -1,12 +1,12 @@
import { connect } from 'react-redux'; import { connect } from "react-redux";
import { MeasurementTable } from 'react-viewerbase'; import { MeasurementTable } from "react-viewerbase";
import OHIF from 'ohif-core'; import OHIF from "@ohif/core";
import moment from 'moment'; import moment from "moment";
import cornerstone from 'cornerstone-core'; import cornerstone from "cornerstone-core";
// //
import jumpToRowItem from './jumpToRowItem.js'; import jumpToRowItem from "./jumpToRowItem.js";
import getMeasurementLocationCallback from './../../lib/getMeasurementLocationCallback'; import getMeasurementLocationCallback from "./../../lib/getMeasurementLocationCallback";
const { setViewportSpecificData } = OHIF.redux.actions; const { setViewportSpecificData } = OHIF.redux.actions;
const { MeasurementApi } = OHIF.measurements; const { MeasurementApi } = OHIF.measurements;
@@ -30,7 +30,7 @@ function getAllTools() {
function getMeasurementText(measurementData) { function getMeasurementText(measurementData) {
const { location, description } = measurementData; const { location, description } = measurementData;
let text = '...'; let text = "...";
if (location) { if (location) {
text = location; text = location;
if (description) { if (description) {
@@ -50,7 +50,7 @@ function getDataForEachMeasurementNumber(
measurementNumberList.forEach(measurement => { measurementNumberList.forEach(measurement => {
timepoints.forEach(timepoint => { timepoints.forEach(timepoint => {
const eachData = { const eachData = {
displayText: '...', displayText: "..."
}; };
if (measurement.timepointId === timepoint.timepointId) { if (measurement.timepointId === timepoint.timepointId) {
eachData.displayText = displayFunction(measurement); eachData.displayText = displayFunction(measurement);
@@ -71,7 +71,7 @@ function convertMeasurementsToTableData(toolCollections, timepoints) {
return { return {
groupName: toolGroup.name, groupName: toolGroup.name,
groupId: toolGroup.id, groupId: toolGroup.id,
measurements: [], measurements: []
}; };
}); });
@@ -81,7 +81,7 @@ function convertMeasurementsToTableData(toolCollections, timepoints) {
const { displayFunction } = tool.options.measurementTable; const { displayFunction } = tool.options.measurementTable;
// Group by measurementNumber so we can display then all in the same line // Group by measurementNumber so we can display then all in the same line
const groupedMeasurements = groupBy(toolMeasurements, 'measurementNumber'); const groupedMeasurements = groupBy(toolMeasurements, "measurementNumber");
Object.keys(groupedMeasurements).forEach(groupedMeasurementsIndex => { Object.keys(groupedMeasurements).forEach(groupedMeasurementsIndex => {
const measurementNumberList = const measurementNumberList =
@@ -90,7 +90,7 @@ function convertMeasurementsToTableData(toolCollections, timepoints) {
const { const {
measurementNumber, measurementNumber,
lesionNamingNumber, lesionNamingNumber,
toolType, toolType
} = measurementData; } = measurementData;
const measurementId = measurementData._id; const measurementId = measurementData._id;
@@ -103,14 +103,14 @@ function convertMeasurementsToTableData(toolCollections, timepoints) {
lesionNamingNumber, lesionNamingNumber,
toolType, toolType,
hasWarnings: false, //TODO hasWarnings: false, //TODO
warningTitle: '', //TODO warningTitle: "", //TODO
isSplitLesion: false, //TODO isSplitLesion: false, //TODO
warningList: [], //TODO warningList: [], //TODO
data: getDataForEachMeasurementNumber( data: getDataForEachMeasurementNumber(
measurementNumberList, measurementNumberList,
timepoints, timepoints,
displayFunction displayFunction
), )
}; };
// find the group object for the tool // find the group object for the tool
@@ -139,9 +139,9 @@ function convertTimepointsToTableData(timepoints) {
return [ return [
{ {
label: 'Study date:', label: "Study date:",
date: moment(timepoints[0].latestDate).format('DD-MMM-YY'), date: moment(timepoints[0].latestDate).format("DD-MMM-YY")
}, }
]; ];
} }
@@ -154,7 +154,7 @@ const mapStateToProps = state => {
timepoints timepoints
), ),
timepointManager: state.timepointManager, timepointManager: state.timepointManager,
viewports: state.viewports, viewports: state.viewports
}; };
}; };
@@ -166,7 +166,7 @@ const mapDispatchToProps = dispatch => {
const enabledElements = cornerstone.getEnabledElements(); const enabledElements = cornerstone.getEnabledElements();
if (!enabledElements || enabledElements.length <= activeViewportIndex) { if (!enabledElements || enabledElements.length <= activeViewportIndex) {
OHIF.log.error('Failed to find the enabled element'); OHIF.log.error("Failed to find the enabled element");
return; return;
} }
@@ -175,9 +175,9 @@ const mapDispatchToProps = dispatch => {
const eventData = { const eventData = {
event: { event: {
clientX: event.clientX, clientX: event.clientX,
clientY: event.clientY, clientY: event.clientY
}, },
element, element
}; };
const { toolType, measurementId } = measurementData; const { toolType, measurementId } = measurementData;
@@ -187,7 +187,7 @@ const mapDispatchToProps = dispatch => {
const options = { const options = {
skipAddLabelButton: true, skipAddLabelButton: true,
editLocation: true, editLocation: true
}; };
// Clone the tool not to set empty location initially // Clone the tool not to set empty location initially
@@ -200,7 +200,7 @@ const mapDispatchToProps = dispatch => {
const enabledElements = cornerstone.getEnabledElements(); const enabledElements = cornerstone.getEnabledElements();
if (!enabledElements || enabledElements.length <= activeViewportIndex) { if (!enabledElements || enabledElements.length <= activeViewportIndex) {
OHIF.log.error('Failed to find the enabled element'); OHIF.log.error("Failed to find the enabled element");
return; return;
} }
@@ -209,9 +209,9 @@ const mapDispatchToProps = dispatch => {
const eventData = { const eventData = {
event: { event: {
clientX: event.clientX, clientX: event.clientX,
clientY: event.clientY, clientY: event.clientY
}, },
element, element
}; };
const { toolType, measurementId } = measurementData; const { toolType, measurementId } = measurementData;
@@ -220,7 +220,7 @@ const mapDispatchToProps = dispatch => {
}); });
const options = { const options = {
editDescriptionOnDialog: true, editDescriptionOnDialog: true
}; };
getMeasurementLocationCallback(eventData, tool, options); getMeasurementLocationCallback(eventData, tool, options);
@@ -285,7 +285,7 @@ const mapDispatchToProps = dispatch => {
//dispatch(setActiveMeasurement(measurementData.measurementId)) //dispatch(setActiveMeasurement(measurementData.measurementId))
// (later): Needs to set some property on state.extensions.cornerstone to synchronize viewport scrolling // (later): Needs to set some property on state.extensions.cornerstone to synchronize viewport scrolling
}, }
}; };
}; };
@@ -307,7 +307,7 @@ const mergeProps = (propsFromState, propsFromDispatch, ownProps) => {
// TODO: childToolKey should come from the measurement table when it supports child tools // TODO: childToolKey should come from the measurement table when it supports child tools
const options = { const options = {
invertViewportTimepointsOrder: false, invertViewportTimepointsOrder: false,
childToolKey: null, childToolKey: null
}; };
propsFromDispatch.dispatchJumpToRowItem( propsFromDispatch.dispatchJumpToRowItem(
@@ -338,11 +338,11 @@ const mergeProps = (propsFromState, propsFromDispatch, ownProps) => {
measurementData: { measurementData: {
_id: measurementData.measurementId, _id: measurementData.measurementId,
lesionNamingNumber: measurementData.lesionNamingNumber, lesionNamingNumber: measurementData.lesionNamingNumber,
measurementNumber: measurementData.measurementNumber, measurementNumber: measurementData.measurementNumber
}, }
}, }
}); });
}, }
}; };
}; };
@@ -1,4 +1,4 @@
import { measurements, utils } from 'ohif-core'; import { measurements, utils } from "@ohif/core";
const { MeasurementApi } = measurements; const { MeasurementApi } = measurements;
const { studyMetadataManager } = utils; const { studyMetadataManager } = utils;
@@ -82,7 +82,7 @@ export default function jumpToRowItem(
const study = studyMetadataManager.get(data.studyInstanceUid); const study = studyMetadataManager.get(data.studyInstanceUid);
if (!study) { if (!study) {
throw new Error('Study not found.'); throw new Error("Study not found.");
} }
const displaySet = study.findDisplaySet(displaySet => { const displaySet = study.findDisplaySet(displaySet => {
@@ -90,7 +90,7 @@ export default function jumpToRowItem(
}); });
if (!displaySet) { if (!displaySet) {
throw new Error('Display set not found.'); throw new Error("Display set not found.");
} }
displaySet.sopInstanceUid = data.sopInstanceUid; displaySet.sopInstanceUid = data.sopInstanceUid;
@@ -100,12 +100,12 @@ export default function jumpToRowItem(
viewportSpecificData.push({ viewportSpecificData.push({
viewportIndex, viewportIndex,
displaySet, displaySet
}); });
}); });
return { return {
viewportSpecificData, viewportSpecificData,
layout: [], // TODO: if we need to change layout, we should return this here layout: [] // TODO: if we need to change layout, we should return this here
}; };
} }
@@ -1,12 +1,12 @@
import { Component } from 'react'; import { Component } from "react";
import PropTypes from 'prop-types'; import PropTypes from "prop-types";
import OHIF from 'ohif-core'; import OHIF from "@ohif/core";
class StudyLoadingMonitor extends Component { class StudyLoadingMonitor extends Component {
static propTypes = { static propTypes = {
studies: PropTypes.array.isRequired, studies: PropTypes.array.isRequired,
setStudyLoadingProgress: PropTypes.func.isRequired, setStudyLoadingProgress: PropTypes.func.isRequired,
clearStudyLoadingProgress: PropTypes.func.isRequired, clearStudyLoadingProgress: PropTypes.func.isRequired
}; };
componentDidMount() { componentDidMount() {
@@ -20,7 +20,7 @@ class StudyLoadingMonitor extends Component {
}, },
_clearProgressById: progressId => { _clearProgressById: progressId => {
this.props.clearStudyLoadingProgress(progressId); this.props.clearStudyLoadingProgress(progressId);
}, }
}; };
const { StudyLoadingListener } = OHIF.classes; const { StudyLoadingListener } = OHIF.classes;
@@ -1,12 +1,12 @@
import { Component } from 'react'; import { Component } from "react";
import PropTypes from 'prop-types'; import PropTypes from "prop-types";
import OHIF from 'ohif-core'; import OHIF from "@ohif/core";
const { StudyPrefetcher } = OHIF.classes; const { StudyPrefetcher } = OHIF.classes;
class StudyPrefetcherComponent extends Component { class StudyPrefetcherComponent extends Component {
static propTypes = { static propTypes = {
studies: PropTypes.array, studies: PropTypes.array
}; };
componentDidMount() { componentDidMount() {
+8 -8
View File
@@ -1,12 +1,12 @@
import OHIF from 'ohif-core'; import OHIF from "@ohif/core";
import cornerstone from 'cornerstone-core'; import cornerstone from "cornerstone-core";
import cornerstoneWADOImageLoader from 'cornerstone-wado-image-loader'; import cornerstoneWADOImageLoader from "cornerstone-wado-image-loader";
import dicomParser from 'dicom-parser'; import dicomParser from "dicom-parser";
import version from './version.js'; import version from "./version.js";
window.info = { window.info = {
version, version,
homepage: `${process.env.PUBLIC_URL}`, homepage: `${process.env.PUBLIC_URL}`
}; };
// For debugging // For debugging
@@ -33,7 +33,7 @@ cornerstoneWADOImageLoader.configure({
const headers = OHIF.DICOMWeb.getAuthorizationHeader(); const headers = OHIF.DICOMWeb.getAuthorizationHeader();
if (headers.Authorization) { if (headers.Authorization) {
xhr.setRequestHeader('Authorization', headers.Authorization); xhr.setRequestHeader("Authorization", headers.Authorization);
}
} }
},
}); });
@@ -1,13 +1,13 @@
import { connect } from 'react-redux'; import { connect } from "react-redux";
import { CineDialog } from 'react-viewerbase'; import { CineDialog } from "react-viewerbase";
import OHIF from 'ohif-core'; import OHIF from "@ohif/core";
import csTools from 'cornerstone-tools'; import csTools from "cornerstone-tools";
// Our target output kills the `as` and "import" throws a keyword error // Our target output kills the `as` and "import" throws a keyword error
// import { import as toolImport, getToolState } from 'cornerstone-tools'; // import { import as toolImport, getToolState } from 'cornerstone-tools';
import cloneDeep from 'lodash.clonedeep'; import cloneDeep from "lodash.clonedeep";
const toolImport = csTools.import; const toolImport = csTools.import;
const scrollToIndex = toolImport('util/scrollToIndex'); const scrollToIndex = toolImport("util/scrollToIndex");
const { setViewportSpecificData } = OHIF.redux.actions; const { setViewportSpecificData } = OHIF.redux.actions;
// Why do I need or care about any of this info? // Why do I need or care about any of this info?
@@ -20,14 +20,14 @@ const mapStateToProps = state => {
const cineData = cine || { const cineData = cine || {
isPlaying: false, isPlaying: false,
cineFrameRate: 24, cineFrameRate: 24
}; };
// New props we're creating? // New props we're creating?
return { return {
activeEnabledElement: dom, activeEnabledElement: dom,
activeViewportCineData: cineData, activeViewportCineData: cineData,
activeViewportIndex: state.viewports.activeViewportIndex, activeViewportIndex: state.viewports.activeViewportIndex
}; };
}; };
@@ -35,7 +35,7 @@ const mapDispatchToProps = dispatch => {
return { return {
dispatchSetViewportSpecificData: (viewportIndex, data) => { dispatchSetViewportSpecificData: (viewportIndex, data) => {
dispatch(setViewportSpecificData(viewportIndex, data)); dispatch(setViewportSpecificData(viewportIndex, data));
}, }
}; };
}; };
@@ -43,7 +43,7 @@ const mergeProps = (propsFromState, propsFromDispatch, ownProps) => {
const { const {
activeEnabledElement, activeEnabledElement,
activeViewportCineData, activeViewportCineData,
activeViewportIndex, activeViewportIndex
} = propsFromState; } = propsFromState;
return { return {
@@ -54,7 +54,7 @@ const mergeProps = (propsFromState, propsFromDispatch, ownProps) => {
cine.isPlaying = !cine.isPlaying; cine.isPlaying = !cine.isPlaying;
propsFromDispatch.dispatchSetViewportSpecificData(activeViewportIndex, { propsFromDispatch.dispatchSetViewportSpecificData(activeViewportIndex, {
cine, cine
}); });
}, },
onFrameRateChanged: frameRate => { onFrameRateChanged: frameRate => {
@@ -62,34 +62,34 @@ const mergeProps = (propsFromState, propsFromDispatch, ownProps) => {
cine.cineFrameRate = frameRate; cine.cineFrameRate = frameRate;
propsFromDispatch.dispatchSetViewportSpecificData(activeViewportIndex, { propsFromDispatch.dispatchSetViewportSpecificData(activeViewportIndex, {
cine, cine
}); });
}, },
onClickNextButton: () => { onClickNextButton: () => {
const stackData = csTools.getToolState(activeEnabledElement, 'stack'); const stackData = csTools.getToolState(activeEnabledElement, "stack");
if (!stackData || !stackData.data || !stackData.data.length) return; if (!stackData || !stackData.data || !stackData.data.length) return;
const { currentImageIdIndex, imageIds } = stackData.data[0]; const { currentImageIdIndex, imageIds } = stackData.data[0];
if (currentImageIdIndex >= imageIds.length - 1) return; if (currentImageIdIndex >= imageIds.length - 1) return;
scrollToIndex(activeEnabledElement, currentImageIdIndex + 1); scrollToIndex(activeEnabledElement, currentImageIdIndex + 1);
}, },
onClickBackButton: () => { onClickBackButton: () => {
const stackData = csTools.getToolState(activeEnabledElement, 'stack'); const stackData = csTools.getToolState(activeEnabledElement, "stack");
if (!stackData || !stackData.data || !stackData.data.length) return; if (!stackData || !stackData.data || !stackData.data.length) return;
const { currentImageIdIndex } = stackData.data[0]; const { currentImageIdIndex } = stackData.data[0];
if (currentImageIdIndex === 0) return; if (currentImageIdIndex === 0) return;
scrollToIndex(activeEnabledElement, currentImageIdIndex - 1); scrollToIndex(activeEnabledElement, currentImageIdIndex - 1);
}, },
onClickSkipToStart: () => { onClickSkipToStart: () => {
const stackData = csTools.getToolState(activeEnabledElement, 'stack'); const stackData = csTools.getToolState(activeEnabledElement, "stack");
if (!stackData || !stackData.data || !stackData.data.length) return; if (!stackData || !stackData.data || !stackData.data.length) return;
scrollToIndex(activeEnabledElement, 0); scrollToIndex(activeEnabledElement, 0);
}, },
onClickSkipToEnd: () => { onClickSkipToEnd: () => {
const stackData = csTools.getToolState(activeEnabledElement, 'stack'); const stackData = csTools.getToolState(activeEnabledElement, "stack");
if (!stackData || !stackData.data || !stackData.data.length) return; if (!stackData || !stackData.data || !stackData.data.length) return;
const lastIndex = stackData.data[0].imageIds.length - 1; const lastIndex = stackData.data[0].imageIds.length - 1;
scrollToIndex(activeEnabledElement, lastIndex); scrollToIndex(activeEnabledElement, lastIndex);
}, }
}; };
}; };
@@ -1,12 +1,12 @@
import { LayoutButton } from 'react-viewerbase'; import { LayoutButton } from "react-viewerbase";
import OHIF from 'ohif-core'; import OHIF from "@ohif/core";
import { connect } from 'react-redux'; import { connect } from "react-redux";
const { setLayout } = OHIF.redux.actions; const { setLayout } = OHIF.redux.actions;
const mapStateToProps = state => { const mapStateToProps = state => {
return { return {
currentLayout: state.viewports.layout, currentLayout: state.viewports.layout
}; };
}; };
@@ -21,15 +21,15 @@ const mapDispatchToProps = dispatch => {
for (let i = 0; i < numViewports; i++) { for (let i = 0; i < numViewports; i++) {
viewports.push({ viewports.push({
height: `${100 / rows}%`, height: `${100 / rows}%`,
width: `${100 / columns}%`, width: `${100 / columns}%`
}); });
} }
const layout = { const layout = {
viewports, viewports
}; };
dispatch(setLayout(layout)); dispatch(setLayout(layout));
}, }
}; };
}; };
@@ -1,7 +1,7 @@
import { LayoutManager } from 'react-viewerbase'; import { LayoutManager } from "react-viewerbase";
import { MODULE_TYPES } from 'ohif-core'; import { MODULE_TYPES } from "@ohif/core";
import { connect } from 'react-redux'; import { connect } from "react-redux";
import { extensionManager } from './../App.js'; import { extensionManager } from "./../App.js";
const mapStateToProps = state => { const mapStateToProps = state => {
const availableViewportModules = {}; const availableViewportModules = {};
@@ -24,7 +24,7 @@ const mapStateToProps = state => {
// TODO: rename `availableViewportModules` // TODO: rename `availableViewportModules`
availablePlugins: availableViewportModules, availablePlugins: availableViewportModules,
// TODO: rename `defaultViewportModule` // TODO: rename `defaultViewportModule`
defaultPlugin, defaultPlugin
}; };
}; };
@@ -1,7 +1,7 @@
import OHIF from 'ohif-core'; import OHIF from "@ohif/core";
import PluginSwitch from './PluginSwitch.js'; import PluginSwitch from "./PluginSwitch.js";
import { commandsManager } from './../App.js'; import { commandsManager } from "./../App.js";
import { connect } from 'react-redux'; import { connect } from "react-redux";
const { setLayout } = OHIF.redux.actions; const { setLayout } = OHIF.redux.actions;
@@ -11,7 +11,7 @@ const mapStateToProps = state => {
return { return {
activeViewportIndex, activeViewportIndex,
viewportSpecificData, viewportSpecificData,
layout, layout
}; };
}; };
@@ -19,7 +19,7 @@ const mapDispatchToProps = dispatch => {
return { return {
setLayout: data => { setLayout: data => {
dispatch(setLayout(data)); dispatch(setLayout(data));
}, }
}; };
}; };
@@ -81,16 +81,16 @@ const mergeProps = (propsFromState, propsFromDispatch, ownProps) => {
}, },
},*/ },*/
{ {
label: '2D MPR', label: "2D MPR",
icon: 'cube', icon: "cube",
onClick: () => { onClick: () => {
commandsManager.runCommand('mpr2d'); commandsManager.runCommand("mpr2d");
}, }
}, }
]; ];
return { return {
buttons, buttons
}; };
}; };
@@ -1,10 +1,10 @@
import { connect } from 'react-redux'; import { connect } from "react-redux";
import StudyLoadingMonitor from '../components/StudyLoadingMonitor.js'; import StudyLoadingMonitor from "../components/StudyLoadingMonitor.js";
import OHIF from 'ohif-core'; import OHIF from "@ohif/core";
const { const {
setStudyLoadingProgress, setStudyLoadingProgress,
clearStudyLoadingProgress, clearStudyLoadingProgress
} = OHIF.redux.actions; } = OHIF.redux.actions;
const mapDispatchToProps = dispatch => { const mapDispatchToProps = dispatch => {
@@ -14,7 +14,7 @@ const mapDispatchToProps = dispatch => {
}, },
clearStudyLoadingProgress: progressId => { clearStudyLoadingProgress: progressId => {
dispatch(clearStudyLoadingProgress(progressId)); dispatch(clearStudyLoadingProgress(progressId));
}, }
}; };
}; };
@@ -1,13 +1,13 @@
import { connect } from 'react-redux'; import { connect } from "react-redux";
import Viewer from './Viewer.js'; import Viewer from "./Viewer.js";
import OHIF from 'ohif-core'; import OHIF from "@ohif/core";
const { setTimepoints, setMeasurements } = OHIF.redux.actions; const { setTimepoints, setMeasurements } = OHIF.redux.actions;
const mapStateToProps = (state, ownProps) => { const mapStateToProps = (state, ownProps) => {
return { return {
viewports: state.viewports.viewportSpecificData, viewports: state.viewports.viewportSpecificData,
activeViewportIndex: state.viewports.activeViewportIndex, activeViewportIndex: state.viewports.activeViewportIndex
}; };
}; };
@@ -18,7 +18,7 @@ const mapDispatchToProps = dispatch => {
}, },
onMeasurementsUpdated: measurements => { onMeasurementsUpdated: measurements => {
dispatch(setMeasurements(measurements)); dispatch(setMeasurements(measurements));
}, }
}; };
}; };
@@ -1,10 +1,10 @@
import OHIF from 'ohif-core'; import OHIF from "@ohif/core";
import ViewerMain from './ViewerMain'; import ViewerMain from "./ViewerMain";
import { connect } from 'react-redux'; import { connect } from "react-redux";
const { const {
setViewportSpecificData, setViewportSpecificData,
clearViewportSpecificData, clearViewportSpecificData
} = OHIF.redux.actions; } = OHIF.redux.actions;
const mapStateToProps = state => { const mapStateToProps = state => {
@@ -14,7 +14,7 @@ const mapStateToProps = state => {
activeViewportIndex, activeViewportIndex,
layout, layout,
viewportSpecificData, viewportSpecificData,
viewports: state.viewports, viewports: state.viewports
}; };
}; };
@@ -25,7 +25,7 @@ const mapDispatchToProps = dispatch => {
}, },
clearViewportSpecificData: () => { clearViewportSpecificData: () => {
dispatch(clearViewportSpecificData()); dispatch(clearViewportSpecificData());
}, }
}; };
}; };
@@ -1,18 +1,18 @@
import './ToolbarRow.css'; import "./ToolbarRow.css";
import React, { Component } from 'react'; import React, { Component } from "react";
import { import {
RoundedButtonGroup, RoundedButtonGroup,
ToolbarButton, ToolbarButton,
ExpandableToolMenu, ExpandableToolMenu
} from 'react-viewerbase'; } from "react-viewerbase";
import { commandsManager, extensionManager } from './../App.js'; import { commandsManager, extensionManager } from "./../App.js";
import ConnectedCineDialog from './ConnectedCineDialog'; import ConnectedCineDialog from "./ConnectedCineDialog";
import ConnectedLayoutButton from './ConnectedLayoutButton'; import ConnectedLayoutButton from "./ConnectedLayoutButton";
import ConnectedPluginSwitch from './ConnectedPluginSwitch.js'; import ConnectedPluginSwitch from "./ConnectedPluginSwitch.js";
import { MODULE_TYPES } from 'ohif-core'; import { MODULE_TYPES } from "@ohif/core";
import PropTypes from 'prop-types'; import PropTypes from "prop-types";
class ToolbarRow extends Component { class ToolbarRow extends Component {
// TODO: Simplify these? isOpen can be computed if we say "any" value for selected, // TODO: Simplify these? isOpen can be computed if we say "any" value for selected,
@@ -23,7 +23,7 @@ class ToolbarRow extends Component {
selectedLeftSidePanel: PropTypes.string.isRequired, selectedLeftSidePanel: PropTypes.string.isRequired,
selectedRightSidePanel: PropTypes.string.isRequired, selectedRightSidePanel: PropTypes.string.isRequired,
handleSidePanelChange: PropTypes.func, handleSidePanelChange: PropTypes.func,
activeContexts: PropTypes.arrayOf(PropTypes.string).isRequired, activeContexts: PropTypes.arrayOf(PropTypes.string).isRequired
}; };
constructor(props) { constructor(props) {
@@ -41,7 +41,7 @@ class ToolbarRow extends Component {
this.state = { this.state = {
toolbarButtons: toolbarButtonDefinitions, toolbarButtons: toolbarButtonDefinitions,
activeButtons: [], activeButtons: [],
isCineDialogOpen: false, isCineDialogOpen: false
}; };
this._handleBuiltIn = _handleBuiltIn.bind(this); this._handleBuiltIn = _handleBuiltIn.bind(this);
@@ -51,12 +51,12 @@ class ToolbarRow extends Component {
left: [ left: [
// TODO: This should come from extensions, instead of being baked in // TODO: This should come from extensions, instead of being baked in
{ {
value: 'studies', value: "studies",
icon: 'th-large', icon: "th-large",
bottomLabel: 'Series', bottomLabel: "Series"
}, }
], ],
right: [], right: []
}; };
panelModules.forEach(panelExtension => { panelModules.forEach(panelExtension => {
@@ -74,9 +74,9 @@ class ToolbarRow extends Component {
const menuOptionEntry = { const menuOptionEntry = {
value: menuOption.target, value: menuOption.target,
icon: menuOption.icon, icon: menuOption.icon,
bottomLabel: menuOption.label, bottomLabel: menuOption.label
}; };
const from = menuOption.from || 'right'; const from = menuOption.from || "right";
this.buttonGroups[from].push(menuOptionEntry); this.buttonGroups[from].push(menuOptionEntry);
} }
@@ -90,7 +90,7 @@ class ToolbarRow extends Component {
if (activeContextsChanged) { if (activeContextsChanged) {
this.setState({ this.setState({
toolbarButtons: _getVisibleToolbarButtons.call(this), toolbarButtons: _getVisibleToolbarButtons.call(this)
}); });
} }
} }
@@ -103,25 +103,25 @@ class ToolbarRow extends Component {
); );
const cineDialogContainerStyle = { const cineDialogContainerStyle = {
display: this.state.isCineDialogOpen ? 'block' : 'none', display: this.state.isCineDialogOpen ? "block" : "none",
position: 'absolute', position: "absolute",
top: '82px', top: "82px",
zIndex: 999, zIndex: 999
}; };
const onPress = (side, value) => { const onPress = (side, value) => {
this.props.handleSidePanelChange(side, value); this.props.handleSidePanelChange(side, value);
}; };
const onPressLeft = onPress.bind(this, 'left'); const onPressLeft = onPress.bind(this, "left");
const onPressRight = onPress.bind(this, 'right'); const onPressRight = onPress.bind(this, "right");
return ( return (
<> <>
<div className="ToolbarRow"> <div className="ToolbarRow">
<div className="pull-left m-t-1 p-y-1" style={{ padding: '10px' }}> <div className="pull-left m-t-1 p-y-1" style={{ padding: "10px" }}>
<RoundedButtonGroup <RoundedButtonGroup
options={this.buttonGroups.left} options={this.buttonGroups.left}
value={this.props.selectedLeftSidePanel || ''} value={this.props.selectedLeftSidePanel || ""}
onValueChanged={onPressLeft} onValueChanged={onPressLeft}
/> />
</div> </div>
@@ -130,12 +130,12 @@ class ToolbarRow extends Component {
<ConnectedPluginSwitch /> <ConnectedPluginSwitch />
<div <div
className="pull-right m-t-1 rm-x-1" className="pull-right m-t-1 rm-x-1"
style={{ marginLeft: 'auto' }} style={{ marginLeft: "auto" }}
> >
{this.buttonGroups.right.length && ( {this.buttonGroups.right.length && (
<RoundedButtonGroup <RoundedButtonGroup
options={this.buttonGroups.right} options={this.buttonGroups.right}
value={this.props.selectedRightSidePanel || ''} value={this.props.selectedRightSidePanel || ""}
onValueChanged={onPressRight} onValueChanged={onPressRight}
/> />
)} )}
@@ -201,11 +201,11 @@ function _handleToolbarButtonClick(button, evt, props) {
// TODO: Use Types ENUM // TODO: Use Types ENUM
// TODO: We can update this to be a `getter` on the extension to query // TODO: We can update this to be a `getter` on the extension to query
// For the active tools after we apply our updates? // For the active tools after we apply our updates?
if (button.type === 'setToolActive') { if (button.type === "setToolActive") {
this.setState({ this.setState({
activeButtons: [button.id], activeButtons: [button.id]
}); });
} else if (button.type === 'builtIn') { } else if (button.type === "builtIn") {
this._handleBuiltIn(button.options); this._handleBuiltIn(button.options);
} }
} }
@@ -232,9 +232,9 @@ function _getVisibleToolbarButtons() {
} }
function _handleBuiltIn({ behavior } = {}) { function _handleBuiltIn({ behavior } = {}) {
if (behavior === 'CINE') { if (behavior === "CINE") {
this.setState({ this.setState({
isCineDialogOpen: !this.state.isCineDialogOpen, isCineDialogOpen: !this.state.isCineDialogOpen
}); });
} }
} }
Loaded 100 of 110 files, more files were not shown because too many files have changed in this diff. Show more