[Insight-users] Also problem with MetaDataDictionaryArray

O'Connor, Aonghus A.OConnor at ucc.ie
Wed Feb 21 13:07:57 EST 2007


Hi markus,
I'm having the exact same problem at the moment.
Did you find a solution to it?
Aonghus
 
 
 
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/20070221/e5787211/attachment.html


More information about the Insight-users mailing list