### Install Device SDK using Pip Source: https://github.com/scanhub-os/scanhub/blob/main/tools/device-sdk/README.md Install the device SDK package using pip. This is the standard way to install Python packages. ```bash pip install device_sdk ``` -------------------------------- ### Set Up Python Virtual Environment Source: https://github.com/scanhub-os/scanhub/blob/main/services/patient-manager/README.md Creates and activates a Python 3.8 virtual environment and installs Poetry. Ensure Python 3.8 is installed on your system. ```bash virtualenv .env --python=python3.8 . .env/bin/activate pip install poetry poetry install ``` -------------------------------- ### Install Device SDK Locally Source: https://github.com/scanhub-os/scanhub/blob/main/tools/device-sdk/README.md Install the device SDK locally from the source code using pip in editable mode. This is useful for development. ```bash pip install -e . ``` -------------------------------- ### Install Linting and Testing Dependencies with Poetry Source: https://github.com/scanhub-os/scanhub/blob/main/services/patient-manager/README.md Installs project dependencies for both linting and testing. ```bash poetry install --with lint --with test ``` -------------------------------- ### Install Dependencies with Poetry Source: https://github.com/scanhub-os/scanhub/blob/main/services/orchestration-engine/README.md Use this command to install project dependencies using Poetry. Ensure Poetry is installed and configured for the project. ```bash poetry install ``` -------------------------------- ### Install Linting Dependencies with Poetry Source: https://github.com/scanhub-os/scanhub/blob/main/services/patient-manager/README.md Installs project dependencies including those required for linting. Use `--with test` to install test dependencies instead. ```bash poetry install --with lint ``` -------------------------------- ### GET /readiness Source: https://github.com/scanhub-os/scanhub/blob/main/docs/source/api_mri_sequences.md Performs a readiness check for the microservice. ```APIDOC ## GET /readiness ### Description Perform a readiness check for the microservice. ### Method GET ### Endpoint /readiness ### Returns #### Success Response (200) - **dict** - The readiness status of the microservice. #### Response Example ```json { "ready": true } ``` ``` -------------------------------- ### Example: Specific MRI Reconstruction Container Source: https://github.com/scanhub-os/scanhub/wiki/Coding-Guidelines Provides an example of a container name for a specific MRI reconstruction process. ```bash mri- ``` -------------------------------- ### Start and Run ScanHub Client Source: https://context7.com/scanhub-os/scanhub/llms.txt Register handlers for feedback, errors, and scan callbacks. Start the client to connect and listen for commands, then keep the application running until interrupted. Ensure graceful shutdown. ```python async def main(): # Register handlers client.set_feedback_handler(feedback_handler) client.set_error_handler(error_handler) client.set_scan_callback(lambda payload: perform_scan(payload)) # Start the client (connects and listens for commands) await client.start() print("Device connected and waiting for scan commands...") # Keep running until interrupted try: await asyncio.Event().wait() except asyncio.CancelledError: pass finally: await client.stop() if __name__ == "__main__": asyncio.run(main()) ``` -------------------------------- ### Example: MRI Database Container Source: https://github.com/scanhub-os/scanhub/wiki/Coding-Guidelines Demonstrates the naming convention for a database container storing MRI records. ```bash mri-db- ``` -------------------------------- ### Consume Events from Kafka Topic Source: https://github.com/scanhub-os/scanhub/blob/main/tests/services/workflow-manager/README.md Starts a console consumer to read messages from a Kafka topic. Use --from-beginning to read all messages from the start. ```bash opt/bitnami/kafka/bin/kafka-console-consumer.sh --topic timestamp --from-beginning --bootstrap-server localhost:9092 ``` -------------------------------- ### Hello World Workflow Example Source: https://github.com/scanhub-os/scanhub/blob/main/services/workflow-manager/README.md A minimal JSON configuration for a 'hello-world' workflow. This serves as a basic template for understanding MONAI Deploy workflow structure. ```json { "version": "0.1.0", "nodes": [ { "name": "hello-world-node", "endpoint": "http://localhost:8080/api/v1/jobs", "input": { "type": "text", "source": "stdin" }, "output": { "type": "text", "destination": "stdout" } } ], "workflow": [ { "from": "hello-world-node", "to": "hello-world-node" } ] } ``` -------------------------------- ### Example: MRI Scanner Control Container Source: https://github.com/scanhub-os/scanhub/wiki/Coding-Guidelines Illustrates the naming convention for a Docker container managing an MRI scanner. ```bash mri--manager ``` -------------------------------- ### Launch Scanhub with Development Tools Source: https://github.com/scanhub-os/scanhub/blob/main/README.md Starts Scanhub along with development tools using a helper script. Use the --full-rebuild option for a complete rebuild. ```bash tools/scripts/development-launcher.sh --full-rebuild ``` -------------------------------- ### Example: ScanHub Device Controller Container Source: https://github.com/scanhub-os/scanhub/wiki/Coding-Guidelines Shows the naming convention for a generic ScanHub device controller container. ```bash sh--manager ``` -------------------------------- ### Start and Stop ScanHub with Docker Compose Source: https://context7.com/scanhub-os/scanhub/llms.txt Commands to start ScanHub in detached mode and stop the platform. Access the web interface at https://localhost:8443 and accept self-signed certificate warnings for development. ```bash # Start ScanHub in detached mode docker compose up --detach # Stop ScanHub docker compose down # For development with full rebuild tools/scripts/development-launcher.sh --full-rebuild ``` -------------------------------- ### Run Development Server Source: https://github.com/scanhub-os/scanhub/blob/main/scanhub-ui/README.md Starts the application in development mode. Opens http://localhost:3000 and enables hot reloading for changes. Lint errors are displayed in the console. ```bash yarn start ``` -------------------------------- ### Start Scanhub Services Source: https://github.com/scanhub-os/scanhub/blob/main/README.md Starts all Scanhub services in detached mode. Access Scanhub via 'localhost' in your browser. Expect a security warning due to the self-signed certificate. ```bash docker compose up --detach ``` -------------------------------- ### GET /api/v1/workflow/ Source: https://github.com/scanhub-os/scanhub/wiki/Documentation:-Workflow-Manager Retrieves a list of all available workflows. ```APIDOC ## GET /api/v1/workflow/ ### Description Get all workflows endpoint. ### Method GET ### Endpoint /api/v1/workflow/ ### Responses #### Success Response (200) - List of workflow pydantic output models, might be empty ``` -------------------------------- ### Device SDK (Python) Source: https://context7.com/scanhub-os/scanhub/llms.txt Python SDK examples for connecting devices to ScanHub and handling acquisition control via WebSocket. ```APIDOC ```python """Example: Connect a device to ScanHub and handle scan requests.""" import asyncio import json from pathlib import Path from sdk.client import Client from scanhub_libraries.models import ( AcquisitionPayload, DeviceDetails, CalibrationType, ) # Load device credentials (obtained from ScanHub web interface) with open("device_credentials.json") as f: credentials = json.load(f) # Define device details device_details = DeviceDetails( device_name="MRI Simulator", serial_number="SIM-001", manufacturer="BrainLink", modality="MRI", site="Research Lab", parameter={ "larmor_frequency": 2.025e6, # Larmor frequency in Hz "max_gradient_strength": 40, # mT/m }, ) async def main(): # Initialize the ScanHub client client = Client(credentials=credentials, device_details=device_details) # Connect to ScanHub await client.connect() # Example: Handle incoming scan requests (this would be part of a larger loop) async for message in client.listen(): if message.type == "acquisition_request": payload: AcquisitionPayload = message.payload print(f"Received scan request: {payload}") # Process the acquisition request, e.g., start a scan on the device # await start_device_scan(payload.sequence_id, payload.workflow_id, payload.device_id) # Send confirmation back to ScanHub await client.send_acquisition_confirmation(payload.record_id, "success") elif message.type == "status_update": print(f"Received status update: {message.payload}") # Handle status updates from the device if __name__ == "__main__": asyncio.run(main()) ``` ``` -------------------------------- ### GET /api/v1/exam/health/readiness Source: https://github.com/scanhub-os/scanhub/wiki/Documentation:-Exam-Manager Check the readiness of the exam service. ```APIDOC ## GET /api/v1/exam/health/readiness ### Description Readiness check endpoint. ### Method GET ### Endpoint /api/v1/exam/health/readiness ``` -------------------------------- ### Scenario 1 Workflow Example Source: https://github.com/scanhub-os/scanhub/blob/main/services/workflow-manager/README.md This JSON file defines a workflow for scenario 1, demonstrating a typical structure for MONAI Deploy workflows. It includes nodes, inputs, outputs, and execution logic. ```json { "version": "0.1.0", "nodes": [ { "name": "dicom-web-adapter", "endpoint": "http://localhost:8080/api/v1/jobs", "input": { "type": "dicom", "source": "dicom-web-server" }, "output": { "type": "dicom", "destination": "dicom-web-server" } }, { "name": "orthanc-adapter", "endpoint": "http://localhost:8042/instances", "input": { "type": "dicom", "source": "dicom-web-server" }, "output": { "type": "dicom", "destination": "orthanc" } }, { "name": "inference-engine", "endpoint": "http://localhost:8081/infer", "input": { "type": "dicom", "source": "orthanc" }, "output": { "type": "nii", "destination": "dicom-web-server" } }, { "name": "dicom-web-sink", "endpoint": "http://localhost:8080/api/v1/jobs", "input": { "type": "nii", "source": "dicom-web-server" }, "output": { "type": "dicom", "destination": "dicom-web-server" } } ], "workflow": [ { "from": "dicom-web-adapter", "to": "orthanc-adapter" }, { "from": "orthanc-adapter", "to": "inference-engine" }, { "from": "inference-engine", "to": "dicom-web-sink" } ] } ``` -------------------------------- ### GET /api/v1/exam/health/readiness Source: https://github.com/scanhub-os/scanhub/blob/main/docs/source/api_exam.md Checks the readiness of the exam system. ```APIDOC ## GET /api/v1/exam/health/readiness ### Description Readiness health endpoint. ### Method GET ### Endpoint /api/v1/exam/health/readiness ### Response #### Success Response (200) - **Status dictionary** #### Error Response - **500**: Any of the exam-tree tables does not exist (HTTPException) ``` -------------------------------- ### GET /api/v1/device/health/readiness Source: https://github.com/scanhub-os/scanhub/wiki/Documentation:-Device-Manager Checks the readiness of the device by inspecting the SQLAlchemy engine and verifying the existence of the workflow table. ```APIDOC ## GET /api/v1/device/health/readiness ### Description Readiness health endpoint. Inspects sqlalchemy engine and check if workflow table exists. ### Method GET ### Endpoint /api/v1/device/health/readiness ### Responses #### Success Response (200) - Successful Response #### Error Response - HTTPException 500: Workflow table not found ``` -------------------------------- ### Connect Device to ScanHub (Python SDK) Source: https://context7.com/scanhub-os/scanhub/llms.txt Example of using the ScanHub Python SDK to connect an MRI device. Requires device credentials and details. ```python import asyncio import json from pathlib import Path from sdk.client import Client from scanhub_libraries.models import ( AcquisitionPayload, DeviceDetails, CalibrationType, ) # Load device credentials (obtained from ScanHub web interface) with open("device_credentials.json") as f: credentials = json.load(f) # Define device details device_details = DeviceDetails( device_name="MRI Simulator", serial_number="SIM-001", manufacturer="BrainLink", modality="MRI", site="Research Lab", parameter={ "larmor_frequency": 2.025e6, # Larmor frequency in Hz "max_gradient_strength": 40, # mT/m }, ) ``` -------------------------------- ### Get All Registered Devices API Source: https://context7.com/scanhub-os/scanhub/llms.txt Retrieves a list of all devices currently registered with the platform. Requires authentication. ```bash # Get all registered devices curl -X GET "https://localhost:8443/api/v1/device/" \ -H "Authorization: Bearer $TOKEN" ``` -------------------------------- ### Run ScanHub Server with Uvicorn Source: https://github.com/scanhub-os/scanhub/blob/main/services/patient-manager/README.md Starts the ScanHub application server using Uvicorn, enabling live reloading on port 8000. ```bash uvicorn scanhub.main:app --reload --port 8000 ``` -------------------------------- ### Create First User in ScanHub Source: https://context7.com/scanhub-os/scanhub/llms.txt Creates the initial admin user for fresh installations. First, check if any users exist, then proceed with creation using a POST request with JSON payload. ```bash # Check if any users exist curl -X GET "https://localhost:8443/api/v1/userlogin/checknousers" # Create the first admin user curl -X POST "https://localhost:8443/api/v1/userlogin/createfirstuser" \ -H "Content-Type: application/json" \ -d '{ "username": "admin", "first_name": "Admin", "last_name": "User", "email": "admin@hospital.org", "role": "admin", "access_token": "securepassword123", "token_type": "password" }' ``` -------------------------------- ### Get All MRI Sequences Source: https://context7.com/scanhub-os/scanhub/llms.txt Retrieve a list of all stored MRI sequences. ```bash curl -X GET "https://localhost:8443/api/v1/mri/sequences/" \ -H "Authorization: Bearer $TOKEN" ``` -------------------------------- ### Get All Workflows API Source: https://context7.com/scanhub-os/scanhub/llms.txt Retrieves a list of all defined workflows within the system. Requires authentication. ```bash # Get all workflows curl -X GET "https://localhost:8443/api/v1/workflow/" \ -H "Authorization: Bearer $TOKEN" ``` -------------------------------- ### Start MRI Scan Job Source: https://context7.com/scanhub-os/scanhub/llms.txt Initiate an MRI scan job on a connected device. Requires sequence_id, workflow_id, and device_id. ```bash curl -X POST "https://localhost:8443/api/v1/mri/acquisitioncontrol/start-scan" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "id": 1, "sequence_id": "65a1b2c3d4e5f6g7h8i9j0k1", "workflow_id": 1, "device_id": 1 }' ``` -------------------------------- ### Produce Events to Kafka Topic Source: https://github.com/scanhub-os/scanhub/blob/main/tests/services/workflow-manager/README.md Starts a console producer to send messages to a specified Kafka topic. Type messages and press Enter. Stop with Ctrl-C. ```bash opt/bitnami/kafka/bin/kafka-console-producer.sh --topic createStudyEvent --bootstrap-server localhost:9092 ``` ```text This is my first event This is my second event ``` -------------------------------- ### POST /api/v1/mri/acquisitioncontrol/start-scan Source: https://github.com/scanhub-os/scanhub/wiki/Documentation:-Acquisition-Control Starts an MRI scan by receiving a job, creating a record ID, triggering the scan, and returning the record ID. ```APIDOC ## POST /api/v1/mri/acquisitioncontrol/start-scan ### Description Receives a job. Create a record id, trigger scan with it and returns it. ### Method POST ### Endpoint /api/v1/mri/acquisitioncontrol/start-scan ### Parameters #### Request Body - **job** (object) - Required - Description of the job to be processed. ### Request Example ```json { "job": { "patient_id": "12345", "scan_type": "T1", "parameters": { "TR": 2.0, "TE": 0.03 } } } ``` ### Response #### Success Response (200) - **record_id** (string) - The unique identifier for the created scan job. #### Response Example ```json { "record_id": "scan_abc123" } ``` #### Error Response (422) - **detail** (array) - Contains validation error messages. ``` -------------------------------- ### GET / - Get Patient List Source: https://github.com/scanhub-os/scanhub/blob/main/docs/source/api_ui_patient_manager.md Retrieves a list of all patients. ```APIDOC ## GET / ### Description Get all patients endpoint. ### Method GET ### Endpoint / ### Response #### Success Response (200) - **List of patient pydantic output models** (list) - A list containing patient data. #### Response Example ```json [ { "id": 1, "name": "John Doe", "dob": "1990-01-01" } ] ``` ``` -------------------------------- ### GET /{patient_id} - Get Patient Source: https://github.com/scanhub-os/scanhub/blob/main/docs/source/api_ui_patient_manager.md Retrieves a specific patient's record by their ID. ```APIDOC ## GET /{patient_id} ### Description Get a patient from database by id. ### Method GET ### Endpoint `/{patient_id}` ### Parameters #### Path Parameters - **patient_id** (integer) - Required - The unique identifier of the patient. ### Response #### Success Response (200) - **Patient pydantic output model** (object) - The patient's record. #### Response Example ```json { "id": 1, "name": "John Doe", "dob": "1990-01-01" } ``` ### Error Handling - **404: Patient not found** - If a patient with the specified ID does not exist. - **422: Validation Error** - If the patient_id is not a valid integer. ``` -------------------------------- ### Build for Production Source: https://github.com/scanhub-os/scanhub/blob/main/scanhub-ui/README.md Creates an optimized production build of the application in the 'build' folder. This includes minification and filename hashing for best performance. ```bash yarn build ``` -------------------------------- ### Create Kafka Topics Source: https://github.com/scanhub-os/scanhub/blob/main/tests/services/workflow-manager/README.md Use this command to create new topics in Kafka. Ensure the bootstrap server address is correct. ```bash opt/bitnami/kafka/bin/kafka-topics.sh --create --topic createStudyEvents --bootstrap-server localhost:9092 ``` ```bash opt/bitnami/kafka/bin/kafka-topics.sh --create --topic deviceControlEvents --bootstrap-server localhost:9092 ``` -------------------------------- ### GET /health Source: https://github.com/scanhub-os/scanhub/blob/main/docs/source/api_mri_sequences.md Performs a health check for the microservice. ```APIDOC ## GET /health ### Description Perform a health check for the microservice. ### Method GET ### Endpoint /health ### Parameters #### Query Parameters - **is_db_connected** (boolean) - Optional - The status of the database connection. ### Returns #### Success Response (200) - **string** - The status of the microservice. #### Response Example ```json { "status": "ok" } ``` ``` -------------------------------- ### GET /api/v1/workflow/health/readiness Source: https://github.com/scanhub-os/scanhub/wiki/Documentation:-Workflow-Manager Checks the readiness of the workflow service. ```APIDOC ## GET /api/v1/workflow/health/readiness ### Description Readiness health endpoint. Inspects sqlalchemy engine and check if workflow table exists. ### Method GET ### Endpoint /api/v1/workflow/health/readiness ### Responses #### Success Response (200) - Status docstring #### Error Response (500) - Workflow table does not exist ``` -------------------------------- ### List Kafka Topics Source: https://github.com/scanhub-os/scanhub/blob/main/tests/services/workflow-manager/README.md Lists all available topics in your Kafka cluster. Requires the bootstrap server address. ```bash opt/bitnami/kafka/bin/kafka-topics.sh --list --bootstrap-server localhost:9092 ``` -------------------------------- ### GET /api/v1/mri/sequences/ Source: https://github.com/scanhub-os/scanhub/blob/main/docs/source/api_mri_sequences.md Retrieves a list of all MRI sequences from the database. ```APIDOC ## GET /api/v1/mri/sequences/ ### Description Retrieve a list of all MRI sequences from the database. ### Method GET ### Endpoint /api/v1/mri/sequences/ ### Parameters #### Query Parameters - **database** (string) - Required - The MongoDB database handle. ### Returns #### Success Response (200) - **List[MRISequence]** - The list of MRI sequences. ### Response Example ```json [ { "_id": "60f7b3b3b3b3b3b3b3b3b3b3", "name": "T1 Weighted", "description": "Standard T1 weighted sequence" } ] ``` ``` -------------------------------- ### GET /api/v1/exam/record/{record_id} Source: https://github.com/scanhub-os/scanhub/wiki/Documentation:-Exam-Manager Retrieve details of a specific record. ```APIDOC ## GET /api/v1/exam/record/{record_id} ### Description Get single record endpoint. ### Method GET ### Endpoint /api/v1/exam/record/{record_id} ### Path Parameters - **record_id** (integer) - Required - Id of the record to return ### Response #### Success Response (200) - **object** (object) - Record pydantic output model #### Error Response - **422**: Validation Error - **404**: Not found ``` -------------------------------- ### GET /api/v1/exam/job/{job_id} Source: https://github.com/scanhub-os/scanhub/wiki/Documentation:-Exam-Manager Retrieve details of a specific job. ```APIDOC ## GET /api/v1/exam/job/{job_id} ### Description Get job endpoint. ### Method GET ### Endpoint /api/v1/exam/job/{job_id} ### Path Parameters - **job_id** (integer) - Required - Id of the job to be returned ### Response #### Success Response (200) - **object** (object) - Job pydantic output model #### Error Response - **422**: Validation Error - **404**: Not found ``` -------------------------------- ### Initialize ScanHub Client Source: https://context7.com/scanhub-os/scanhub/llms.txt Instantiate the ScanHub client with connection details, device credentials, and SSL configuration. Set reconnect delay for robustness. ```python client = Client( websocket_uri="wss://localhost:8443/api/v1/device/ws", device_id=credentials["device_id"], device_token=credentials["device_token"], device_details=device_details, ca_file="secrets/certificate.pem", # For SSL verification reconnect_delay=5, ) ``` -------------------------------- ### Create New Device API Source: https://context7.com/scanhub-os/scanhub/llms.txt Registers a new imaging device with the platform. Requires device details in JSON format and authentication. ```bash # Create a new device curl -X POST "https://localhost:8443/api/v1/device/" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "OSI2One Scanner", "manufacturer": "OpenSourceImaging", "modality": "MRI", "status": "OFFLINE", "site": "Research Lab A", "ip_address": "192.168.1.100" }' ``` -------------------------------- ### GET /api/v1/exam/record/{record_id} Source: https://github.com/scanhub-os/scanhub/blob/main/docs/source/api_exam.md Retrieves a specific record by its ID. ```APIDOC ## GET /api/v1/exam/record/{record_id} ### Description Get single record endpoint. ### Method GET ### Endpoint /api/v1/exam/record/{record_id} ### Parameters #### Path Parameters - **record_id** (integer) - Required - Id of the record to return ### Response #### Success Response (200) - **Record pydantic output model** #### Error Response - **404**: Not found (HTTPException) - **422**: Validation Error ``` -------------------------------- ### Get Specific Workflow Source: https://context7.com/scanhub-os/scanhub/llms.txt Retrieve details of a specific workflow by its ID. ```bash curl -X GET "https://localhost:8443/api/v1/workflow/1" \ -H "Authorization: Bearer $TOKEN" ``` -------------------------------- ### GET /api/v1/mri/sequences/{mri_sequence_id} Source: https://github.com/scanhub-os/scanhub/blob/main/docs/source/api_mri_sequences.md Retrieves a specific MRI sequence by its ID. ```APIDOC ## GET /api/v1/mri/sequences/{mri_sequence_id} ### Description Retrieve an MRI sequence by its ID. ### Method GET ### Endpoint /api/v1/mri/sequences/{mri_sequence_id} ### Parameters #### Path Parameters - **mri_sequence_id** (string) - Required - The ID of the MRI sequence to retrieve. #### Query Parameters - **database** (string) - Required - The MongoDB database handle. ### Returns #### Success Response (200) - **MRISequence** - The retrieved MRI sequence. #### Response Example ```json { "_id": "60f7b3b3b3b3b3b3b3b3b3b3", "name": "T1 Weighted", "description": "Standard T1 weighted sequence" } ``` ``` -------------------------------- ### Create New Workflow Source: https://context7.com/scanhub-os/scanhub/llms.txt Use this endpoint to create a new workflow. Requires host, name, modality, type, status, and kafka_topic. ```bash curl -X POST "https://localhost:8443/api/v1/workflow/" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "host": "orchestration-engine", "name": "MRI Reconstruction Workflow", "modality": "MRI", "type": "reconstruction", "status": "active", "kafka_topic": "mri-reconstruction" }' ``` -------------------------------- ### GET /api/v1/exam/record/all/{job_id} Source: https://github.com/scanhub-os/scanhub/wiki/Documentation:-Exam-Manager Retrieve all records associated with a specific job. ```APIDOC ## GET /api/v1/exam/record/all/{job_id} ### Description Get all records of a job endpoint. ### Method GET ### Endpoint /api/v1/exam/record/all/{job_id} ### Path Parameters - **job_id** (integer) - Required - Id of parental job ### Response #### Success Response (200) - **array** (array) - List of record pydantic output model #### Error Response - **422**: Validation Error ``` -------------------------------- ### GET /api/v1/exam/job/all/{procedure_id} Source: https://github.com/scanhub-os/scanhub/wiki/Documentation:-Exam-Manager Retrieve all jobs associated with a specific procedure. ```APIDOC ## GET /api/v1/exam/job/all/{procedure_id} ### Description Get all jobs of a procedure endpoint. ### Method GET ### Endpoint /api/v1/exam/job/all/{procedure_id} ### Path Parameters - **procedure_id** (integer) - Required - Id of parent procedure ### Response #### Success Response (200) - **array** (array) - List of job pydantic output model #### Error Response - **422**: Validation Error ``` -------------------------------- ### POST /api/v1/workflow/ Source: https://github.com/scanhub-os/scanhub/wiki/Documentation:-Workflow-Manager Creates a new workflow. ```APIDOC ## POST /api/v1/workflow/ ### Description Create new workflow endpoint. ### Method POST ### Endpoint /api/v1/workflow/ ### Request Body - payload (Workflow pydantic base model) - Required - Data to create a new workflow. ### Responses #### Success Response (201) - Workflow pydantic output model #### Error Response (422) - Validation Error ``` -------------------------------- ### GET /api/v1/exam/record/all/{job_id} Source: https://github.com/scanhub-os/scanhub/blob/main/docs/source/api_exam.md Retrieves all records associated with a specific job. ```APIDOC ## GET /api/v1/exam/record/all/{job_id} ### Description Get all records of a job endpoint. ### Method GET ### Endpoint /api/v1/exam/record/all/{job_id} ### Parameters #### Path Parameters - **job_id** (integer) - Required - Id of parental job ### Response #### Success Response (200) - **List of record pydantic output model** #### Error Response - **422**: Validation Error ``` -------------------------------- ### GET /api/v1/exam/job/all/{procedure_id} Source: https://github.com/scanhub-os/scanhub/blob/main/docs/source/api_exam.md Retrieves all jobs associated with a specific procedure. ```APIDOC ## GET /api/v1/exam/job/all/{procedure_id} ### Description Get all jobs of a procedure endpoint. ### Method GET ### Endpoint /api/v1/exam/job/all/{procedure_id} ### Parameters #### Path Parameters - **procedure_id** (integer) - Required - Id of parent procedure ### Response #### Success Response (200) - **List of job pydantic output model** #### Error Response - **422**: Validation Error ``` -------------------------------- ### Build ScanHub Docker Images Source: https://context7.com/scanhub-os/scanhub/llms.txt Builds the base Docker image and then all service containers using Docker Compose. Ensure you are in the project root directory. ```bash cd services/base docker build -t scanhub-base . cd ../.. docker compose build --build-arg BASE_IMG=scanhub-base:latest docker compose build ``` -------------------------------- ### GET /api/v1/workflow/{workflow_id} Source: https://github.com/scanhub-os/scanhub/wiki/Documentation:-Workflow-Manager Retrieves details of a specific workflow by its ID. ```APIDOC ## GET /api/v1/workflow/{workflow_id} ### Description Get workflow endpoint. ### Method GET ### Endpoint /api/v1/workflow/{workflow_id} ### Parameters #### Path Parameters - **workflow_id** (integer) - Required - Id of the workflow object to be returned ### Responses #### Success Response (200) - Workflow pydantic output model #### Error Response (422) - Validation Error #### Error Response (404) - Not found ``` -------------------------------- ### GET /api/v1/mri/sequences/mri-sequence-file/{mri_sequence_id} Source: https://github.com/scanhub-os/scanhub/blob/main/docs/source/api_mri_sequences.md Retrieves the file associated with a specific MRI sequence by its ID. ```APIDOC ## GET /api/v1/mri/sequences/mri-sequence-file/{mri_sequence_id} ### Description Retrieve an MRI sequence file by its ID. ### Method GET ### Endpoint /api/v1/mri/sequences/mri-sequence-file/{mri_sequence_id} ### Parameters #### Path Parameters - **mri_sequence_id** (string) - Required - The ID of the MRI sequence to retrieve the file for. #### Query Parameters - **name** (string) - Required - The name of the file to download. - **database** (string) - Required - The MongoDB database handle. ### Returns #### Success Response (200) - **FileResponse** - The retrieved MRI sequence file. #### Response Example (Binary file content) ``` -------------------------------- ### Get Specific Exam API Source: https://context7.com/scanhub-os/scanhub/llms.txt Retrieves details for a specific examination using its ID. Requires authentication. ```bash # Get specific exam curl -X GET "https://localhost:8443/api/v1/exam/660e8400-e29b-41d4-a716-446655440001" \ -H "Authorization: Bearer $TOKEN" ```