npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ng-cornerstone

v1.84.1

Published

[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier) [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.git

Downloads

393

Readme

NgCornerstone

code style: prettier Commitizen friendly

This library is an angular project for CornerStone3D It can be used as a viewport of DICOM images.

Install

Run ng add ng-cornerstone

Import Assets

Edit angular.json to import icon sprites files

...
"architect": {
  "build": {
      ...
      "assets": [
        ...
        {
          "glob": "**/*",
          "input": "./node_modules/ng-cornerstone/src/assets",
          "output": "/assets/"
        }
...

Usage

@NgModule({
    imports: [ViewerModule.forRoot()]
})
<nc-viewer
  [toolList]="toolList"
  [imageInfo]="imageInfo"
  [segmentInfo]="segmentInfo"
></nc-viewer>

ToolList support follow tools:
AngleTool, ArrowAnnotateTool, EllipticalROITool, LengthTool, PanTool, RectangleROITool, StackScrollTool, TrackballRotateTool, WindowLevelTool, ZoomTool, FlipV, FlipH, Rotate, Next, Previous, Coronal, Axial, Sagittal

ImageInfo should provide studyInstanceUID, seriesInstanceUID, urlRoot, viewportType, schema like:

Orthographic and WADO-RS

{
  studyInstanceUID: '1.3.6.1.4.1.14519.5.2.1.7009.2403.334240657131972136850343327463',
  seriesInstanceUID: '1.3.6.1.4.1.14519.5.2.1.7009.2403.226151125820845824875394858561',
  urlRoot: 'https://d1qmxk7r72ysft.cloudfront.net/dicomweb',
  viewportType: Enums.ViewportType.ORTHOGRAPHIC,
  schema: RequestSchema.WadoRs,
}

Volume3D

{
  viewportType: Enums.ViewportType.VOLUME_3D
}

Nifti

    imageInfos = [{
      studyInstanceUID: '1.2.392.200055.5.4.80861305518.20150928153455671288',
      seriesInstanceUID: '1.2.392.200036.9142.10002202.1020869001.2.20150928174647.30151',
      urlRoot: 'http://example.com/ABD_LYMPH_006/fe0ace7a-b70a-43bc-9eb0-52359b4d2241/Images/ABD_LYMPH_006.nii',
      // urlRoot: 'http://example.com/ABD_LYMPH_006/fe0ace7a-b70a-43bc-9eb0-52359b4d2241/Images/ABD_LYMPH_006.nii.gz',
      viewportType: Enums.ViewportType.VOLUME_3D,
      // viewportType: Enums.ViewportType.ORTHOGRAPHIC,
      schema: RequestSchema.nifti,
    }]

Segment

Segment is same type with ImageInfo but segmentType.

segmentType only support labelMap now

Surface and Contour is in develop

    imageInfos = [{
        segmentType: csToolEnum.SegmentationRepresentations.Labelmap,
    }]

Code structure

  1. ng-cornerstone is the library.
  2. ncv-example is an example app of ng-cornerstone
  3. ng-playground is an angular app depends on @cornerstonejs directly.

Optional: Enable WASM

To enable dynamic-import cornerstoneWADOImageLoader, you can use @angular-builders/custom-webpack. The angular json should like:

"architect": {
  "build": {
    "builder": "@angular-builders/custom-webpack:browser",
    "options": {
      "customWebpackConfig": {
        "path": "./extra-webpack.config.js",
        "mergeRules": {
          "externals": "replace"
        }
      },
      "assets": [
        ...
        {
        "glob": "**/*",
        "input": "./node_modules/@cornerstonejs/dicom-image-loader/dist/dynamic-import",
        "output": "/"
        }
      ]
    }
  }
}

extra-webpack.config.js should like:

module.exports = {
  resolve: {
    // We use this alias and the CopyPlugin below to support using the dynamic-import version
    // of WADO Image Loader, but only when building a PWA. When we build a package, we must use the
    // bundled version of WADO Image Loader so we can produce a single file for the viewer.
    // (Note: script-tag version of the viewer will no longer be supported in OHIF v3)
    alias: {
      '@cornerstonejs/dicom-image-loader':
        '@cornerstonejs/dicom-image-loader/dist/dynamic-import/cornerstoneDICOMImageLoader.min.js',
    },
  },
};

For more detail, refer to here

Enable SharedBufferArray

Edit angular.json add two headers:

...
"serve": {
  ...
  "options": {
    "host": "0.0.0.0",
    "headers": {
      "Cross-Origin-Embedder-Policy": "require-corp",
      "Cross-Origin-Opener-Policy": "same-origin"
    },
    ...
  },
...

You should also add the two header when deploy your app as a product.

Troubleshooting

If ng serve failed, try to edit tsconfig.json

{
  "compilerOptions": {
    "skipLibCheck": true
  }
}