Skip to content
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

Header (0020,0032) now only checked when -slicepos is passed on the command line #365

Merged
merged 2 commits into from
Jan 3, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions dicom-archive/get_dicom_info.pl
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,10 @@ =head2 Methods
my(@position) =
# ImagePositionPatient (0x0020, 0x0032)
&convert_coordinates(&split_dicom_list(&trim($dicom->value('0020', '0032'))));
if (scalar(@position) != 3) {
warn "Warning: The file: $filename is not DICOM!\n";
my $computeSlicePos = grep($_->[1] eq 'slicepos', @Variables);
if (scalar(@position) != 3 && $computeSlicePos) {
warn "Warning: DICOM header (0020,0032) not found in $filename: "
. "slice position cannot be computed. Skipping file.\n";
push my @croft, $filename;
next;
}
Expand All @@ -153,7 +155,7 @@ =head2 Methods
my(@normal) =
&vector_cross_product(\@column, \@row);
my @slc_dircos = &get_dircos(@normal);
my $slicepos = &vector_dot_product(\@position, \@slc_dircos);
my $slicepos = &vector_dot_product(\@position, \@slc_dircos) if $computeSlicePos;

# Print out variable labels
if(!$PrintedLabels && $PrintLabels) {
Expand Down