exam-manager.app.api.mri_sequence_api#

MRI sequence endpoints.

Attributes#

Functions#

mri_sequence_form(, description, sequence_type, tags)

Convert form data to BaseMRISequence model.

get_mri_sequence_by_id(...)

Retrieve an MRI sequence by its ID.

create_mri_sequence([sequence_meta, file, database])

Upload an MRI sequence file and store it with the provided metadata.

get_all_mri_sequences([database])

Retrieve a list of all MRI sequences from the database.

get_mri_sequence_file_by_id(sequence_id, background_tasks)

Retrieve an MRI sequence file by its ID.

update_mri_sequence_endpoint(sequence_id, sequence_meta)

Update an MRI sequence with new data.

delete_mri_sequence_endpoint() → None)

Delete an MRI sequence by its ID.

Module Contents#

exam-manager.app.api.mri_sequence_api.seq_router#
async exam-manager.app.api.mri_sequence_api.mri_sequence_form(name: str = Form(...), description: str = Form(''), sequence_type: str = Form(''), tags: list[str] = Form([])) scanhub_libraries.models.BaseMRISequence#

Convert form data to BaseMRISequence model.

Parameters#

namestr

The name of the MRI sequence.

descriptionstr | None

A description of the MRI sequence.

sequence_typestr | None

The type of the MRI sequence (e.g., “imaging”, “calibration”, etc.).

tagslist[str]

A list of tags associated with the MRI sequence.

async exam-manager.app.api.mri_sequence_api.get_mri_sequence_by_id(sequence_id: str, database=Depends(get_mongo_database)) scanhub_libraries.models.MRISequenceOut#

Retrieve an MRI sequence by its ID.

Parameters#

sequence_idstr

The ID of the MRI sequence to retrieve.

databaseAsyncIOMotorDatabase

The MongoDB database handle.

Returns#

MRISequence

The retrieved MRI sequence.

async exam-manager.app.api.mri_sequence_api.create_mri_sequence(sequence_meta: scanhub_libraries.models.BaseMRISequence = Depends(mri_sequence_form), file: fastapi.UploadFile = File(...), database=Depends(get_mongo_database))#

Upload an MRI sequence file and store it with the provided metadata.

Parameters#

mri_sequenceMRISequenceCreate

The MRI sequence metadata.

fileUploadFile

The MRI sequence file to store.

databaseAsyncIOMotorDatabase

The MongoDB database handle.

Returns#

MRISequence

The stored MRI sequence with the uploaded file.

async exam-manager.app.api.mri_sequence_api.get_all_mri_sequences(database=Depends(get_mongo_database))#

Retrieve a list of all MRI sequences from the database.

Parameters#

databaseAsyncIOMotorDatabase

The MongoDB database handle.

Returns#

List[MRISequence]

The list of MRI sequences.

async exam-manager.app.api.mri_sequence_api.get_mri_sequence_file_by_id(sequence_id: str, background_tasks: fastapi.BackgroundTasks, name: str = 'sequence', database=Depends(get_mongo_database))#

Retrieve an MRI sequence file by its ID.

Parameters#

sequence_idstr

The ID of the MRI sequence to retrieve.

background_tasksBackgroundTasks

The background tasks to run.

namestr

The name of the file to download.

databaseAsyncIOMotorDatabase

The MongoDB database handle.

Returns#

FileResponse

The retrieved MRI sequence file.

async exam-manager.app.api.mri_sequence_api.update_mri_sequence_endpoint(sequence_id: str, sequence_meta: scanhub_libraries.models.BaseMRISequence, database=Depends(get_mongo_database))#

Update an MRI sequence with new data.

Parameters#

sequence_idstr

The ID of the MRI sequence to update.

mri_sequenceMRISequence

The updated MRI sequence data.

databaseAsyncIOMotorDatabase

The MongoDB database handle.

Returns#

MRISequence

The updated MRI sequence.

async exam-manager.app.api.mri_sequence_api.delete_mri_sequence_endpoint(sequence_id: str, database=Depends(get_mongo_database)) None#

Delete an MRI sequence by its ID.

Parameters#

sequence_idstr

The ID of the MRI sequence to delete.

databaseAsyncIOMotorDatabase

The MongoDB database handle.

Returns#

None