ohif-viewer/platform/docs/docusaurus.config.js
Alireza 83ea228d86
feat: Add DICOM SEG support and MPR, referenceLines and StackSync and more (#3015)
* feat: add initial sop class handler for SEG

* feat: move segmentation service

* update segmentation service methods

* fix: viewport data structure

* feat: Add initial render for the DICOM SEG for each displaySet

* fix: various wrong architectural dependencies between services

* feat: initial separate SEG display in each viewport

* feat: refactore viewport action bar

* initial work for SEG hydration

* fix: various bugs regarding drag and dropping different viewports

* fix: rendering issues for multiple seg displaysets

* fix: bugs for thumbnail and hydration

* feat: fix the initial segment color

* update after rebase

* feat: initial design for the segmentation group table

* feat: initial new design for the segmentation panel

* feat: segmentation panel

* feat: make segmentation appear on all related viewports

* fix: segmentation load bug based on functional groups

* initial work for segmentation crosshairs

* fix: various stylings and functionality

* fix: various stylings for the seg panel

* fix: overflow styles

* feat: add more ui components

* feat: added segmentation config

* feat: add jump to segment

* feat: add jump to segment for DICOM SEG viewport

* fix: bugs after rebase

* feat: jump in segmentation viewport

* fix: mpr support for seg

* feat: add more icons

* feat: new icons

* feat: add new side panel

* feat: add segmentation config

* feat: add loading indicator to ohif

* feat: make hanging protocols follow matching rules for viewports

* feat: enhance drag and drop to be hanging protocol aware

* fix: mpr restore previous layout

* fix: crosshairs toggle

* fix: add auth headers to the dicom loader via dicomwebclient

* fix: bug for crosshairs toggle in mpr

* fix: seg viewport reusing old toolGroup

* feat: add loading animation with lottie

* fix: various bugs for Segmentation hydration in mpr

* feat: change outline alpha to outline opacity

* feat: loading indicator for seg viewport

* fix: various segmentation group styles

* fix: local mode for seg

* feat: add animation for the highlight

* fix: loading indicatro to show segment indices

* feat: enhance modality drop down ui

* fix: panels

* fix: download form

* fix: layout shift in loading indicator

* fix: loading indicator to have correct values

* fix: update software number

* fix: image jump between MPR and default

* fix: segmentation cleanup and cine service cleanup

* fix: segmentation toolgroup clena up

* fix: highlight interval should not trigger again

* fix: issue with multiframe sorting

* rename: change onSeriesChange to onArrowsClick

* fix: buttons for tmtv and layout shift

* fix: various bugs wrt crosshairs

* fix: crosshairs re init on reset camera

* fix: middle slice calculation different from cs middle reset camera

* fix: reset camera should reset viewport camera

* fix: loading segments in MPR mode

* fix: tmtv hp back to before

* fix: layout shift

* feat: orientation markers for volume viewport

* fix: capture for volume viewports

* fix: memory leak for back to worklist

* fix: loading bar bg color

* fix: side panel for only one panel

* fix: react select style in production

* fix: various styling for segmentation groups

* fix: various ui styles

* feat: add new segmentation config styles

* fix: hover state for segmentation item

* fix: side panel layout shift

* temp add panels

* try to fix scrollbar for thimbnail

* fix: scroll not appearing for side panels

* feat: changed styles for scrollbar

* feat: add cpu fallback warning

* fix: webworker destroy

* fix: select styles

* fix: orientation marker color and position

* fix: capture screenshot for volume viewports

* fix: hide segment visibility on mpr

* fix: reloading an already loaded seg displayset

* feat: add is equal

* fix: mpr jump to measurements

* apply review comments

* fix: optimization for the segmentation load

* fix: remove unnecessary context menu and hp service reset

* fix: segmentation service wrt brush settings

* feat: initial work for the stack synchronization

* fix: add validateDisplaySetSelectorsForNewDisplaySets to make sure drag and drop can follow requirements

* fix: various react proptypes

* fix: thumbnails for the tmtv and change default props to default params

* feat: make showing loading indicator configurable and add docs

* bump versions and add more docs

* fix demo

* update cornerstone versions

* apply review comments

* feat: add reference lines

* fix build

* fix unit tests

* add reference lines icon

* fix: e2e tests

* fix static wado config

* docs: add segmentation service docs

* fix: docker build

* fix: keep camera and bump versions

* Try re-enabling minification to fix deploy previews

Co-authored-by: Erik Ziegler <erik.sweed@gmail.com>
2022-11-16 14:19:52 -05:00

438 lines
13 KiB
JavaScript

/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
const path = require('path');
const versions = require('./versions.json');
const VersionsArchived = require('./versionsArchived.json');
const ArchivedVersionsDropdownItems = Object.entries(VersionsArchived).splice(
0,
5
);
// This probably only makes sense for the beta phase, temporary
// function getNextBetaVersionName() {
// const expectedPrefix = '';
// const lastReleasedVersion = versions[0];
// if (!lastReleasedVersion.includes(expectedPrefix)) {
// throw new Error(
// 'this code is only meant to be used during the 2.0 beta phase.'
// );
// }
// const version = parseInt(lastReleasedVersion.replace(expectedPrefix, ''), 10);
// return `${expectedPrefix}${version + 1}`;
// }
// const allDocHomesPaths = [
// '/docs/',
// '/docs/next/',
// ...versions.slice(1).map(version => `/docs/${version}/`),
// ];
const isDev = process.env.NODE_ENV === 'development';
const isDeployPreview =
process.env.NETLIFY && process.env.CONTEXT === 'deploy-preview';
const baseUrl = process.env.BASE_URL || '/';
const isBootstrapPreset = process.env.DOCUSAURUS_PRESET === 'bootstrap';
// Special deployment for staging locales until they get enough translations
// https://app.netlify.com/sites/docusaurus-i18n-staging
// https://docusaurus-i18n-staging.netlify.app/
const isI18nStaging = process.env.I18N_STAGING === 'true';
// const isVersioningDisabled = !!process.env.DISABLE_VERSIONING || isI18nStaging;
/** @type {import('@docusaurus/types').DocusaurusConfig} */
module.exports = {
title: 'OHIF',
tagline: 'Open-source web-based medical imaging platform',
organizationName: 'Open Health Imaging Foundation',
projectName: 'OHIF',
baseUrl,
baseUrlIssueBanner: true,
url: 'https://v3-docs.ohif.org',
i18n: {
defaultLocale: 'en',
locales: isDeployPreview
? // Deploy preview: keep it fast!
['en']
: isI18nStaging
? // Staging locales: https://docusaurus-i18n-staging.netlify.app/
['en']
: // Production locales
['en'],
},
onBrokenLinks: 'warn',
onBrokenMarkdownLinks: 'warn',
favicon: 'img/favicon.ico',
// customFields: {
// description:
// 'An optimized site generator in React. Docusaurus helps you to move fast and write content. Build documentation websites, blogs, marketing pages, and more.',
// },
themes: ['@docusaurus/theme-live-codeblock'],
plugins: [
path.resolve(__dirname, './pluginOHIFWebpackConfig.js'),
'plugin-image-zoom', // 3rd party plugin for image click to pop
[
'@docusaurus/plugin-google-gtag',
{
trackingID: 'UA-110573590-2',
},
],
[
'@docusaurus/plugin-client-redirects',
{
fromExtensions: ['html'],
redirects: [
{
// we need this for https://cloud.google.com/healthcare/docs/how-tos/dicom-viewers
to: '/2.0/deployment/recipes/google-cloud-healthcare',
from: [
'/connecting-to-image-archives/google-cloud-healthcare',
'/connecting-to-image-archives/google-cloud-healthcare.html',
],
},
],
// createRedirects: function(path) {
// // redirect to /docs from /docs/introduction,
// // as introduction has been made the home doc
// // if (allDocHomesPaths.includes(path)) {
// // return [`${path}/introduction`];
// // }
// if (path.includes("/connecting-to-image-archives/google-cloud-healthcare")) {
// return ["/deployment/recipes/google-cloud-healthcare"]
// }
// },
// redirects: [
// {
// from: ['/'],
// to: '/docs',
// },
// {
// from: ['/docs/support', '/docs/next/support'],
// to: '/community/support',
// },
// {
// from: ['/docs/team', '/docs/next/team'],
// to: '/community/team',
// },
// {
// from: ['/docs/resources', '/docs/next/resources'],
// to: '/community/resources',
// },
// ],
},
],
[
'@docusaurus/plugin-ideal-image',
{
quality: 70,
max: 1030, // max resized image's size.
min: 640, // min resized image's size. if original is lower, use that size.
steps: 2, // the max number of images generated between min and max (inclusive)
},
],
// [
// '@docusaurus/plugin-pwa',
// {
// debug: isDeployPreview,
// offlineModeActivationStrategies: [
// 'appInstalled',
// 'standalone',
// 'queryString',
// ],
// // swRegister: false,
// // swCustom: path.resolve(__dirname, 'src/sw.js'),
// pwaHead: [
// {
// tagName: 'link',
// rel: 'icon',
// href: 'img/docusaurus.png',
// },
// {
// tagName: 'link',
// rel: 'manifest',
// href: `${baseUrl}manifest.json`,
// },
// {
// tagName: 'meta',
// name: 'theme-color',
// content: 'rgb(37, 194, 160)',
// },
// {
// tagName: 'meta',
// name: 'apple-mobile-web-app-capable',
// content: 'yes',
// },
// {
// tagName: 'meta',
// name: 'apple-mobile-web-app-status-bar-style',
// content: '#000',
// },
// {
// tagName: 'link',
// rel: 'apple-touch-icon',
// href: 'img/docusaurus.png',
// },
// {
// tagName: 'link',
// rel: 'mask-icon',
// href: 'img/docusaurus.svg',
// color: 'rgb(62, 204, 94)',
// },
// {
// tagName: 'meta',
// name: 'msapplication-TileImage',
// content: 'img/docusaurus.png',
// },
// {
// tagName: 'meta',
// name: 'msapplication-TileColor',
// content: '#000',
// },
// ],
// },
// ]
],
presets: [
[
'classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
debug: true, // force debug plugin usage
docs: {
routeBasePath: '/',
path: 'docs',
sidebarPath: require.resolve('./sidebars.js'),
editUrl: ({ locale, docPath }) => {
/*if (locale !== 'en') {
return `https://crowdin.com/project/docusaurus-v2/${locale}`;
}*/
// We want users to submit doc updates to the upstream/next version!
// Otherwise we risk losing the update on the next release.
return `https://github.com/OHIF/Viewers/edit/v3-stable/platform/docs/docs/${docPath}`;
},
showLastUpdateAuthor: true,
showLastUpdateTime: true,
// remarkPlugins: [
// [require('@docusaurus/remark-plugin-npm2yarn'), { sync: true }],
// ],
// disableVersioning: isVersioningDisabled,
lastVersion: 'current',
// onlyIncludeVersions:
// !isVersioningDisabled && (isDev || isDeployPreview)
// ? ['current', ...versions.slice(0, 2)]
// : undefined,
versions: {
current: {
label: 'Version 3.3 - Segmentation Support 🚧',
},
'2.0': {
label: 'Version 2.0 - Master branch',
},
},
},
theme: {
customCss: [require.resolve('./src/css/custom.css')],
},
}),
],
],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
liveCodeBlock: {
playgroundPosition: 'bottom',
},
docs: {
sidebar: {
hideable: true,
autoCollapseCategories: true,
},
},
colorMode: {
defaultMode: 'dark',
disableSwitch: false,
// respectPrefersColorScheme: true,
},
/*
announcementBar: {
id: 'supportus',
content:
'⭐️ If you like Docusaurus, give it a star on <a target="_blank" rel="noopener noreferrer" href="https://github.com/OHIF/Viewers">GitHub</a>! ⭐️',
},
*/
prism: {
theme: require('prism-react-renderer/themes/github'),
darkTheme: require('prism-react-renderer/themes/dracula'),
},
algolia: {
appId: 'EFLT6YIHHZ',
apiKey: 'c220dd24fe4f86248eea3b1238a1fb60',
indexName: 'ohif',
},
navbar: {
hideOnScroll: false,
logo: {
alt: 'OHIF Logo',
src: 'img/ohif-logo-light.svg',
srcDark: 'img/ohif-logo.svg',
},
items: [
{
to: 'https://ohif.org/get-started',
label: 'Get Started',
target: '_self',
position: 'left',
},
{
to: 'https://ohif.org/examples',
label: 'Examples',
target: '_self',
position: 'left',
},
{
position: 'left',
to: '/',
activeBaseRegex: '^(/next/|/)$',
docId: 'Introduction',
label: 'Docs',
},
{
to: 'https://ohif.org/community',
label: 'Community',
target: '_self',
position: 'left',
},
{
to: '/help',
//activeBaseRegex: '(^/help$)|(/help)',
label: 'Help',
position: 'right',
},
{
type: 'docsVersionDropdown',
position: 'right',
dropdownActiveClassDisabled: true,
dropdownItemsAfter: [
{
type: 'html',
value: '<hr class="dropdown-separator">',
},
{
type: 'html',
className: 'dropdown-archived-versions',
value: '<b>Archived versions</b>',
},
...ArchivedVersionsDropdownItems.map(
([versionName, versionUrl]) => ({
label: versionName,
href: versionUrl,
})
),
{
type: 'html',
value: '<hr class="dropdown-separator">',
},
{
to: '/versions',
label: 'All versions',
},
],
},
{
type: 'localeDropdown',
position: 'right',
dropdownItemsAfter: [
{
to: '/platform/internationalization',
label: 'Help Us Translate',
},
],
},
{
to: 'https://github.com/OHIF/Viewers',
position: 'right',
className: 'header-github-link',
'aria-label': 'GitHub Repository',
},
],
},
footer: {
style: 'dark',
links: [
{
title: ' ',
items: [
{
// This doesn't show up on dev for some reason, but displays in build
html: `
<a href="https://www.massgeneral.org/" target="_blank" rel="noreferrer noopener">
<img src="/img/mgh-logo.png" id="mgh-logo" alt="MGH" />
</a>
`,
},
],
},
{
title: 'Learn',
items: [
{
label: 'Introduction',
to: '/',
},
{
label: 'Installation',
to: 'development/getting-started',
},
],
},
{
title: 'Community',
items: [
{
label: 'Discussion board',
to: 'https://community.ohif.org/',
},
{
label: 'Help',
to: '/help',
},
],
},
{
title: 'More',
items: [
{
label: 'Donate',
to: 'https://giving.massgeneral.org/ohif',
},
{
label: 'GitHub',
to: 'https://github.com/OHIF/Viewers',
},
{
label: 'Twitter',
to: 'https://twitter.com/OHIFviewer',
},
],
},
],
logo: {
alt: 'OHIF ',
src: 'img/netlify-color-accent.svg',
href: 'https://v3-demo.ohif.org/',
},
copyright: `OHIF is open source software released under the MIT license.`,
},
}),
};