28 gdcm::Scanner scanner;
29 std::map<std::string, std::map<gdcm::Tag, std::string>> tagInformations;
31 const gdcm::Tag tagSliceLocation(0x0020, 0x1041);
32 scanner.AddTag(tagSliceLocation);
34 const gdcm::Tag tagInstanceNumber(0x0020, 0x0013);
35 scanner.AddTag(tagInstanceNumber);
37 const gdcm::Tag tagSOPInstanceNumber(0x0008, 0x0018);
38 scanner.AddTag(tagSOPInstanceNumber);
44 gdcm::Scanner::MappingType &tagValueMappings =
const_cast<gdcm::Scanner::MappingType &
>(scanner.GetMappings());
46 for (std::vector<std::string>::const_iterator fIter = files.begin(); fIter != files.end(); ++fIter)
48 std::map<gdcm::Tag, std::string> tags;
50 std::pair<gdcm::Tag, std::string>(tagSliceLocation, tagValueMappings[fIter->c_str()][tagSliceLocation]));
52 std::pair<gdcm::Tag, std::string>(tagInstanceNumber, tagValueMappings[fIter->c_str()][tagInstanceNumber]));
54 std::pair<gdcm::Tag, std::string>(tagSOPInstanceNumber, tagValueMappings[fIter->c_str()][tagSOPInstanceNumber]));
56 tagInformations.insert(std::pair<std::string, std::map<gdcm::Tag, std::string>>(fIter->c_str(), tags));
59 return tagInformations;
77 std::list<mitk::Image::Pointer>
images;
78 std::map<mitk::Image::Pointer, mitk::DicomSeriesReader::StringContainer> fileMap;
82 for (mitk::DicomSeriesReader::FileNamesGrouping::const_iterator seriesIter = seriesInFiles.begin();
83 seriesIter != seriesInFiles.end();
95 images.push_back(image);
96 fileMap.insert(std::pair<mitk::Image::Pointer, mitk::DicomSeriesReader::StringContainer>(image, files));
102 const gdcm::Tag tagSliceLocation(0x0020, 0x1041);
103 const gdcm::Tag tagInstanceNumber(0x0020, 0x0013);
104 const gdcm::Tag tagSOPInstanceNumber(0x0008, 0x0018);
106 for (std::list<mitk::Image::Pointer>::const_iterator imageIter = images.begin(); imageIter != images.end();
112 std::map<std::string, std::map<gdcm::Tag, std::string>> tagInformations =
125 MITK_TEST_CONDITION(sliceLocation !=
nullptr,
"Test if tag for slice location has been set to mitk image");
126 if (sliceLocation !=
nullptr)
137 "Test if value for slice location is correct");
142 MITK_TEST_CONDITION(instanceNumber !=
nullptr,
"Test if tag for image instance number has been set to mitk image");
143 if (instanceNumber !=
nullptr)
154 "Test if value for instance number is correct");
159 MITK_TEST_CONDITION(SOPInstnaceNumber !=
nullptr,
"Test if tag for SOP instance number has been set to mitk image");
160 if (SOPInstnaceNumber !=
nullptr)
171 "Test if value for SOP instance number is correct");
#define MITK_TEST_CONDITION_REQUIRED(COND, MSG)
std::vector< std::string > StringContainer
Lists of filenames.
static DataNode::Pointer LoadDicomSeries(const StringContainer &filenames, bool sort=true, bool load4D=true, bool correctGantryTilt=true, UpdateCallBackMethod callback=nullptr, itk::SmartPointer< Image > preLoadedImageBlock=nullptr)
int mitkDicomSeriesReaderTest(int argc, char *argv[])
section GeneralTestsDeprecatedOldTestingStyle Deprecated macros All tests with MITK_TEST_BEGIN()
ValueType GetTableValue(IdentifierType id) const
static std::map< std::string, std::map< gdcm::Tag, std::string > > GetTagInformationFromFile(mitk::DicomSeriesReader::StringContainer files)
#define MITK_TEST_CONDITION(COND, MSG)
static FileNamesGrouping GetSeries(const std::string &dir, bool groupImagesWithGantryTilt, const StringContainer &restrictions=StringContainer())
see other GetSeries().
Image class for storing images.
std::map< std::string, ImageBlockDescriptor > FileNamesGrouping
section MAP_FRAME_Mapper_Settings Mapper settings For the mapping of corrected images
const LookupTableType & GetLookupTable() const
virtual T GetValue() const