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

Conversation

nicolasbrossard
Copy link
Collaborator

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

@@ -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!!!

Copy link
Collaborator

@cmadjar cmadjar left a 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

Copy link
Collaborator

@cmadjar cmadjar left a comment

Choose a reason for hiding this comment

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

LGTM!

@cmadjar cmadjar added this to the 20.2 milestone Jan 3, 2019
@cmadjar cmadjar merged commit 191d58f into aces:minor Jan 3, 2019
@cmadjar cmadjar added the Bug label Jan 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove DICOM header (0020,0032) from check to decide whether to include/reject a DICOM file
2 participants