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

diglettk

v1.1.0

Published

A medical imaging toolkit, built on top of vtk.js

Downloads

3

Readme

DigletTK

DigletTK is a library to interact with medical images in a 3d context, such as Multi Planar Reformat, MIP and Volume Rendering. It's based on vtk.js and takes inspiration from vue-vtksjs-viewport and react-vtkjs-viewport, but it is built to be agnostic with respect to frontend frameworks. It also provides glue-functions to easily integrate with cornerstone.js, via Larvitar library.

Install

  • yarn add diglettk

    OR

  • clone the repository and yarn add /path/to/repository

    OR

  • yarn add https://github.com/dvisionlab/DigletTK.git#master

Use

Examples and docs at http://diglettk.dvisionlab.com/. Short mpr version:

/** 
 Define viewports as:

 {
     key: String - The view id (must be unique)
     element: HTMLElement - The target rendering div
 }

 */

const targetElements = {
  top: {
    element: document.getElementById("viewer-1"),
    key: "top"
  },
  left: {
    element: document.getElementById("viewer-2"),
    key: "left"
  },
  front: {
    element: document.getElementById("viewer-3"),
    key: "front"
  }
};

// import DigletTK
import * as dtk from "DigletTK";

// load a dicom serie using larvitar glue function
dtk.loadSerieWithLarvitar(larvitar, serie => {
  let header = larvitar.buildHeader(serie);
  let data = larvitar.buildData(serie, false);
  // build vtk volume with larvitar
  const image = dtk.buildVtkVolume(header, data);
  // run mpr
  mpr = new dtk.MPRManager(targetElements);
  // get initial state obj: this object will be used to share data updates
  state = mpr.getInitialState();
  // set image
  mpr.setImage(state, image);
  // set active tool ("level" or "crosshair")
  mpr.setTool("level", state);
  // change view rotation
  mpr.onRotate("top", "x", 30, state);
  // change view MIP thickness
  mpr.onThickness("top", "x", 50, state);
});

DEV

yarn dev && cp ./dist/diglettk.js ./docs/examples/diglettk.js to build the lib and move it from dist folder to examples.

then load the desired example with a webserver (eg VS code liveserver).

yarn build to build the librery for production

yarn generate-docs to build the documentation in the documentation folder.

RoadMap

--

  • [x] Volume Rendering
  • [x] Measuring tools
  • [ ] Segmentations (Cornerstone.js >>> data >>> vtk.js)
  • [x] Colormaps
  • [ ] Multi Slice Image Mapper (a different MPR implementation)

TODO

  • [x] documentation
  • [x] ~~rollup config~~ webpack config
  • [x] examples
  • [x] npm package
  • [ ] webpack-dev-server for a better dev experience