Skip to content

Developer Notes

AUEB Data Science group edited this page Mar 26, 2020 · 1 revision
  1. Quality control

In order to mark all newly inserted mincs as "Pass"

Images in our case are ought to be initialized with a 'PASS' label upon being imported to LORIS. This is done by triger "files_AFTER_INSERT"

DELIMITER $$
CREATE DEFINER = CURRENT_USER TRIGGER `LORIS`.`files_AFTER_INSERT` AFTER INSERT ON `files` FOR EACH ROW
BEGIN
	INSERT INTO files_qcstatus
	SET	FileID = NEW.FileID,
     SeriesUID = NEW.SeriesUID,
     EchoTime = NEW.EchoTime,
     QCStatus = "Pass",
     QCFirstChangeTime = unix_timestamp( NOW() ),
     QCLastChangeTime = unix_timestamp( NOW() );
END $$ql

Loris does not store the StudyID of the mincs files into the database. One workaround is to modify the "files" table

ALTER TABLE files ADD FileStudyID TEXT DEFAULT NULL;

and execute fill_studyid.py which read the mnic header of each file to fill the missing studyid information.

sudo apt-get install minc-tools
python fill_studyid.py

In order to discriminize which files with "PASS" have been examined for the next stage we add one column

ALTER TABLE files ADD FileStudyComplete INT DEFAULT 0;
  1. Insert Data

Make sure that pre and post folders exists, otherwise create them.

cd ~
mkdir pre post

Place your dicoms files to /home/loris/pre

It is recommended to make use of https://github.com/aueb-wim/DataQualityControlTool/ to find invalid .dcm files that you should not include while uploading a dicom, otherwise the upload will fail.

Example: Upload a dicom folder to loris_apache container from host to /home/lorisadmin/pre

docker cp folder_path_from_host loris_apache:/home/lorisadmin/pre

Execute

python dicom_uploader.py

dicom_uploader.py will process each dicom-folder within the folder pre and afterwards moves that dicom-folder to the post folder.

Clone this wiki locally