-
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
Header (0020,0032) now only checked when -slicepos is passed on the command line #365
Conversation
dicom-archive/get_dicom_info.pl
Outdated
@@ -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"; |
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.
@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)"
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.
@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?
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.
Perfect!!!
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.
@nicolasbrossard Tested it and it works. Just need to change the message to what you proposed when using the -slicepos option
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.
LGTM!
This PR modifies the behaviour of script
get_dicom_info.pl
: DICOM files passed as arguments to this script are now reported as not being DICOM only if they don't have header(0020,0032)
and-slicepos
was passed on the command line.dcmodify -e
can be useful during testing if one wants to remove header(0020,0032)
from an existing DICOM file.This fixes issue #364