X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=tools%2FclitkImageConvertGenericFilter.cxx;h=51a43a029a60fa239ebd0840465751af3198cd63;hb=d9c8c6e6c759655fc24d05d47b962d2ba574b95d;hp=1e95a7bb53ca9e29408850e90cb4c5bd82ff877f;hpb=c91252d780814d0d771464cdbce0f0a2cf94e891;p=clitk.git diff --git a/tools/clitkImageConvertGenericFilter.cxx b/tools/clitkImageConvertGenericFilter.cxx index 1e95a7b..51a43a0 100644 --- a/tools/clitkImageConvertGenericFilter.cxx +++ b/tools/clitkImageConvertGenericFilter.cxx @@ -148,6 +148,10 @@ void clitk::ImageConvertGenericFilter::UpdateWithInputImageType() // Read the attribute Image Position (Patient) gdcm::Tag DetectorInformationSequenceTag(0x0054,0x0022); const gdcm::DataElement & DIS = ds.GetDataElement(DetectorInformationSequenceTag); + if (!DIS.GetByteValue()) { + std::cout << "Error: could not find 0x0054,0x0022 tag. Abort." << std::endl; + exit(0); + } gdcm::SmartPointer sqf = DIS.GetValueAsSQ(); gdcm::Item & item = sqf->GetItem(1); gdcm::DataSet & ds_position = item.GetNestedDataSet();