Medlea

Docs /Command-Line Client

Projects and Geometries

Besides patients, the client can create projects from a 3D surface file and add further geometries to them. Projects belong to the Engineering workflow (see Importing Geometry), so use an account that has that workflow available. Before you start, sign in.

Files it accepts

STL or VTP surface files, with any capital letters in the extension (.stl, .STL, .vtp). The geometry is read in millimetres. Empty files, folders and other formats are refused before anything is sent.

One project

climed-client create-project --name "Aorta Model" --file /data/models/aorta.stl -d demo_db
OptionMeaning
--nameThe project name
--fileThe STL or VTP file
-dThe database. Left out, the account’s only database is used

On success it prints one line, <project-id> <device-id> <version-id>; with --json, an object with ID, EID and AID. The project is in your project list, with the file as its first geometry.

  • A project with that name already exists in the database: nothing is created or changed (exit status 2).
  • The file cannot be imported: the project just created is removed again, so a failure never leaves an empty project behind.

Many projects at once

create-project-batch creates one project per file, with the same rules for each.

From a folder. Every STL or VTP file directly in the folder becomes a project, named after the file without its extension. Sub-folders, hidden files and files of other types are ignored (the number of ignored files is reported).

models/
├── Aorta Model.stl         <- project "Aorta Model"
├── Femoral Stent.vtp       <- project "Femoral Stent"
├── notes.txt               <- ignored
└── archive/                <- ignored
climed-client create-project-batch --root models -d demo_db

From a list. A CSV file with the header name,path (or a JSON list of {"name", "path"} objects). Relative paths start from the folder that contains the list.

name,path
Aorta Model,/data/models/aorta.stl
Femoral Stent,/data/models/stent_v2.vtp
climed-client create-project-batch --manifest projects.csv -d demo_db

As for patients, the whole input is checked before the first upload (a missing or empty file, a wrong type, an empty or repeated name), --dry-run shows the plan without sending anything, a failure does not stop the others, an existing project is skipped, and running the same command again only does what is left. The summary reads, for example, done: 2 imported, 1 skipped (already present), 0 failed, 0 not attempted. See Loading Patients for the details.

Adding a geometry to a project

A project can hold more geometries than the first one, for example a device placed in a vessel (see Implant Devices). Use the three identifiers printed by create-project:

climed-client add-geometry --project <project-id> --eid <device-id> --aid <version-id> \
                           --file /data/models/stent.stl --name "Femoral Stent" --purpose obstacle
OptionMeaning
--project, --eid, --aidThe project, device and version, as printed by create-project
--fileThe STL or VTP file
--nameThe name shown for this geometry
--purposeobstacle (default): a solid in the flow. reference: shown for context only, not part of the flow. The same two choices as the web app
--descriptionFree text, optional

It prints the identifier of the new geometry. Chained in a script:

read PROJECT DEVICE VERSION < <(climed-client create-project --name "Aorta Model" --file aorta.stl)
climed-client add-geometry --project "$PROJECT" --eid "$DEVICE" --aid "$VERSION" \
                           --file stent.stl --name "Femoral Stent"

Good to know

  • Name and file only. Everything else (flow type, conditions, simulation) is set in the web app, where the project is ready to open.
  • Several projects, one database. Project names are unique within a database.
  • Simulations are not started from the client: they use credits and are run from the web app.