[Insight-users] DicomSeriesReadPrintTags.cxx runtime error :"iterator not derefenceable"

Árpád Szamosi szamosi.arpad at gmail.com
Thu Aug 13 13:23:42 EDT 2009


I use 3.14.0, but I cleared the line return EXIT_FAILURE, because I
use that embedded in an vtkKWWidgets GUI .Sorry Im forgot that tell
you.
Anyway  if I paste "else" then "if" like:
if( tagItr == end )
    {
    std::cerr << "Tag " << entryId;
    std::cerr << " not found in the DICOM header" << std::endl;

    }
  else
	{
	  MetaDataStringType::ConstPointer entryvalue =
		dynamic_cast<const MetaDataStringType *>( tagItr->second.GetPointer() );

	  if( entryvalue )
		{
		std::string tagvalue = entryvalue->GetMetaDataObjectValue();
		std::cout << "Patient's Name (" << entryId <<  ") ";
		std::cout << " is: " << tagvalue << std::endl;
		}
	}
Look like works: If is there tag print that but if isnt the program to
continous.

Bill Lorensen<bill.lorensen at gmail.com> írta (2009. augusztus 13. 18:57):
> The program should return after that message.  There should be a:
> return EXIT_FAILURE;
>
> That return was added almost 3 years ago. WHat version of itk are you using?
>
> Bill
>
> 2009/8/13 Árpád Szamosi <szamosi.arpad at gmail.com>:
>> Sorry I tell it wrong. I get the message too :"Tag .....  not found in
>> the DICOM header". The runtime error come after that.
>>
>> 2009/8/13 Bill Lorensen <bill.lorensen at gmail.com>:
>>> I just tried that example with a bad tag and it correctly exited with
>>> the message:
>>>
>>> Tag 7710|0010 not found in the DICOM header
>>>
>>> My build has full stl iterator checking enabled.
>>>
>>> I cannot explain why your version is failing.
>>>
>>> Bill
>>>
>>> On Thu, Aug 13, 2009 at 10:42 AM, Arepi<szamosi.arpad at gmail.com> wrote:
>>>>
>>>> Hi,
>>>>
>>>> I try out the DicomSeriesReadPrintTags.cxx. Its work fine but when I change
>>>> the the DICOM tag in expression:
>>>> std::string entryId = "0010|0010";
>>>> DictionaryType::ConstIterator tagItr = dictionary.Find( entryId );
>>>> to an tag which not implemented in the actual DICOM  header make runtime
>>>> error with message: "iterator not derefenceable". I suppose that in case
>>>> shloud execute:
>>>> if( tagItr == end )
>>>>    {
>>>>    std::cerr << "Tag " << entryId;
>>>>    std::cerr << " not found in the DICOM header" << std::endl;
>>>>
>>>>    }
>>>> Can anybody explain whats wrong?
>>>>
>>>> Thanks
>>>>
>>>> Arepi
>>>> --
>>>> View this message in context: http://www.nabble.com/DicomSeriesReadPrintTags.cxx-runtime-error-%3A%22iterator-not-derefenceable%22-tp24954912p24954912.html
>>>> Sent from the ITK - Users mailing list archive at Nabble.com.
>>>>
>>>> _____________________________________
>>>> Powered by www.kitware.com
>>>>
>>>> Visit other Kitware open-source projects at
>>>> http://www.kitware.com/opensource/opensource.html
>>>>
>>>> Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ
>>>>
>>>> Follow this link to subscribe/unsubscribe:
>>>> http://www.itk.org/mailman/listinfo/insight-users
>>>>
>>>
>>
>


More information about the Insight-users mailing list