fli-iam / shanoir-ng

Shanoir (SHAring iN vivO Imaging Resources)
GNU General Public License v3.0
22 stars 22 forks source link

Mass NIfTI conversion [NG-2023-02] #1602

Closed michaelkain closed 5 months ago

michaelkain commented 1 year ago
jcomedouteau commented 1 year ago

Mass nifti conversion / Unstore nifti files specification

Objectives:

Part 1: Move nifti conversion to another microservice and allow multiple conversion (these two cannot be done separately)

A) Move nifti conversion to another microservice.

This nifti conversion should be isolated in a sandbox to avoid some risky calls. For this, use seccomp ( with docker: https://docs.docker.com/engine/security/seccomp/) → Create a new container with seccomp option → Move database logic of nifti converters → Move Docker file installation logic from import to this new container → Move all conversion code logic (better the error management)

B) Allow multiple conversion.

The massive download with a specific converter should be available:

For the moment we propose a single dataset nifti reconversion in DatasetApiController / DatasetDownloaderServiceImpl As nifti converters are stored in import microservices, the logic is: 1) Download dicom files from the dataset in a shared folder 2) Use rabbitMQ to communicate with import MS (NIFTI_CONVERSION_QUEUE) 3) In import MS, convert data using the selected converter and return the result folder 4) Get the result folder and send it back to download

This logic is correct for a single dataset, we may need to upgrade it for multiple datasets.

PART 1 Apply conversion logic for multiple datasets

Propose a new button to download in nifti with a specific converter See the way it is done in single dataset download , when clicking on the button, the list of nifti converters is displayed. Here we need to propose the "default" (the one in dataset_acquisition) converter (in green ?) and other converters. In the back, convert the datasets either one by one, either all together (I don't know what's possible, see inDatasetsCreatorAndNIfTIConverterService) At the end of the process, delete the newly created niftis.

PART 2 Apply this conversion logic to download process and delete all existing nifti files on disk and associated dataset expressions

Visualization with papaya:

We need to define a “default converter” in a given study. If the converter is not specified, this converter is selected.

Part 2: Remove existing niftis

jcomedouteau commented 1 year ago

Also we can put bruker2dicom in this microservice I guess.

michaelkain commented 1 year ago

Hi Jean-Come, thank you for your efforts. I agree principally to move NIfTI conversion to another microservice, fine, but above are quite a few points, we will have to exchange on. With kind regards, Michael

jcomedouteau commented 1 year ago

-> The admin can decide to make a full conversion + storage + tag in the study administration (or expert ?) -> Zip the conversion result with a tag and a date if the user want ? Camille: Can be a problem if we want to share the nifti files. -> The admin can decide to convert during import too (study parameter)

michaelkain commented 5 months ago

developed by Jean-Come