Installation

Include in project

Usage

Initialization

Initialize the neuropacs™ API.


  import com.neuropacs.Neuropacs

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

  // Initialize the API
  Neuropacs npcs = new Neuropacs(serverUrl, apiKey, originType);
          

Example

Working example using the neuropacs™ API.


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

  // Create a new order
  String conn = npcs.newJob();

  // Upload a dataset from path
  boolean upload = npcs.uploadDatasetFromPath(
    orderId, 
    "/path/to/dataset", 
    System.out::println // optional progress callback
  );

  // Start an order
  String orderStart = npcs.runJob(orderId, productName);

  // Check order status
  String status = npcs.checkStatus(orderId);

  // Retrieve job results
  String results = npcs.getResults(orderId, predictionFormat);

  // Retrieve job results in PNG
  byte[] resultsPng = npcs.getResultsPng(orderId);
  

Example viewing a PNG result

Download a PNG result file and view it.


  // Import required packages
  import javax.imageio.ImageIO;
  import java.awt.image.BufferedImage;
  import java.io.ByteArrayInpudtStream;
  import java.io.File;

  // Retrieve job results in PNG
  byte[] resultsPng = npcs.getResultsPng(orderId);

  // Convert byte[] to an InputStream
  ByteArrayInputStream bais = new ByteArrayInputStream(resultsPng);

  // Read the input stream into a BufferedImage
  BufferedImage image = ImageIO.read(bais);

  // Save the image to a file
  ImageIO.write(image, "png", new File("neuropacs_report.png"));
  

DICOMweb Integration

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


  // Define DICOMweb parameters
  String wadoUrl = "http://localhost:8080/dcm4chee-arc/aets/DCM4CHEE/rs";
  String studyUid = "1.3.12.2.1107.5.2.32.35162.30000022041820573832300000043";
  String username = "username"; // If not required, use null
  String password = "password"; // If not required, use null

  // Upload a dataset from DICOMweb
  boolean upload = await npcs.uploadDatasetFromDicomWeb(
    orderId,
    wadoUrl,
    studyUid,
    username,  
    password, 
    System.out::println // optional progress callback
  );
        

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.