raamana / visualqc

VisualQC : assistive tool to ease the quality control workflow of neuroimaging data.
https://raamana.github.io/visualqc/
Apache License 2.0
73 stars 13 forks source link

Save QC image alignments from command line #72

Closed marivas-MRI closed 1 year ago

marivas-MRI commented 1 year ago

Dear VisualQC devs,

First of all, congratulations for this very usefull toolbox!. I just would like to ask you about image alignment quality control. Is there a way to avoid opening the QC window and automatically save the snapshots of each subject using the command line?

I used the following command and also it worked but I would like to save all the snapshots.

visualqc_alignment -i1 orig.nii -i2 aligned.nii -dl 0.5 -old

Apologies for this basic question.

Thank you very much in advance.

Best regards,

raamana commented 1 year ago

Hi, thank you. I am glad to hear you find this useful.

Nothing to apologize for at all - this is somewhat a routine request: see #37 and #70 e.g., within Freesurfer QC and other modules of VisualQC. I resisted it as I didn't see the benefit, esp. when the interactive review is so fast and works on the latest version of the data.. and also because the screenshot can become out of sync with the latest version of the data, if great care hasn't been taken to keep them in sync.

I think I will implement it and update you soon. Can you quickly let me know what kinda of modalities and datasets will you be working with?

PS: I am also curious to learn where VisualQC users are so if you don't mind, can you tell me which country and lab are you based at?

raamana commented 1 year ago

Hi @marivas-MRI

I made decent progress on batch generation of screenshots today, and it's all in the branch screenshots_batch_generation, both for alignment and defacing modules. I will release it soon once I test it a bit more and with other modules.

If know how to use a python library from a separate branch, you can already use it via https://github.com/raamana/visualqc/tree/screenshots_batch_generation

but if your python skills aren't advanced, just wait for the official release

raamana commented 1 year ago

here is the instructions if you want to give it a try: https://github.com/raamana/visualqc/issues/37#issuecomment-1474181538

raamana commented 1 year ago

officially released in v0.6.5 today. use the --screenshots_only flag with any module of VisualQC now.

raamana commented 1 year ago

for future reference, collages can easily be generated for an entire dataset, with mrivis:

from mrivis import Collage, Carpet, SlicePicker
collage = Collage()

for subject_id, image in get_images():

    collage.attach(image)

    collage.save(output_path=out_dir / f'vis_{subject_id}.png')