Installation

Available bundles:

Name Size Description URL
neuropacs.js 36.5KB Unminified version, with debug https://d3tequ3xv41td3.cloudfront.net/js/neuropacs.js
neuropacs.min.js 13KB Production version, without debug https://d3tequ3xv41td3.cloudfront.net/js/neuropacs.min.js
neuropacs.module.js 13KB Production version, without debug, module https://d3tequ3xv41td3.cloudfront.net/js/neuropacs.module.js

Include in project

Option 2: Import via CDN

  1. Include this script tag within your html file:
  2. <script src="https://d22wr27dw196a9.cloudfront.net/neuropacs.min.js"></script>

Usage

Initialization

Initalize the neuropacs™ API.


  // Define neuropacs parameters
  const apiKey = "your_api_key" # API key
  const serverUrl = "server_url" # neuropacs™ serverl URL
  const productName = "Atypical/MSAp/PSP-v1.0" # Desired neuropacs™ product
  const predictionFormat = "JSON" # Output format of results
  const originType = "my_application" # Requestor origin

  // Initialize the API
  const npcs = Neuropacs.init({
      serverUrl: serverUrl,
      apiKey: apiKey,
      originType: originType
    });
          

Example

Working example using the neuropacs™ API.


  // Create a session
  const conn = await npcs.connect();

  // Create a new order
  const order_id = await npcs.newJob();

  // Upload a dataset from path
  const upload = await npcs.uploadDatasetFromFileArray({
    orderId: orderId,
    fileArray: dataset,
    callback: (info) => { // optional progress callback
      console.log(info);
    }
  });

  // Start an order
  const job = await npcs.runJob({
      orderId: orderId
      productName: productName
    });

  // Check order status
  const status = await npcs.checkStatus({
      orderId: orderId
    });

  // Retrieve job results
  const results = await npcs.getResults({
      orderId: orderId
      format: predictionFormat,
      dataType: predictionDataType
    });
          

Example viewing a PNG result

Download a PNG result file and view it.


  // Retrieve job results in 'PNG' format as a blob
  const results = await npcs.getResults({
      orderId: orderId
      format: "PNG",
      dataType: "blob"
  });

  // Create a link element
  const link = document.createElement("a");
  link.href = URL.createObjectURL(blob);
  link.download = filename;

  // Append link to the body (needed for Firefox)
  document.body.appendChild(link);

  // Trigger the download 
  link.click();

  // Remove the link 
  document.body.removeChild(link);
              

DICOMweb Integration

The API retrieves and processes images directly from DICOMweb WADO-RS servers, enabling neuropacs™ analysis for streamlined diagnostic workflows.


  // Define DICOMweb WADO-RS parameters
  const wadoUrl = "http://localhost:8080/dcm4chee-arc/aets/DCM4CHEE/rs"
  const studyUid = "1.3.12.2.1107.5.2.32.35162.30000022041820573832300000043"
  const username = "username"
  const password = "password"

  // Upload a dataset from DICOMweb
  const upload = await npcs.uploadDatasetFromDicomWeb({
    orderId: orderId,
    wadoUrl: wadoUrl,
    studyUid: studyUid,
    username: username,
    password: password,
    callback: (info) => { // optional progress callback
      console.log(info);
    }
  });
          

Contact

Kerrick Cavanaugh (Lead Software Engineer) - kerrick@neuropacs.com

License

This project is licensed under the MIT.

Explore

Integrations

Explore the different systems and software that our product integrates with. Click each integration for detailed setup and usage instructions.

Supported Programming Languages

Our product supports various programming languages to offer flexibility in development. Click each language for APIs, libraries, and examples.