Skip to content

Add North Star Imaging (.nsipro) Geometry & Metadata File Support #2

@drockee

Description

@drockee

Summary

  • Add support for North Star Imaging (NSI) project/metadata files (*.nsipro). This functionality should parse .nsipro files from either the “Load Metadata” or “Geometry File” buttons, populate the geometry UI using fields from the file and call the existing "push" setter functions to set server-side geometry.

What to implement

  • Parser + importer

    • Provide a parser leapctserver.load_nsipro(path)
      • Implement parsing of .nsipro files (text-based NSI project files) to extract geometry parameters and other metadata: SOD, SDD, detector pixel sizes (width/height mm), num columns/rows, center row/col, number of projections, angular step/angular range, and any provided crop fields.
      • Handle unit conversions (inches->mm, microns->mm) and missing fields
  • UI wiring

    • Load MetaData button
      • The "Load MetaData" flow should allow selecting .nsipro files and call the server-side loader (leapctserver.load_nsipro(path)) — matching how .sct and .txt are handled. On success the GUI should refresh the geometry page so the pushed server geometry is reflected in the UI.
    • Update metadata file and geometry file open dialogs to allow selecting .nsipro files (file filters)
  • Crop / FOV mapping

    • If the NSI project contains a correction crop field ("left top right bottom" in pixels), compute diameter-of-FOV (mm) and center offsets and populate the volume page's dFOV edit / offset fields accordingly. Convert between pixels and mm using pixel size and SDD/SOD geometry as necessary.
  • Error handling and UI feedback

    • If parsing fails or fields are missing, show an informative dialog and allow users to continue with partial data.

Why

  • NSI .nsipro files are used for North Star Imaging CT scanning machines and contain geometry & metadata for scans. Supporting them directly improves usability, reduces user errors, and allows users to load scan metadata without manual entry.
  • Reuses existing "push" setter methods in the GUI and server API, which adds no risk to core reconstruction code.
  • Improves reproducibility and saves time migrating scans into LEAP.

Acceptance criteria

  1. UI elements & behavior
  • An import NSI project (.nsipro) flow exists in ct_geometry_page using the existing "Geometry File" button with .nsipro filter and in file_names_page using existing “Load MetaData” button with .nsipro filter.
  • When a .nsipro is selected/imported, LEAP GUI fields (sod, sdd, pixelWidth, pixelHeight, num cols/rows, centerCol, centerRow, numAngles, angular_range, numX,numY, numZ, Tx, Ty, Tz) are populated reflecting leapctserver parameters.
  • After import, the corresponding push_ methods are called so leap server parameters are updated.
  1. Parser
  • Importing partial .nsipro files still populates the fields that are present.
  • Handling of unit conversions where needed.
  1. Crop / FOV mapping
  • If the .nsipro contains a crop string, the importer computes and populates dFOV (diameter in mm) and detector center offsets (or populates NumX/NumY/NumZ/offsetXYZ where applicable) and updates relevant GUI field in ct_volume_page.py.

Files & entry points to change

  • file_names_page.py
    • Add .nsipro to the Load MetaData file dialog filters (so users can pick NSI project files).
    • When an .nsipro file is selected, call self.lctserver.load_nsipro(inputArg) (same style as loadsct or load_parameters)
  • ct_geometry_page.py
    • Implement import_nsipro_geometry(nsipro_path) that calls leapctserver.load_nsipro()
  • leapctserver.py
    • Add load_nsipro(path) server-side loader that parses common .nsipro tags, normalizes units, and updates leapctserver state via the existing set_cmd() method

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions