From 7a7fae1cda90a2aedf7e22adf46e1569bda08733 Mon Sep 17 00:00:00 2001 From: Peter Newhook Date: Sun, 22 Dec 2024 16:51:12 -0500 Subject: [PATCH] Updating links to API from markdown documentation - Updated links in markdown to point to new API location - Fixing OHIF community link in header - Removed links to missing test coverage report - Small change in jsdoc of toLowHighRange because <= causes errors in Docusaurus --- packages/core/src/utilities/windowLevel.ts | 2 +- .../docs/concepts/cornerstone-core/imageLoader.md | 14 ++++++-------- .../docs/docs/concepts/cornerstone-core/images.md | 2 +- .../concepts/cornerstone-core/metadataProvider.md | 2 +- .../docs/concepts/cornerstone-core/volumeLoader.md | 5 ++--- .../cornerstone-tools/annotation/locking.md | 2 +- .../cornerstone-tools/annotation/selection.md | 2 +- .../cornerstone-tools/annotation/visibility.md | 2 +- .../concepts/cornerstone-tools/synchronizers.md | 2 +- .../docs/concepts/cornerstone-tools/toolGroups.md | 2 +- packages/docs/docs/getting-started/overview.md | 5 ++--- packages/docs/docusaurus.config.js | 2 +- packages/docs/sidebars.js | 6 +----- 13 files changed, 20 insertions(+), 28 deletions(-) diff --git a/packages/core/src/utilities/windowLevel.ts b/packages/core/src/utilities/windowLevel.ts index 70b12a8b01..a1fd6f70c7 100644 --- a/packages/core/src/utilities/windowLevel.ts +++ b/packages/core/src/utilities/windowLevel.ts @@ -30,7 +30,7 @@ function toWindowLevel( * * LINEAR (default): * - Uses the DICOM standard formula from C.11.2.1.2.1: - * if x <= c - 0.5 - (w-1)/2 => lower bound + * if x =< c - 0.5 - (w-1)/2 => lower bound * if x > c - 0.5 + (w-1)/2 => upper bound * * LINEAR_EXACT (C.11.2.1.3.2): diff --git a/packages/docs/docs/concepts/cornerstone-core/imageLoader.md b/packages/docs/docs/concepts/cornerstone-core/imageLoader.md index e61abcb910..d7a6426147 100644 --- a/packages/docs/docs/concepts/cornerstone-core/imageLoader.md +++ b/packages/docs/docs/concepts/cornerstone-core/imageLoader.md @@ -10,8 +10,7 @@ an [`Image Object`](./images.md). Since loading images usually requires a call t ## Image Loader Workflow - -1. `ImageLoaders` register themselves using [`registerImageLoader`](/api/core/namespace/imageLoader#registerImageLoader) API with cornerstone to load specific ImageId URL schemes +1. `ImageLoaders` register themselves using [`registerImageLoader`](/docs/api/core/namespaces/imageloader/functions/registerimageloader) API with cornerstone to load specific ImageId URL schemes 2. The application requests to load an image using the `loadImage` API for stack or `createAndCacheVolume` API for volume. 3. Cornerstone delegates the request to load the image to the `ImageLoader` registered with the URL scheme of the imageId. 4. The ImageLoader will return an `Image Load Object` containing a Promise which it will resolve with the corresponding Image Object once it has obtained the pixel data. Obtaining the pixel data may require a call to a remote server using `XMLHttpRequest`, decompression of the pixel data (e.g. from JPEG 2000), and conversion of the pixel data into the format that Cornerstone understands (e.g. RGB vs YBR color). @@ -19,15 +18,15 @@ an [`Image Object`](./images.md). Since loading images usually requires a call t ## Register Image Loader -You can use [`registerImageLoader`](/api/core/namespace/imageLoader#registerImageLoader) to make an external image loader available to the +You can use [`registerImageLoader`](/docs/api/core/namespaces/imageloader/functions/registerimageloader) to make an external image loader available to the cornerstone library. This function accept a `scheme` which the image loader function (second argument) should act on. ## Available Image Loaders -| Image Loader | Used for | -| ------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| [Cornerstone DICOM Image Loader](https://github.com/cornerstonejs/cornerstone3D/tree/main/packages/dicomImageLoader) | DICOM Part 10 images; Supports WADO-URI and WADO-RS; Supports multi-frame DICOM instances; Supports reading DICOM files from the File objects | -| [Cornerstone Web Image Loader](https://github.com/cornerstonejs/cornerstoneWebImageLoader) | PNG and JPEG | +| Image Loader | Used for | +| ----------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | +| [Cornerstone DICOM Image Loader](https://github.com/cornerstonejs/cornerstone3D/tree/main/packages/dicomImageLoader) | DICOM Part 10 images; Supports WADO-URI and WADO-RS; Supports multi-frame DICOM instances; Supports reading DICOM files from the File objects | +| [Cornerstone Web Image Loader](https://github.com/cornerstonejs/cornerstoneWebImageLoader) | PNG and JPEG | | [Cornerstone-nifti-image-loader](https://github.com/cornerstonejs/cornerstone3D/tree/main/packages/nifti-volume-loader) | NIFTI | ### CornerstoneDICOMImageLoader @@ -40,7 +39,6 @@ import { init } from '@cornerstonejs/dicom-image-loader'; init({ maxWebWorkers: navigator.hardwareConcurrency || 1, }); - ``` After initialization of the `CornerstoneDICOMImageLoader`, any imageId using the `wado-uri` scheme will be loaded using the `CornerstoneDICOMImageLoader` diff --git a/packages/docs/docs/concepts/cornerstone-core/images.md b/packages/docs/docs/concepts/cornerstone-core/images.md index 85b837bec8..87f1fe9d16 100644 --- a/packages/docs/docs/concepts/cornerstone-core/images.md +++ b/packages/docs/docs/concepts/cornerstone-core/images.md @@ -8,7 +8,7 @@ title: Image Object Cornerstone [Image Loaders](./imageLoader.md) return `Image Load Objects` which contain a Promise. The reason we have chosen to use an Object instead of solely returning a Promise is because now Image Loaders can also return other properties in their Image Load Objects. As an example, we intend to implement support for `cancelling` pending or ongoing requests using a `cancelFn` passed back by an Image Loader within an Image Load Object. Here is an interface of such Image Load Object. You can read more about each -field in the [IImage section](/api/core/namespace/Types#IImage) of API reference. +field in the [IImage section](/docs/api/core/namespaces/Types/interfaces/IImage) of API reference. ```js interface IImage { diff --git a/packages/docs/docs/concepts/cornerstone-core/metadataProvider.md b/packages/docs/docs/concepts/cornerstone-core/metadataProvider.md index 2b9f9c73ca..a1887242c2 100644 --- a/packages/docs/docs/concepts/cornerstone-core/metadataProvider.md +++ b/packages/docs/docs/concepts/cornerstone-core/metadataProvider.md @@ -29,7 +29,7 @@ and if any metadata provider can provide that type for the given image ID, you g example, to easily provide application-specific information such as ground truth or patient information. Cornerstone core and tools also automatically request various types of metadata for displayed images. A list of standard -metadata modules can be found in the [MetadataModules section](/api/core/namespace/Enums#MetadataModules) of the API reference. +metadata modules can be found in the [MetadataModules section](/docs/api/core/namespaces/enums/enumerations/metadatamodules/) of the API reference. Many of these modules conform to the DICOM standard. If you want to implement them in a [custom metadata provider](../../how-to-guides/custom-metadata-provider.md), it is easiest to look at how an existing metadata provider implements them, such as the [WADOURI metadata diff --git a/packages/docs/docs/concepts/cornerstone-core/volumeLoader.md b/packages/docs/docs/concepts/cornerstone-core/volumeLoader.md index 026c4034fa..4bee5f4009 100644 --- a/packages/docs/docs/concepts/cornerstone-core/volumeLoader.md +++ b/packages/docs/docs/concepts/cornerstone-core/volumeLoader.md @@ -15,11 +15,11 @@ of the 2D images (`imageIds`) into a 3D volume and it is the default volume load ## Register Volume Loaders -You can use [`registerVolumeLoader`](/api/core/namespace/volumeLoader#registerVolumeLoader) to define a volume loader which should be called on a particular `scheme`. +You can use [`registerVolumeLoader`](/docs/api/core/namespaces/volumeloader/functions/registervolumeloader) to define a volume loader which should be called on a particular `scheme`. Below you can see a simplified code for our `cornerstoneStreamingImageVolumeLoader` in which: 1. Based on a set of imageIds, we compute volume metadata such as: spacing, origin, direction, etc. -2. Instantiate a new [`StreamingImageVolume`](/api/streaming-image-volume-loader/class/StreamingImageVolume) +2. Instantiate a new [`StreamingImageVolume`](/docs/api/core/classes/streamingimagevolume/) - `StreamingImageVolume` implements methods for loading (`.load`) - It implements load via using `imageLoadPoolManager` @@ -93,7 +93,6 @@ const volume = await volumeLoader.createAndCacheVolume(volumeId, { By default if no `volumeLoader` is found for the scheme, the `unknownVolumeLoader` is used. `cornerstoneStreamingImageVolumeLoader` is the default unknown volume loader. - :::info Even if you don't provide the scheme, the `cornerstoneStreamingImageVolumeLoader` will be used by default. diff --git a/packages/docs/docs/concepts/cornerstone-tools/annotation/locking.md b/packages/docs/docs/concepts/cornerstone-tools/annotation/locking.md index 5c31b808f5..158a380ca8 100644 --- a/packages/docs/docs/concepts/cornerstone-tools/annotation/locking.md +++ b/packages/docs/docs/concepts/cornerstone-tools/annotation/locking.md @@ -28,5 +28,5 @@ annotation.locking.unlockAllAnnotations(); ## Read more :::note TIP -Read more about the locking API [here](/api/tools/namespace/annotation#locking) +Read more about the locking API [here](/docs/api/tools/namespaces/annotation/namespaces/locking) ::: diff --git a/packages/docs/docs/concepts/cornerstone-tools/annotation/selection.md b/packages/docs/docs/concepts/cornerstone-tools/annotation/selection.md index 532c0cc822..6ed12b2138 100644 --- a/packages/docs/docs/concepts/cornerstone-tools/annotation/selection.md +++ b/packages/docs/docs/concepts/cornerstone-tools/annotation/selection.md @@ -31,5 +31,5 @@ annotation.selection.getAnnotationsSelectedByToolName(toolName); ## Read more :::note TIP -Read more about the selection API [**here**](/api/tools/namespace/annotation#selection) +Read more about the selection API [**here**](/docs/api/tools/namespaces/annotation/namespaces/selection/) ::: diff --git a/packages/docs/docs/concepts/cornerstone-tools/annotation/visibility.md b/packages/docs/docs/concepts/cornerstone-tools/annotation/visibility.md index c3c80511b1..b666f4025e 100644 --- a/packages/docs/docs/concepts/cornerstone-tools/annotation/visibility.md +++ b/packages/docs/docs/concepts/cornerstone-tools/annotation/visibility.md @@ -32,5 +32,5 @@ annotation.visibility.isAnnotationVisible(annotationUID); ## Read more :::note TIP -Read more about the visibility API [here](/api/tools/namespace/annotation#visibility) +Read more about the visibility API [here](/docs/api/tools/namespaces/annotation/namespaces/visibility) ::: diff --git a/packages/docs/docs/concepts/cornerstone-tools/synchronizers.md b/packages/docs/docs/concepts/cornerstone-tools/synchronizers.md index 148fb4a6eb..825127ffc0 100644 --- a/packages/docs/docs/concepts/cornerstone-tools/synchronizers.md +++ b/packages/docs/docs/concepts/cornerstone-tools/synchronizers.md @@ -7,7 +7,7 @@ title: Synchronizers Synchronizers can be used to link particular actions across viewports (e.g. sync pan/zoom interaction), but they can also be used to tie any callback to a particular event. Synchronizers require: -- An [`Event`](/api/core/namespace/Enums#Events) to listen for +- An [`Event`](/docs/api/core/namespaces/enums/enumerations/events) to listen for - A function to call when that event is raised on a source viewport - An array of `source` viewports - An array of `target` viewports diff --git a/packages/docs/docs/concepts/cornerstone-tools/toolGroups.md b/packages/docs/docs/concepts/cornerstone-tools/toolGroups.md index f4fa7f2c9d..74a60f3912 100644 --- a/packages/docs/docs/concepts/cornerstone-tools/toolGroups.md +++ b/packages/docs/docs/concepts/cornerstone-tools/toolGroups.md @@ -102,7 +102,7 @@ Other methods for managing ToolGroups are available via `ToolGroupManager`. ### `getToolGroupForViewport` -returns the ToolGroup for a given viewport, read more [here](/api/tools/namespace/ToolGroupManager#getToolGroupForViewport) +returns the ToolGroup for a given viewport, read more [here](/docs/api/tools/namespaces/toolgroupmanager/functions/gettoolgroupforviewport) ### `getToolGroup` diff --git a/packages/docs/docs/getting-started/overview.md b/packages/docs/docs/getting-started/overview.md index e1ccbd81d6..fbf0bb9396 100644 --- a/packages/docs/docs/getting-started/overview.md +++ b/packages/docs/docs/getting-started/overview.md @@ -100,12 +100,11 @@ Our documentation can be broken down into the following sections: - [**How-to-Guides**](/docs/category/how-to-guides): provides guides for more advanced tasks such as custom loaders, custom metadata providers - [**Concepts**](/docs/category/concepts): explains an in-depth look at various technical concepts that are used in the library - [**Contributing**](/docs/category/contributing/): explains how to contribute to the project and how to report bugs -- [**Migration Guides**](/docs/migrationGuides): includes instructions for upgrading from legacy to new versions of the library, and also upgrading from 1.x to 2.x +- [**Migration Guides**](/docs/migration-guides/2x/general): includes instructions for upgrading from legacy to new versions of the library, and also upgrading from 1.x to 2.x - [**FAQ**](/docs/faq): provides answers to frequently asked questions - [**Help**](/docs/help): provides information of how to get help with the library -- [**Test Coverage Report**](/test-coverage/): provides a detailed report of the test coverage of the library - [**Examples**](/docs/examples): Displays the live examples of the library -- [**API Reference**](/api): provides a detailed description of the API and how to use each function +- [**API Reference**](/docs/api/core): provides a detailed description of the API and how to use each function If a page is no longer up-to-date, you can author a PR to update it by modifying the files in `/packages/docs/docs/*.md`. Read more on how to contribute [here](../contribute/pull-request.md). diff --git a/packages/docs/docusaurus.config.js b/packages/docs/docusaurus.config.js index 5d8345d099..0fe47fb297 100644 --- a/packages/docs/docusaurus.config.js +++ b/packages/docs/docusaurus.config.js @@ -42,7 +42,7 @@ module.exports = { label: 'Examples', }, { - href: 'https://ohif.org/community/', + href: 'https://ohif.org/collaborate', position: 'left', label: 'Community', }, diff --git a/packages/docs/sidebars.js b/packages/docs/sidebars.js index ecd4a83eca..d86738ec15 100644 --- a/packages/docs/sidebars.js +++ b/packages/docs/sidebars.js @@ -212,6 +212,7 @@ module.exports = { 'concepts/cornerstone-tools/annotation/state', 'concepts/cornerstone-tools/annotation/annotationManager', 'concepts/cornerstone-tools/annotation/selection', + 'concepts/cornerstone-tools/annotation/visibility', 'concepts/cornerstone-tools/annotation/locking', 'concepts/cornerstone-tools/annotation/config', 'concepts/cornerstone-tools/annotation/annotationGroups', @@ -283,11 +284,6 @@ module.exports = { }, 'faq', 'help', - { - type: 'link', - label: 'Test Coverage Report', - href: 'pathname:///test-coverage', - }, 'examples', ], };