[Insight-users] Also problem with MetaDataDictionaryArray

Markus Weigert m.weigert at fz-juelich.de
Thu May 11 07:53:50 EDT 2006


Hi once again,

now that I solved the CT dicom value ranges problem (thanks to
Mathieu and Wilfred), I already have a new problem.

After I have resampled an Image (more slices) which comes from a serie of
dicom files, I want to write it back to a dicom serie.

Therefore, I need to append some new MetaDataDictionary entries to the 
MetaDataDictionaryArray
(via std::Vector::push_back()).

Unfortunately, I have some problems to do this.
Also I think, it is perhaps a simple task, but there is a typecasting 
problem which I couldn't solve
up to this point.

My code is as follows (just a few lines):

typedef itk::MetaDataDictionary                 DictionaryType;
const std::vector<DictionaryType*>*         dictArray

for(int i=0;i<nameGenerator->GetFileNames().size();i++){

        //Check if there are enough MetaDataDictionaries in the 
MetaDataDictionaryArray.
        //This may not be the case, if the image from the original Dicom 
serie has been resampled e.g.

        if(i>=dictArray->size()){
            const DictionaryType* dict = dictArray->at(i-1);
            DictionaryType nDict = DictionaryType(*dict);       //copy 
constructor

             //now, how to append the new value???
            
dictArray->push_back(reinterpret_cast<DictionaryType&>(nDict));     
//doesn't work
        }
        .....

I hope, somebody may help me here too, I think it should be not to 
difficult.


Regards,
Markus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20060511/34a35877/attachment.html


More information about the Insight-users mailing list