Skip to content

Commit

Permalink
MRI exclusion scans such as localizers read from the Config module. B…
Browse files Browse the repository at this point in the history
…asically redoing aces#264. Only took 3 hours of my time today... (aces#319)
  • Loading branch information
cmadjar authored and MounaSafiHarab committed Jul 3, 2018
1 parent d9354a5 commit 7228845
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
11 changes: 10 additions & 1 deletion uploadNeuroDB/NeuroDB/DBI.pm
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,16 @@ sub getConfigSetting
$query = $query . $where;
my $sth = $$dbh->prepare($query);
$sth->execute($name);
if ( $sth->rows > 0 ) {

if ( $sth->rows > 1 ){
# if more than one row returned, push data into an array that will be
# dereferenced into $value
my @values;
while (my $row = $sth->fetchrow_array()) {
push (@values, $row);
}
$value = \@values;
} elsif ( $sth->rows > 0 ) {
$value = $sth->fetchrow_array();
}
return $value;
Expand Down
7 changes: 6 additions & 1 deletion uploadNeuroDB/NeuroDB/MRIProcessingUtility.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1094,10 +1094,15 @@ sub dicom_to_minc {
$exclude,$mail_user, $upload_id) = @_;
my ($d2m_cmd,$d2m_log,$exit_code);
my $message = '';

# create the excluded series description regex necessary to exclude the
# series description specified in the Config Setting
# excluded_series_description
my $excluded_regex = join('|', map { quotemeta($_) } @$exclude);
$d2m_cmd = "find $study_dir -type f | $get_dicom_info -studyuid -series".
" -echo -image -file -series_descr -attvalue 0018 0024".
" -stdin | sort -n -k1 -k2 -k6 -k3 -k7 -k4 | grep -iv".
" $exclude | cut -f 5 | ";
" -E \"($excluded_regex)\" | cut -f 5 | ";

############################################################
#### use some other converter if specified in the config ###
Expand Down
4 changes: 3 additions & 1 deletion uploadNeuroDB/tarchiveLoader
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,9 @@ my $mail_user = NeuroDB::DBI::getConfigSetting(
my $get_dicom_info = NeuroDB::DBI::getConfigSetting(
\$dbh,'get_dicom_info'
);
my $exclude = "localizer"; # case insensitive
my $exclude = NeuroDB::DBI::getConfigSetting(
\$dbh, 'excluded_series_description'
);
my $template = "TarLoad-$hour-$min-XXXXXX"; # for tempdir
my $User = `whoami`;

Expand Down

0 comments on commit 7228845

Please sign in to comment.