Skip to content

Commit

Permalink
Updating links to API from markdown documentation
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
pnewhook committed Dec 22, 2024
1 parent df90c42 commit 7a7fae1
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 28 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/utilities/windowLevel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
14 changes: 6 additions & 8 deletions packages/docs/docs/concepts/cornerstone-core/imageLoader.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,23 @@ 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).
5. The [Image Object](./images.md) passed back by the resolved Promise is then displayed using `renderingEngine` API.

## 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
Expand All @@ -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`
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/docs/concepts/cornerstone-core/images.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions packages/docs/docs/concepts/cornerstone-core/volumeLoader.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down Expand Up @@ -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.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
:::
Original file line number Diff line number Diff line change
Expand Up @@ -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/)
:::
Original file line number Diff line number Diff line change
Expand Up @@ -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)
:::
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand Down
5 changes: 2 additions & 3 deletions packages/docs/docs/getting-started/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
2 changes: 1 addition & 1 deletion packages/docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ module.exports = {
label: 'Examples',
},
{
href: 'https://ohif.org/community/',
href: 'https://ohif.org/collaborate',
position: 'left',
label: 'Community',
},
Expand Down
6 changes: 1 addition & 5 deletions packages/docs/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -283,11 +284,6 @@ module.exports = {
},
'faq',
'help',
{
type: 'link',
label: 'Test Coverage Report',
href: 'pathname:///test-coverage',
},
'examples',
],
};

0 comments on commit 7a7fae1

Please sign in to comment.