Installation

Available bundles:

Name Size Description URL
neuropacs.js 43KB Unminified version, with debug https://d3tequ3xv41td3.cloudfront.net/js/neuropacs.js
neuropacs.min.js 15KB Production version, without debug https://d3tequ3xv41td3.cloudfront.net/js/neuropacs.min.js
neuropacs.module.js 15KB 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 order results ("TXT"/"JSON"/"XML"/"FEATURES")
  const qcFormat = "CSV" # Output format of QC results ("CSV"/"TXT"/"JSON")
  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 orderId = 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);
    }
  });

  // Run QC/Compliance check on uploaded dataset (not required)
  const qcResults = await npcs.qcCheck({
    orderId: orderId,
    format: qcFormat
  });

  // 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);
              

API Key Usage Report

Generate a structured API key usage report for any neuropacs™ API key. If an admin API key is used. An aggregated report will be created with all keys associated with the same institution. If "email" format is used, an email will be sent to the admin associated with the specified API key.


  // Define neuropacs parameters
  const apiKey = "your_api_key"; // API key
  const serverUrl = "https://your_neuropacs_url"; // neuropacs™ server URL
  const originType = "my_application"; // Requestor origin
  const format = "JSON"; // Format of report ("TXT"/"JSON"/"EMAIL")
  const startDate = "10/1/2024"; // Start date of report (mM/dD/YYYY)
  const endDate = "12/1/2025" // End date of report (mM/dD/YYYY)

  // Initialize the API
  const npcs = Neuropacs.init({
      serverUrl: serverUrl,
      apiKey: apiKey, // This API key will used to generate the report
      originType: originType
    });

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

  // Generate the report  
  const report = npcs.getReport({
    startDate: startDate,
    endDate: endDate,
    format: format
  });
          

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.