diff --git a/docs/scripts_md/MRI.md b/docs/scripts_md/MRI.md index 53cc61e37..e652b4ace 100644 --- a/docs/scripts_md/MRI.md +++ b/docs/scripts_md/MRI.md @@ -87,7 +87,7 @@ INPUTS: RETURNS: textual name of scan type from the `mri_scan_type` table -### insert\_violated\_scans($dbhr, $series\_desc, $minc\_location, $patient\_name, $candid, $pscid, $visit, $tr, $te, $ti, $slice\_thickness, $xstep, $ystep, $zstep, $xspace, $yspace, $zspace, $time, $seriesUID, $echo\_numbers, $phase\_enc\_dir, $data\_dir, $mriProtocolGroupID) +### insert\_violated\_scans($db, $series\_desc, $minc\_location, $patient\_name, $candidateID, $pscid, $visit, $tr, $te, $ti, $slice\_thickness, $xstep, $ystep, $zstep, $xspace, $yspace, $zspace, $time, $seriesUID, $echo\_numbers, $phase\_enc\_dir, $data\_dir, $mriProtocolGroupID) Inserts scans that do not correspond to any of the defined protocol from the `mri_protocol` table into the `mri_protocol_violated_scans` table of the @@ -98,7 +98,7 @@ INPUTS: - $series\_desc : series description of the scan - $minc\_location : location of the MINC file - $patient\_name : patient name of the scan - - $candid : candidate's `CandID` + - $candidateID : candidate's `ID` - $pscid : candidate's `PSCID` - $visit : visit of the scan - $tr : repetition time of the scan diff --git a/uploadNeuroDB/NeuroDB/MRI.pm b/uploadNeuroDB/NeuroDB/MRI.pm index af62f59ba..aa5e5525f 100755 --- a/uploadNeuroDB/NeuroDB/MRI.pm +++ b/uploadNeuroDB/NeuroDB/MRI.pm @@ -507,12 +507,16 @@ sub identify_scan_db { } # if(keys %mriProtocolGroupIDs > 1)...else... } # if (@rows==0)....else... + $query = "SELECT ID FROM candidate WHERE CandID=?"; + my $rowsref = $$dbhr->selectall_arrayref($query, { Slice=> {} }, $candid); + my $candidateID = $rowsRef->[0]->{'ID'}; + # if we got here, we're really clueless: insert scan in mri_protocol_violated_scans # table. Note that $mriProtocolGroupID will be undef unless exactly one protocol # group was used to try to identify the scan insert_violated_scans( $db, $series_description, $minc_location, $patient_name, - $candid, $pscid, $tr, $te, + $candidateID, $pscid, $tr, $te, $ti, $slice_thickness, $xstep, $ystep, $zstep, $xspace, $yspace, $zspace, $time, $seriesUID, $tarchiveID, $image_type, @@ -524,7 +528,7 @@ sub identify_scan_db { =pod -=head3 insert_violated_scans($dbhr, $series_desc, $minc_location, $patient_name, $candid, $pscid, $visit, $tr, $te, $ti, $slice_thickness, $xstep, $ystep, $zstep, $xspace, $yspace, $zspace, $time, $seriesUID, $echo_numbers, $phase_enc_dir, $data_dir, $mriProtocolGroupID) +=head3 insert_violated_scans($db, $series_desc, $minc_location, $patient_name, $candidateID, $pscid, $visit, $tr, $te, $ti, $slice_thickness, $xstep, $ystep, $zstep, $xspace, $yspace, $zspace, $time, $seriesUID, $echo_numbers, $phase_enc_dir, $data_dir, $mriProtocolGroupID) Inserts scans that do not correspond to any of the defined protocol from the C table into the C table of the @@ -535,7 +539,7 @@ INPUTS: - $series_desc : series description of the scan - $minc_location : location of the MINC file - $patient_name : patient name of the scan - - $candid : candidate's C + - $candidateID : candidate's C - $pscid : candidate's C - $visit : visit of the scan - $tr : repetition time of the scan @@ -562,7 +566,7 @@ INPUTS: sub insert_violated_scans { my ($db, $series_description, $minc_location, $patient_name, - $candid, $pscid, $tr, $te, + $candidateID, $pscid, $tr, $te, $ti, $slice_thickness, $xstep, $ystep, $zstep, $xspace, $yspace, $zspace, $time, $seriesUID, $tarchiveID, $image_type, @@ -577,7 +581,7 @@ sub insert_violated_scans { my $time_run = sprintf("%4d-%02d-%02d %02d:%02d:%02d", $year+1900, $mon+1, $mday, $hour, $min, $sec); my %newMriProtocolViolatedScans = ( - 'CandID' => $candid, + 'CandidateID' => $candidateID, 'PSCID' => $pscid, 'TarchiveID' => $tarchiveID, 'time_run' => $time_run, diff --git a/uploadNeuroDB/NeuroDB/objectBroker/MriProtocolViolatedScansOB.pm b/uploadNeuroDB/NeuroDB/objectBroker/MriProtocolViolatedScansOB.pm index c18a315a9..818cfa184 100644 --- a/uploadNeuroDB/NeuroDB/objectBroker/MriProtocolViolatedScansOB.pm +++ b/uploadNeuroDB/NeuroDB/objectBroker/MriProtocolViolatedScansOB.pm @@ -71,7 +71,7 @@ use File::Basename; use TryCatch; my @MRIPROTOCOLVIOLATEDSCANS_FIELDS = qw( - ID CandID PSCID TarchiveID time_run series_description minc_location + ID CandidateID PSCID TarchiveID time_run series_description minc_location PatientName TR_range TE_range TI_range slice_thickness_range xspace_range yspace_range zspace_range xstep_range ystep_range zstep_range time_range SeriesUID image_type PhaseEncodingDirection EchoNumber @@ -201,4 +201,4 @@ License: GPLv3 LORIS community and McGill Centre for Integrative Neuroscience -=cut \ No newline at end of file +=cut