-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clean-up database scan type #1139
base: main
Are you sure you want to change the base?
Conversation
2f91dd1
to
3379885
Compare
I am having some troubles testing this PR because my dev database config got changed recently, but this should work. According to the files changed, only the DICOM to MINC ingestion pipeline needs to be tested. |
@maximemulder there is a conflict in this PR. Could you rebase and let @nicolasbrossard and I when it is ready to test/review? Thank you :) |
22a00c3
to
5e8b460
Compare
5e8b460
to
0cf332b
Compare
0cf332b
to
e990edd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested following scripts:
- delete script 🟢
- minc_insertion.pl 🔴 see suggested code changes in functions
scan_type_text_to_id
andscan_type_id_to_text
ofMRI.pm
- imaging_non_minc_insertion.pl 🟢
- minc_to_bids_converter.pl 🔴 see suggested code change in function
getFileList
oftools/minc_to_bids_converter.pl
- get_dicom_files.pl 🟢
- run_defacing_script.pl 🔴 see suggested code change in function
check_if_deface_files_already_in_db
function oftools/run_defacing_script.pl
- register_processed_data.pl 🟢
- run_dicom_archive_loader.py 🟢
🟢 = test successful 🥳
🔴 = bugs found, see attached comments for the bug resolution.
@@ -650,9 +639,10 @@ sub scan_type_id_to_text { | |||
my $mriScanTypeOB = NeuroDB::objectBroker::MriScanTypeOB->new( | |||
db => $db | |||
); | |||
|
|||
my $mriScanTypeRef = $mriScanTypeOB->get(0, { ID => $typeID }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my $mriScanTypeRef = $mriScanTypeOB->get(0, { ID => $typeID }); | |
my $mriScanTypeRef = $mriScanTypeOB->get(0, { MriScanTypeID => $typeID }); |
@@ -676,7 +666,7 @@ sub scan_type_text_to_id { | |||
db => $db | |||
); | |||
my $mriScanTypeRef = $mriScanTypeOB->get( | |||
0, { Scan_type => $type } | |||
0, { MriScanTypeName => $type } | |||
); | |||
|
|||
return @$mriScanTypeRef ? $mriScanTypeRef->[0]->{'ID'} : undef; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return @$mriScanTypeRef ? $mriScanTypeRef->[0]->{'ID'} : undef; | |
return @$mriScanTypeRef ? $mriScanTypeRef->[0]->{'MriScanTypeID'} : undef; |
@@ -427,7 +427,7 @@ sub getFileList { | |||
SELECT | |||
f.FileID, | |||
File, | |||
AcquisitionProtocolID, | |||
MriScanTypeID, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MriScanTypeID, | |
mst.MriScanTypeID, |
Otherwise, get the following error:
DBD::mysql::st execute failed: Column 'MriScanTypeID' in field list is ambiguous at /data/preventAD/bin/mri/tools/minc_to_bids_converter.pl line 456.
@@ -439,10 +439,10 @@ sub check_if_deface_files_already_in_db { | |||
# base query | |||
my $query = "SELECT COUNT(*) " | |||
. " FROM files f " | |||
. " JOIN mri_scan_type mst ON (mst.ID=f.AcquisitionProtocolID) "; | |||
. " JOIN mri_scan_type mst USING (mst.MriScanTypeID=f.MriScanTypeID) "; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
. " JOIN mri_scan_type mst USING (mst.MriScanTypeID=f.MriScanTypeID) "; | |
. " JOIN mri_scan_type mst ON (mst.MriScanTypeID=f.MriScanTypeID) "; |
otherwise, get the following error:
DBD::mysql::st execute failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.MriScanTypeID=f.MriScanTypeID) WHERE (mst.MriScanTypeName = 't2-defaced' OR ms' at line 1 at tools/run_defacing_script.pl line 451.
Complementary PR of LORIS #9304