[Insight-users] store DictionaryArrayRawPointer

Luis Ibanez luis.ibanez at kitware.com
Sat Dec 6 18:28:42 EST 2008


I vote for Bill's solution...

     Luis


----------------------
Bill Lorensen wrote:
> The series reader deletes all of the elements of the
> MetaDataDictionaryArray when it is destructed. The
> MetaDataDictionaryArray is a vector of raw dictionary pointers. So, it
> looks to me that once the series reader is deleted, the pointers are
> no longer valid.
> 
> You could create a new MetaDataDictionaryArray and using operator =,
> copy each of the dictionaries after an Update() on the series reader.
> I've never tried this but it might work.
> 
> Others may have a better solution.
> 
> Bill
> 
> On Wed, Dec 3, 2008 at 10:58 AM, Laurent Paul <l.paul at uclouvain.be> wrote:
> 
>>Hi all,
>>
>>I'm trying to open a dicom series, make some stuffs and write it. I'm aware of the potential danger, but I'm trying!
>>Everything is fine when I do:
>>SeriesWriter->SetMetaDataDictionaryArray( SeriesReader->GetMetaDataDictionaryArray());
>>
>>But for memory consumption, I wish to "delete()" all intermediary filters including SeriesReader. So I tried to store
>>the DictionaryArrayRawPointer and give it back to the writer :
>>ReaderType::DictionaryArrayRawPointer DicomDictionaryArray;
>>DicomDictionaryArray = SeriesReader->GetMetaDataDictionaryArray();
>>SeriesWriter->SetMetaDataDictionaryArray( DicomDictionaryArray);
>>
>>The issue is that I get a runtime error because of the pointer.
>>I guess that it is only a C++ issue but I can't find the key...
>>
>>Thanks for your ideas!
>>
>>Laurent.
>>
>>
>>_______________________________________________
>>Insight-users mailing list
>>Insight-users at itk.org
>>http://www.itk.org/mailman/listinfo/insight-users
>>
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> 


More information about the Insight-users mailing list