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 1 commit
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
5 changes: 3 additions & 2 deletions dicom-archive/get_dicom_info.pl
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ =head2 Methods
my(@position) =
# ImagePositionPatient (0x0020, 0x0032)
&convert_coordinates(&split_dicom_list(&trim($dicom->value('0020', '0032'))));
if (scalar(@position) != 3) {
my $computeSlicePos = grep($_->[1] eq 'slicepos', @Variables);
if (scalar(@position) != 3 && $computeSlicePos) {
warn "Warning: The file: $filename is not DICOM!\n";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nicolasbrossard I wonder if we should not update the warning error to something clearer. Like "Warning: the file $filename is either not DICOM or does not contain any value for DICOM header (0020,0032)"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cmadjar Since header (0020,0032) is not mandatory, I vote for changing the warning to

"DICOM header (0020,0032) not found in $filename: slice position cannot be computed. Skipping file.\n"

What do you think?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect!!!

push my @croft, $filename;
next;
Expand All @@ -153,7 +154,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