-
-
Notifications
You must be signed in to change notification settings - Fork 726
ENH: Add regression test for reading legacy multi-frame DICOM #315
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 39bdfb6ac14e79744d717a80733456dc17b23e7f8917660ded9f23f3cce50800b336f3e303ea024fc9681433c248df91b04a38cc1f9ebbfc1ead98648ed63aca |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 84d22e7b3e6df2c53eca5444d5dd113dc5d6b0f7589ee9a22667222cec99cde2d33a35eb705fbcb1b9959788eec14d7b2011312ea1270104905612698e772d2b |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| /*========================================================================= | ||
| * | ||
| * Copyright Insight Software Consortium | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0.txt | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * | ||
| *=========================================================================*/ | ||
| #include <iostream> | ||
| #include "itkGDCMImageIO.h" | ||
| #include "itkImageFileReader.h" | ||
| #include "itkImageFileWriter.h" | ||
|
|
||
| // This test verifies that we obtain the correct origin and spacing for a | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure I understand the actual goal of this test. I do not see a comparison being done against the original (legacy) MR Image Storage Series. I guess someine validated it both are the same, but it would be good to mention that in the test.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test is checking the |
||
| // Legacy MultiFrame DICOM file with IOD | ||
| // LegacyConvertedEnhancedMRImageStorage. | ||
|
|
||
| int itkGDCMLegacyMultiFrameTest(int argc, char *argv[]) | ||
| { | ||
| if(argc < 3) | ||
| { | ||
| std::cerr << "Usage: " << argv[0] << " <InputLegacyMultiFrameDICOM> <OutputFile>" << std::endl; | ||
| return EXIT_FAILURE; | ||
| } | ||
|
|
||
| const char * inputFileName = argv[1]; | ||
| const char * outputFileName = argv[2]; | ||
|
|
||
| using PixelType = unsigned short; | ||
| constexpr unsigned int Dimension = 3; | ||
| using ImageType = itk::Image<PixelType, Dimension>; | ||
|
|
||
| using ReaderType = itk::ImageFileReader<ImageType>; | ||
| ReaderType::Pointer reader = ReaderType::New(); | ||
| itk::GDCMImageIO::Pointer imageIO = itk::GDCMImageIO::New(); | ||
| reader->SetImageIO( imageIO ); | ||
| reader->SetFileName( inputFileName ); | ||
|
|
||
| using WriterType = itk::ImageFileWriter<ImageType>; | ||
| WriterType::Pointer writer = WriterType::New(); | ||
| writer->SetInput( reader->GetOutput() ); | ||
| writer->SetFileName( outputFileName ); | ||
| try | ||
| { | ||
| writer->Update(); | ||
| } | ||
| catch( itk::ExceptionObject & error ) | ||
| { | ||
| std::cerr << "Error when running pipeline: " << error << std::endl; | ||
| return EXIT_FAILURE; | ||
| } | ||
|
|
||
| return EXIT_SUCCESS; | ||
| } | ||
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.
I think it would be quite helpful to make this more accessible to broader group of users if direct download pointers for the datasets could be added in the comments here. It takes quite a lot of time and space to checkout/configure/download ITK source and data. I also think there should be a link to the original MR series that was converted into the legacy enhanced dataset, since the ultimate test is whether the geometry (and slice order) of the image volume is the same while loading from the original non-enhanced series and the legacy enhanced one.
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.
Here's the link to the original non-enhanced MR series: https://www.dropbox.com/s/8m7ugu4cmw83fvd/dicoms-anon.zip?dl=0
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.
Yes -- after merged and the nightly data upload occurs, the data will be available here.
Thanks for the link, I will add a reference to this in a comment.